Public Member Functions | |
__construct () | |
check_cache ($_data, $template_path, $template_id, $elements, $caching) | |
create_minified ($file) | |
display ($file_path, $cache=false, $elements=false) | |
shortcodes ($data) | |
css_data ($data) | |
optimize_css ($files) | |
javascript_data ($data, $type) | |
optimize_javascript ($files, $type) | |
js_packers ($file_content) | |
include_debugger () | |
include_packer () | |
Packer ($js_file) | |
JSmin ($js_file) | |
JShrink ($js_file) | |
JSminplus ($js_file) | |
gzip_data ($data) | |
save_data ($data, $path, $modifiers=false) | |
meta_data ($data) | |
fix_newlines_for_clean_html ($fixthistext) | |
clean_html_code ($uncleanhtml) | |
clear_cache ($template_id=false) | |
clean_file ($content) | |
browser_info ($agent=null) | |
getRequestHeaders () | |
caculate_lifetime () | |
check_browser_set_extension () | |
Data Fields | |
$domain = 'http://localhost/TIDengine/' | |
$root_cache = 'cache/' | |
$pages_cache = 'pages/' | |
$css_cache = 'css/' | |
$js_cache = 'javascript/' | |
$javascript_source = 'javascript/native/source/' | |
$javascript_minified = 'javascript/native/minified/' | |
$frameworks_source = 'javascript/frameworks/' | |
$css_source = 'css/' | |
$cache_naming = 'md5' | |
$cache_name_pre = '(' | |
$cache_name_post = ')-' | |
$cache_extension = '.tpl.php' | |
$server_caching = true | |
$client_caching = true | |
$gzip = true | |
$compression_level = 4 | |
$cache_lifetime = array('page'=>'1.month', 'css'=>'6.month', 'javascript'=>'6.month', 'frameworks'=>'6.month') | |
$xhtml_code_operations = 'indent' | |
$xhtml_code_indentation = ' ' | |
$optimize_css = true | |
$optimize_css_gz = true | |
$compact_css = true | |
$css_file_name = 'master' | |
$css_ext = '.css' | |
$optimize_javascript = true | |
$combine_all_javascript = true | |
$compact_javascript = true | |
$optimize_javascript_gz = true | |
$packer = 'jsmin' | |
$js_ext = '.js' | |
$javascript_combined = 'combined' | |
$javascript_filename = 'javascript' | |
$framework_filename = 'framework' | |
$frameworks_type = 'minified' | |
Private Attributes | |
$shortcodes = array() | |
$data_changes_check | |
$modification_time | |
$template_id | |
$configuration_file = '' | |
$meta_spec = array('Content-Language', 'Expires', 'Pragma', 'Cache-Control', 'imagetoolbar') | |
$debug_meta = false |
TIDEngine core class
Definition at line 9 of file TIDEngine.php.
__construct | ( | ) |
Class constructor.
Detailed instructions inside Class inline comments
Definition at line 476 of file TIDEngine.php.
check_cache | ( | $ | _data, |
$ | template_path, | ||
$ | template_id, | ||
$ | elements, | ||
$ | caching | ||
) |
Checks for Cache existance, Cache file validity and Cache expiration time.
Detailed instructions inside Class inline comments
array | $_data | - Data to be phrased to template shortcodes array key = SHORTCODE, array value = DATA. |
string | $template_path | - Path to template file |
string | $template_id | - Template name |
array | $elements | - Extra elements we need to include, default header, body and footer. |
bool | $caching | - Do we use caching for specific template |
Definition at line 509 of file TIDEngine.php.
create_minified | ( | $ | file ) |
Create minified version of source Javascript files
string | $file |
Definition at line 807 of file TIDEngine.php.
display | ( | $ | file_path, |
$ | cache = false , |
||
$ | elements = false |
||
) |
Display page and|or Create Cache file.
string | $file_path | - path to template or cache file. |
bool | $cache | - we need to create cache file controll variable |
bool | $elements | - page elements. |
Definition at line 821 of file TIDEngine.php.
shortcodes | ( | $ | data ) |
shortcodes($data) - Set shortcodes for template
array | $data | - defined shortcodes that must be phrased to template |
Definition at line 930 of file TIDEngine.php.
css_data | ( | $ | data ) |
Set CSS head data. CSS files paths
array | $data | - CSS files paths |
Definition at line 1002 of file TIDEngine.php.
optimize_css | ( | $ | files ) |
Optimize css files
string | $files | - CSS file content |
Definition at line 1052 of file TIDEngine.php.
javascript_data | ( | $ | data, |
$ | type | ||
) |
Set Javascript/Javascript Frameworks
array | $data | - Javascript files |
string | $type | - frameworks or regular Javascript files |
Definition at line 1135 of file TIDEngine.php.
optimize_javascript | ( | $ | files, |
$ | type | ||
) |
Optimize Javascript files
array | $files | |
string | $type |
Definition at line 1185 of file TIDEngine.php.
js_packers | ( | $ | file_content ) |
Optimize Javascript data with different Packers.
string | $file_content |
Definition at line 1260 of file TIDEngine.php.
include_debugger | ( | ) |
Include SEO Optimization Adviser/Debugger Class.
Definition at line 1305 of file TIDEngine.php.
include_packer | ( | ) |
Include defined packer Class in use.
Definition at line 1319 of file TIDEngine.php.
Packer | ( | $ | js_file ) |
Packer - PHP 5 ported version of Dean Edwards Packer
string | $js_file |
Definition at line 1352 of file TIDEngine.php.
JSmin | ( | $ | js_file ) |
JSmin - JSmin packer PHP ported version of Dean Edwards JS
string | $js_file |
Definition at line 1364 of file TIDEngine.php.
JShrink | ( | $ | js_file ) |
JShrink - JShrink-0.2.class.php hosted on Google Code
string | $js_file |
Definition at line 1378 of file TIDEngine.php.
JSminplus | ( | $ | js_file ) |
JSminPlus - one more port of Dean Edwards JSmin
string | $js_file |
Definition at line 1391 of file TIDEngine.php.
gzip_data | ( | $ | data ) |
If enabled gzip cache files
string | $data |
Definition at line 1403 of file TIDEngine.php.
save_data | ( | $ | data, |
$ | path, | ||
$ | modifiers = false |
||
) |
Save cache files
string | $data | - file data |
string | $path | - Cache File Path |
bool | $modifiers | - overwrite, append data to file. |
Definition at line 1424 of file TIDEngine.php.
meta_data | ( | $ | data ) |
Set head Page Title and Meta Tags.
array | $data |
Definition at line 1442 of file TIDEngine.php.
fix_newlines_for_clean_html | ( | $ | fixthistext ) |
Function to seperate multiple tags one line. Credits to orginal author.
string | $fixthistext |
Definition at line 1486 of file TIDEngine.php.
clean_html_code | ( | $ | uncleanhtml ) |
Indent XHTML output code $this->xhtml_code_indentation. Credits to orginal author.
string | $uncleanhtml |
Definition at line 1512 of file TIDEngine.php.
clear_cache | ( | $ | template_id = false ) |
clean_file | ( | $ | content ) |
Remove white space, comments etc.
Definition at line 1633 of file TIDEngine.php.
browser_info | ( | $ | agent = null ) |
Code taken php.org and slitly adapted. Lightweight alternative for Browscap.
string | null | $agent | - string to check if we have access by defined agent |
Definition at line 1653 of file TIDEngine.php.
getRequestHeaders | ( | ) |
Get Client Browser headers data.
Definition at line 1685 of file TIDEngine.php.
caculate_lifetime | ( | ) |
Calculate Cache Life Time in miliseconds
Definition at line 1717 of file TIDEngine.php.
check_browser_set_extension | ( | ) |
Workarround for Safari problem with gzipped content we need other type of compressed cache files extensions. As some hosting companies do not support get_browser function I was thinking that best solution is native Browscap class - first time load this class will update all data in cache file. eg. Other browsers .css.gz and .js.gz Safari css.gz.css and js.gz.js
Uncomment this line :
$check_browser = new Browscap($this->Browscap_cache); $browser = $check_browser->getBrowser(null, false); $this->browser = $browser->Browser;
and
$this->Browscap_cache = $this->root_cache . 'Browscap';
also comment this two lines of code:
$browser = $this->browser_info(); $this->browser = ucfirst($browser[0]);
Definition at line 1795 of file TIDEngine.php.