src/libraries/models/Photo.php
/**
    * Photo urls are either to existing files on the remote filesystem or a call back to this server to generate it.
    * The requested photo is looked up in the database and if it exists is returned.
    * If it does not exist then a URL which will generate, store and return it when called is returned.
    *
    * @param array $photo The photo object as returned from the database.
    * @param int $width The width of the requested photo.
    * @param int $height The height of the requested photo.
    * @param string $options Optional options to be applied on the photo
    * @param string $protocol Protocol for the URL
    * @return mixed string URL on success, FALSE on failure
    */
Photo urls are either to existing files on the remote filesystem or a call back to this server to generate it.
The requested photo is looked up in the database and if it exists is returned.
If it does not exist then a URL which will generate, store and return it when called is returned.

@param array $photo The photo object as returned from the database.
@param int $width The width of the requested photo.
@param int $height The height of the requested photo.
@param string $options Optional options to be applied on the photo
@param string $protocol Protocol for the URL
@return mixed string URL on success, FALSE on failure
Photo urls are either to existing files on the remote filesystem or a call back to this server to generate it . The requested photo is looked up in the database and if it exists is returned . If it does not exist then a URL which will generate store and return it when called is returned . @param array $photo The photo object as returned from the database . @param int $width The width of the requested photo . @param int $height The height of the requested photo . @param string $options Optional options to be applied on the photo @param string $protocol Protocol for the URL @return mixed string URL on success FALSE on failure
public function generateUrlPublic($photo, $width, $height, $options = null, $protocol = 'http')
  {
    $key = $this->generateCustomKey($width, $height, $options);
    if(isset($photo[$key]))
      return "{$protocol}://{$photo['host']}{$photo[$key]}";
    elseif(isset($photo['id']))
      return "{$protocol}://{$_SERVER['HTTP_HOST']}".$this->generateUrlInternal($photo['id'], $width, $height, $options);
    else
      return false;
  }
public function generateUrlPublic ( $ photo , $ width , $ height , $ options = null , $ protocol = 'http' ) { $ key = $ this -> generateCustomKey ( $ width , $ height , $ options ) ; if ( isset ( $ photo [ $ key ] ) ) return " { $ protocol } :// { $ photo [ 'host' ] } { $ photo [ $ key ] } " ; elseif ( isset ( $ photo [ 'id' ] ) ) return " { $ protocol } :// { $ _SERVER [ 'HTTP_HOST' ] } " . $ this -> generateUrlInternal ( $ photo [ 'id' ] , $ width , $ height , $ options ) ; else return false ; }
Photo urls are either to existing files on the remote filesystem or a call back to this server to generate it.
Photo urls are either to existing files on the remote filesystem or a call back to this server to generate it .