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:
|
Methods
|
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
string
|
optimize_string() |
Optimize a string Usually, this involves compressing, translating, encoding conversions etc. |
| static
void
|
register() |
Register an optimizer handler |
Methods
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:
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 |
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 |
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 |
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:
Information Tags:
| Todo: | The include_once must be performed by the appropriate extension |
|
|