Overview

Namespaces

  • Ludato

Classes

  • HyperCache
  • Overview
  • Namespace
  • Class

Class HyperCache

LUDATO HyperCache

Namespace: Ludato
License: MIT
Author: David Kostal
Located at Ludato/HyperCache.php
Methods summary
public
# __construct( string $directory, string|null $page = NULL, string $param = "default", boolean $dev = FALSE )

Saving params and configuring Note: Paths are saved url-encoded

Saving params and configuring Note: Paths are saved url-encoded

Parameters

$directory
Path to directory for caching
$page
Full page name, including extension (if you want it determined automatically using PHP_SELF, use NULL)
$param
Parameters of caching (eg. for details.php it would be ID). You can combine whatever you want here
$dev
Determines if development texts are shown
public
# startCache( )

Starts caching

Starts caching

public boolean
# saveCache( )

Saves cached file and flushes the buffer (shows output)

Saves cached file and flushes the buffer (shows output)

Returns

boolean
public
# getCache( )

Loads cached file

Loads cached file

public
# autoLoadCache( )

Shows cache and if file is cached, otherwise starts caching and executing the rest of the file

Shows cache and if file is cached, otherwise starts caching and executing the rest of the file

public
# autoEndCache( )

Automaically ending and saving cache

Automaically ending and saving cache

public boolean
# isCached( )

Returns if file is cached

Returns if file is cached

Returns

boolean
Returns true if cached, else returns false.
public
# purgeCurrent( )

Deletes cache for current page and params (eg. You have CMS and publish a new article. You need to purge just article_list.php, not article_details.php. If user publishes comment, purge just article_details.php with param of article name/ID)

Deletes cache for current page and params (eg. You have CMS and publish a new article. You need to purge just article_list.php, not article_details.php. If user publishes comment, purge just article_details.php with param of article name/ID)

public
# purgeAll( )

Purges all files specified cacing directory

Purges all files specified cacing directory

public
# purgePage( )

Purges file for current page (eg. You have CMS and publish a new article. You need to purge just article_list.php, not article_details.php. If user publishes comment, purge just article_details.php with param of article name/ID)

Purges file for current page (eg. You have CMS and publish a new article. You need to purge just article_list.php, not article_details.php. If user publishes comment, purge just article_details.php with param of article name/ID)

public
# purgeCustom( string $directory, string $page, string $param = NULL )

Purge cache from specified directory, for specific page (and params)

Purge cache from specified directory, for specific page (and params)

Deprecated

0.1.0

Parameters

$directory
Caching directory
$page
Page
$param
Params (opt.)
Properties summary
public string $prepend

Valid PHP code (without opening tags) to be prepended to cache

Valid PHP code (without opening tags) to be prepended to cache

#
public string $append

Valid PHP code (without opening tags) to be appended to cache

Valid PHP code (without opening tags) to be appended to cache

#
public boolean $evalPrepend

Determines if prepended code should be eval()'ed when generating cache (alternative - put code before startCache())

Determines if prepended code should be eval()'ed when generating cache (alternative - put code before startCache())

#
public boolean $evalAppend

Determines if appended code should be eval()'ed when generating cache (alternative - put code after saveCache())

Determines if appended code should be eval()'ed when generating cache (alternative - put code after saveCache())

#
API documentation generated by ApiGen