phpDocumentor GloryLands
Common
[ class tree: GloryLands ] [ index: GloryLands ] [ all elements ]

Class: GLOptimizer

Source Location: /engine/lib/common/optimizer.php

Class GLOptimizer

Class Overview

File/Data optimizer This class is the optimization core that porivdes data, file or optimization in order to make the overall execution fast and light.

File/Data optimizer This class is the optimization core that porivdes data, file or optimization in order to make the overall execution fast and light.

Located in /engine/lib/common/optimizer.php [line 44]



		
				Author(s):
		
Information Tags:
Version:  1.0

Methods

[ Top ]
Method Summary
static void   initialize()   Initialize optimizer This function will look into the extensions_optimizers table and register all the optimizers that are defined inside.
static GLDynamicPath   optimize()   Quick optimization function This function will automatically detect if the passed parameter is a string or a file and will call the optimize_file or optimize_string accordingly.
static GLDynamicPath   optimize_file()   Optimize a file
static string   optimize_string()   Optimize a string Usually, this involves compressing, translating, encoding conversions etc.
static void   register()   Register an optimizer handler

[ Top ]
Methods
static method initialize  [line 54]

  static void initialize( )

Initialize optimizer This function will look into the extensions_optimizers table and register all the optimizers that are defined inside.

Initialize optimizer This function will look into the extensions_optimizers table and register all the optimizers that are defined inside.


API Tags:
Access:  public


[ Top ]
static method optimize  [line 87]

  static GLDynamicPath optimize( string $what, [string $type = ''], [array $options = array()]  )

Quick optimization function This function will automatically detect if the passed parameter is a string or a file and will call the optimize_file or optimize_string accordingly.

Quick optimization function This function will automatically detect if the passed parameter is a string or a file and will call the optimize_file or optimize_string accordingly.

Parameters:
string   $what:  The filename or the string to optimize
string   $type:  The passed file/string type (ex. 'image', 'template', 'script', ...)
array   $options:  You can optionally provide additional options for the operation (ex. quality in JPEG)

API Tags:
Return:  This function returns a dynamic path that can be used either as URL or as abdsolute disk path
Access:  public


[ Top ]
static method optimize_file  [line 105]

  static GLDynamicPath optimize_file( string $what, [string|array $type = ''], [array $options = array()]  )

Optimize a file

Optimize a file Usually, this involves compiling of a PHP script, translating some short-hand expressions, compressing, or

Parameters:
string   $what:  The filename or the string to optimize
string|array   $type:  The passed file type (ex. 'image', 'template', 'script', ...) It can also be a comma-separated list (ex. 'image,template'), or an array (ex. array('image','template') )
array   $options:  You can optionally provide additional options for the operation (ex. quality in JPEG)

API Tags:
Return:  This function returns a dynamic path that can be used either as URL or as abdsolute disk path
Access:  public


[ Top ]
static method optimize_string  [line 126]

  static string optimize_string( string $what, [string|array $type = ''], [array $options = array()]  )

Optimize a string Usually, this involves compressing, translating, encoding conversions etc.

Optimize a string Usually, this involves compressing, translating, encoding conversions etc.

Parameters:
string   $what:  The filename or the string to optimize
string|array   $type:  The passed file type (ex. 'image', 'template', 'script', ...) It can also be a comma-separated list (ex. 'image,template'), or an array (ex. array('image','template') )
array   $options:  You can optionally provide additional options for the operation (ex. quality in JPEG)

API Tags:
Return:  This function returns the new, optimized string
Access:  public


[ Top ]
static method register  [line 70]

  static void register( string $file, string $class  )

Register an optimizer handler

Register an optimizer handler

Parameters:
string   $file:  The filename that hosts the class to be instanced
string   $class:  The handler class name

API Tags:
Access:  public

Information Tags:
Todo:  The include_once must be performed by the appropriate extension

[ Top ]

Documentation generated on Tue, 13 Oct 2009 23:49:14 +0300 by phpDocumentor 1.4.1