CImage.php
public function downloadRemoteSource($src)
    {
        if (!$this->isRemoteSourceOnWhitelist($src)) {
            throw new Exception("Hostname is not on whitelist for remote sources.");
        }

        $remote = new CRemoteImage();

        if (!is_writable($this->remoteCache)) {
            $this->log("The remote cache is not writable.");
        }

        $remote->setCache($this->remoteCache);
        $remote->useCache($this->useCache);
        $src = $remote->download($src);

        $this->log("Remote HTTP status: " . $remote->getStatus());
        $this->log("Remote item is in local cache: $src");
        $this->log("Remote details on cache:" . print_r($remote->getDetails(), true));

        return $src;
    }
public function downloadRemoteSource($src)
    {
        if (!$this->isRemoteSourceOnWhitelist($src)) {
            throw new Exception("Hostname is not on whitelist for remote sources.");
        }

        $remote = new CRemoteImage();

        if (!is_writable($this->remoteCache)) {
            $this->log("The remote cache is not writable.");
        }

        $remote->setCache($this->remoteCache);
        $remote->useCache($this->useCache);
        $src = $remote->download($src);

        $this->log("Remote HTTP status: " . $remote->getStatus());
        $this->log("Remote item is in local cache: $src");
        $this->log("Remote details on cache:" . print_r($remote->getDetails(), true));

        return $src;
    }
public function downloadRemoteSource ( $ src ) { if ( ! $ this -> isRemoteSourceOnWhitelist ( $ src ) ) { throw new Exception ( "Hostname is not on whitelist for remote sources." ) ; } $ remote = new CRemoteImage ( ) ; if ( ! is_writable ( $ this -> remoteCache ) ) { $ this -> log ( "The remote cache is not writable." ) ; } $ remote -> setCache ( $ this -> remoteCache ) ; $ remote -> useCache ( $ this -> useCache ) ; $ src = $ remote -> download ( $ src ) ; $ this -> log ( "Remote HTTP status: " . $ remote -> getStatus ( ) ) ; $ this -> log ( "Remote item is in local cache: $src" ) ; $ this -> log ( "Remote details on cache:" . print_r ( $ remote -> getDetails ( ) , true ) ) ; return $ src ; }
Download a remote image and return path to its local copy.

@param string $src remote path to image.

@return string as path to downloaded remote source.
Download a remote image and return path to its local copy .