PHP Class ImageFly

Author: Fady Khalife
ファイルを表示 Open project: bodom78/kohana-imagefly

Protected Properties

Property Type Description
$cache_dir Stores the path to the cache directory which is either whats set in the config "cache_dir" or processed sub directories when the "mimic_source_dir" config option id set to TRUE
$cached_file The cached filename with path ($this->cache_dir)
$config This modules config options
$image Kohana image instance
$serve_default A flag for weither we should serve the default or cached image
$source_dir Stores the path to the source directory (set in the config "source_dir")
$source_file The source filepath and filename
$source_modified Last modified Unix timestamp of the source file
$url_params Stores the URL params in the following format

Public Methods

Method Description
__construct ( ) Constructorbot

Private Methods

Method Description
_cached_exists ( ) : boolean Checks if a physical version of the cached image exists
_cached_required ( ) : boolean Checks that the param dimensions are are lower then current image dimensions
_create_cache_dir ( ) Try to create the config cache dir if required Set $cache_dir
_create_cached ( ) Creates a cached cropped/resized version of the file
_create_headers ( $file_data ) Create the image HTTP headers
_create_mimic_cache_dir ( ) Try to create the mimic cache dir from the source path if required Set $cache_dir
_encoded_filename ( ) : string Returns a hash of the filepath and params plus last modified of source to be used as a unique filename
_modified_headers ( $last_modified ) Rerurns 304 Not Modified HTTP headers if required and exits
_output_file ( $file_data ) Outputs the cached image file and exits
_serve_file ( ) Decide which filesource we are using and serve
_set_params ( ) Sets the operations params from the url

Method Details

__construct() public method

Constructorbot
public __construct ( )

Property Details

$cache_dir protected_oe property

Stores the path to the cache directory which is either whats set in the config "cache_dir" or processed sub directories when the "mimic_source_dir" config option id set to TRUE
protected $cache_dir

$cached_file protected_oe property

The cached filename with path ($this->cache_dir)
protected $cached_file

$config protected_oe property

This modules config options
protected $config

$image protected_oe property

Kohana image instance
protected $image

$serve_default protected_oe property

A flag for weither we should serve the default or cached image
protected $serve_default

$source_dir protected_oe property

Stores the path to the source directory (set in the config "source_dir")
protected $source_dir

$source_file protected_oe property

The source filepath and filename
protected $source_file

$source_modified protected_oe property

Last modified Unix timestamp of the source file
protected $source_modified

$url_params protected_oe property

Stores the URL params in the following format
protected $url_params