[ class tree: plugins ] [ index: plugins ] [ all elements ]

Class: static_html_cache

Source Location: /zp-extensions/static_html_cache.php

Class static_html_cache

Class Overview

Used to cache Theme pages (i.e. those pages launched by the Zenphoto index.php script.)

Exceptions to this are the password.php and 404.php pages, any page listed in the Excluded pages option, and any page whose script makes a call on the static_cache_html::disable() function. NOTE: this function only prevents the creation of a cache image of the page being viewed. If there is already an existing cached page and none of the other exclusions are in effect, the cached page will be shown.

Caching is also aborted when the page being rendered is not static. For instance pages containing a link to the image processor will not be cached so that the image may be cached and the link changed to the cache folder. Similarly, pages which contain comment forms are not cached because then the comment would never show.

In addition, caching does not occur for pages viewed by Zenphoto users if the user has ADMIN privileges or if he is the manager of an album being viewed or whose images are being viewed. Likewise, Zenpage News and Pages are not cached when viewed by the author.

Located in /zp-extensions/static_html_cache.php [line 56]



		
				Author(s):
		
  • Malte Müller (acrylian)
Information Tags:

Properties

Methods

[ Top ]
Property Summary
mixed   $enabled  

[ Top ]
Method Summary
static void   clearHTMLCache()   Cleans out the cache folder. (Adpated from the zenphoto image cache)
static void   disable()   call to disable caching a page
static string   _disable()   used to disable cashing when the uri is an image processor uri
void   abortHTMLCache()   Aborts HTML caching
bool   checkIfAllowedPage()   Checks if the current page should be excluded from caching.
string   createCacheFilepath()   Creates the path and filename of the page to be cached.
void   deletestatic_html_cacheFile()   Deletes a cache file
void   endHTMLCache()   Ends the caching: Ends the output buffering and writes the html cache file from the buffer
void   getOptionsSupported()  
void   handleOption()  
void   startHTMLCache()   Starts the caching: Gets either an already cached file if existing or starts the output buffering.
void   static_html_cache_options()  

[ Top ]
Properties
mixed   $enabled = true [line 58]

[ Top ]
Methods
static method clearHTMLCache  [line 304]

  static void clearHTMLCache( [ $folder = NULL], string $cachefolder  )

Cleans out the cache folder. (Adpated from the zenphoto image cache)

Parameters:
string   $cachefolder:  the sub-folder to clean
   $folder: 


[ Top ]
static method disable  [line 318]

  static void disable( )

call to disable caching a page



[ Top ]
static method _disable  [line 345]

  static string _disable( string $uri  )

used to disable cashing when the uri is an image processor uri

Parameters:
string   $uri: 


[ Top ]
abortHTMLCache  [line 212]

  void abortHTMLCache( )

Aborts HTML caching

Used for instance, when there is a 404 error or such



[ Top ]
checkIfAllowedPage  [line 71]

  bool checkIfAllowedPage( )

Checks if the current page should be excluded from caching.

Pages that can be excluded are custom pages included Zenpage pages (these optionally more specific by titlelink) and the standard theme pages image.php (optionally by image file name), album.php (optionally by album folder name) or index.php



[ Top ]
createCacheFilepath  [line 224]

  string createCacheFilepath( $accessType  )

Creates the path and filename of the page to be cached.

Parameters:
   $accessType: 


[ Top ]
deletestatic_html_cacheFile  [line 292]

  void deletestatic_html_cacheFile( string $cachefilepath  )

Deletes a cache file

Parameters:
string   $cachefilepath:  Path to the cache file to be deleted


[ Top ]
endHTMLCache  [line 190]

  void endHTMLCache( )

Ends the caching: Ends the output buffering and writes the html cache file from the buffer

Place this function on zenphoto's root index.php file in the absolute last line



[ Top ]
getOptionsSupported  [line 328]

  void getOptionsSupported( )



[ Top ]
handleOption  [line 336]

  void handleOption( $option, $currentValue  )

Parameters:
   $option: 
   $currentValue: 


[ Top ]
startHTMLCache  [line 144]

  void startHTMLCache( )

Starts the caching: Gets either an already cached file if existing or starts the output buffering.



[ Top ]
static_html_cache_options  [line 323]

  void static_html_cache_options( )



[ Top ]

Documentation generated on Sat, 07 Jun 2014 18:03:46 +0200 by phpDocumentor 1.4.3