Moodle  2.2.1
http://www.collinsharper.com
Minify_Controller_Base Class Reference
Inheritance diagram for Minify_Controller_Base:

Public Member Functions

 setupSources ($options)
 getDefaultMinifyOptions ()
 getDefaultMinifers ()
 loadMinifier ($minifierCallback)
 mixInDefaultOptions ($options)
 analyzeSources ($options=array())

Static Public Member Functions

static _fileIsSafe ($file, $safeDirs)

Data Fields

 $sources = array()

Protected Member Functions

 log ($msg)

Detailed Description

Definition at line 17 of file Base.php.


Member Function Documentation

static _fileIsSafe ( file,
safeDirs 
) [static]

Is a user-given file within an allowable directory, existing, and having an extension js/css/html/txt ?

This is a convenience function for controllers that have to accept user-given paths

Parameters:
string$filefull file path (already processed by realpath())
array$safeDirsdirectories where files are safe to serve. Files can also be in subdirectories of these directories.
Returns:
bool file is safe

Definition at line 121 of file Base.php.

analyzeSources ( options = array()) [final]

Analyze sources (if there are any) and set $options 'contentType' and 'lastModifiedTime' if they already aren't.

Parameters:
array$optionsoptions for Minify
Returns:
array options for Minify

Definition at line 175 of file Base.php.

Here is the call graph for this function:

Get default minifiers for this controller.

Override in subclass to change defaults

Returns:
array minifier callbacks for common types

Definition at line 73 of file Base.php.

Here is the caller graph for this function:

Get default Minify options for this controller.

Override in subclass to change defaults

Returns:
array options for Minify

Definition at line 41 of file Base.php.

Here is the caller graph for this function:

loadMinifier ( minifierCallback)

Load any code necessary to execute the given minifier callback.

The controller is responsible for loading minification code on demand via this method. This built-in function will only load classes for static method callbacks where the class isn't already defined. It uses the PEAR convention, so, given array('Jimmy_Minifier', 'minCss'), this function will include 'Jimmy/Minifier.php'.

If you need code loaded on demand and this doesn't suit you, you'll need to override this function in your subclass.

See also:
Minify_Controller_Page::loadMinifier()
Parameters:
callback$minifierCallbackcallback of minifier function
Returns:
null

Reimplemented in Minify_Controller_Page.

Definition at line 97 of file Base.php.

log ( msg) [protected]

Send message to the Minify logger

Parameters:
string$msg
Returns:
null

Definition at line 198 of file Base.php.

Here is the caller graph for this function:

mixInDefaultOptions ( options) [final]

Mix in default controller options with user-given options

Parameters:
array$optionsuser options
Returns:
array mixed options

Definition at line 153 of file Base.php.

Here is the call graph for this function:

setupSources ( options) [abstract]

Setup controller sources and set an needed options for Minify::source

You must override this method in your subclass controller to set $this->sources. If the request is NOT valid, make sure $this->sources is left an empty array. Then strip any controller-specific options from $options and return it. To serve files, $this->sources must be an array of Minify_Source objects.

Parameters:
array$optionscontroller and Minify options

return array $options Minify::serve options

Reimplemented in Minify_Controller_Groups, Minify_Controller_Files, Minify_Controller_Page, Minify_Controller_Version1, and Minify_Controller_MinApp.


Field Documentation

$sources = array()

Definition at line 144 of file Base.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations