function actionImage1() { // Create the URL object $url = new YDUrl('http://www.yellowduck.be/images/uploads/kuifjeseend.jpg'); // Get the contents header('Content-type: image/jpeg'); echo $url->getContents(); }
function actionImage1() { // Create the URL object $url = new YDUrl('http://www.yellowduck.be/skins/yellowduck.be/images/kubrickheader1.jpg'); // Get the contents header('Content-type: image/jpeg'); echo $url->getContents(); }
/** * This function loads any type of content based on the YD_XML constants. * * @param $mixed A string, file, url or array for loading when instantiating * the object. Default: empty. * @param $type The type of the $mixed input. Must be one of the following: * YD_XML_FILE, YD_XML_URL, YD_XML_STRING or YD_XML_ARRAY. */ function load($mixed, $type = YD_XML_FILE) { if (empty($mixed)) { trigger_error('No file, string, array or url specified', YD_ERROR); } switch ($type) { case YD_XML_URL: include_once YD_DIR_HOME_CLS . '/YDUrl.php'; $url = new YDUrl($mixed); $contents = $url->getContents(false); break; case YD_XML_FILE: include_once YD_DIR_HOME_CLS . '/YDFileSystem.php'; $file = new YDFSFile($mixed); $contents = $file->getContents(); break; case YD_XML_STRING: $contents = $mixed; break; case YD_XML_ARRAY: $this->loadArray($mixed); return; default: trigger_error('Type of input unknown.', YD_ERROR); } $this->reset(); $this->parseXML($contents); }
function downloadFile($file) { YDUpdateLog::info('Downloading: ' . YDUpdateTools::shortPath($file)); $url = new YDUrl(YDConfig::get('chkoutUrl') . $file); $data = $url->getContents(false); if (strpos($data, 'Index of') === false) { $f = new YDFSFile(YDUpdateTools::tempPath($file), true); $f->setContents($data); } }