Public Member Functions | Data Fields | Private Attributes

TIDEngine Class Reference

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

Detailed Description

TIDEngine core class

Author:
bogyvet

Definition at line 9 of file TIDEngine.php.


Constructor & Destructor Documentation

__construct (  )

Class constructor.

Detailed instructions inside Class inline comments

Definition at line 476 of file TIDEngine.php.

Here is the call graph for this function:


Member Function Documentation

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

Parameters:
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.

Here is the call graph for this function:

create_minified ( file )

Create minified version of source Javascript files

Parameters:
string$file

Definition at line 807 of file TIDEngine.php.

Here is the call graph for this function:

Here is the caller graph for this function:

display ( file_path,
cache = false,
elements = false 
)

Display page and|or Create Cache file.

Parameters:
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.

Here is the call graph for this function:

Here is the caller graph for this function:

shortcodes ( data )

shortcodes($data) - Set shortcodes for template

Parameters:
array$data- defined shortcodes that must be phrased to template

Definition at line 930 of file TIDEngine.php.

Here is the call graph for this function:

Here is the caller graph for this function:

css_data ( data )

Set CSS head data. CSS files paths

Parameters:
array$data- CSS files paths

Definition at line 1002 of file TIDEngine.php.

Here is the call graph for this function:

Here is the caller graph for this function:

optimize_css ( files )

Optimize css files

Parameters:
string$files- CSS file content

Todo:
Add CSSTidy support and some other Libaries

Definition at line 1052 of file TIDEngine.php.

Here is the call graph for this function:

Here is the caller graph for this function:

javascript_data ( data,
type 
)

Set Javascript/Javascript Frameworks

Parameters:
array$data- Javascript files
string$type- frameworks or regular Javascript files

Definition at line 1135 of file TIDEngine.php.

Here is the call graph for this function:

Here is the caller graph for this function:

optimize_javascript ( files,
type 
)

Optimize Javascript files

Parameters:
array$files
string$type
Returns:
string $js - Links

Definition at line 1185 of file TIDEngine.php.

Here is the call graph for this function:

Here is the caller graph for this function:

js_packers ( file_content )

Optimize Javascript data with different Packers.

Parameters:
string$file_content
Returns:
string $optimized_file

Definition at line 1260 of file TIDEngine.php.

Here is the call graph for this function:

Here is the caller graph for this function:

include_debugger (  )

Include SEO Optimization Adviser/Debugger Class.

Todo:
Use SEO Optimization Adviser/Debugger.

Definition at line 1305 of file TIDEngine.php.

include_packer (  )

Include defined packer Class in use.

Todo:
Native Class packer.

Definition at line 1319 of file TIDEngine.php.

Here is the caller graph for this function:

Packer ( js_file )

Packer - PHP 5 ported version of Dean Edwards Packer

Parameters:
string$js_file

Definition at line 1352 of file TIDEngine.php.

Here is the caller graph for this function:

JSmin ( js_file )

JSmin - JSmin packer PHP ported version of Dean Edwards JS

Parameters:
string$js_file

Definition at line 1364 of file TIDEngine.php.

Here is the caller graph for this function:

JShrink ( js_file )

JShrink - JShrink-0.2.class.php hosted on Google Code

Parameters:
string$js_file

Definition at line 1378 of file TIDEngine.php.

Here is the caller graph for this function:

JSminplus ( js_file )

JSminPlus - one more port of Dean Edwards JSmin

Parameters:
string$js_file

Definition at line 1391 of file TIDEngine.php.

Here is the caller graph for this function:

gzip_data ( data )

If enabled gzip cache files

Parameters:
string$data

Definition at line 1403 of file TIDEngine.php.

Here is the caller graph for this function:

save_data ( data,
path,
modifiers = false 
)

Save cache files

Parameters:
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.

Parameters:
array$data

Todo:
$this->debug_meta will be part of TIDEbugger Class

Definition at line 1442 of file TIDEngine.php.

Here is the call graph for this function:

Here is the caller graph for this function:

fix_newlines_for_clean_html ( fixthistext )

Function to seperate multiple tags one line. Credits to orginal author.

Parameters:
string$fixthistext

Definition at line 1486 of file TIDEngine.php.

Here is the caller graph for this function:

clean_html_code ( uncleanhtml )

Indent XHTML output code $this->xhtml_code_indentation. Credits to orginal author.

Parameters:
string$uncleanhtml
Returns:
string implode("\n", $cleanhtml_array)

Definition at line 1512 of file TIDEngine.php.

Here is the call graph for this function:

Here is the caller graph for this function:

clear_cache ( template_id = false )

Manualy clear cache.

Parameters:
string$template_id

Definition at line 1603 of file TIDEngine.php.

clean_file ( content )

Remove white space, comments etc.

Definition at line 1633 of file TIDEngine.php.

Here is the caller graph for this function:

browser_info ( agent = null )

Code taken php.org and slitly adapted. Lightweight alternative for Browscap.

Parameters:
string | null$agent- string to check if we have access by defined agent

Definition at line 1653 of file TIDEngine.php.

Here is the caller graph for this function:

getRequestHeaders (  )

Get Client Browser headers data.

Definition at line 1685 of file TIDEngine.php.

Here is the caller graph for this function:

caculate_lifetime (  )

Calculate Cache Life Time in miliseconds

Definition at line 1717 of file TIDEngine.php.

Here is the caller graph for this function:

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

  • infact this is not strict rule you can set any kind of extension just not to be .gz eg. js.gz.xyz and css.gz.xyz - this will work without problem.

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.

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following file: