Hawk - PHP documentation
  • Namespace
  • Class
  • Tree

Namespaces

  • Hawk
    • View
      • Plugins

Classes

  • App
  • ButtonInput
  • Cache
  • CheckboxInput
  • ColorInput
  • Conf
  • Controller
  • Crypto
  • DatabaseSessionHandler
  • DatetimeInput
  • DB
  • DBExample
  • DeleteInput
  • Dialogbox
  • EmailInput
  • ErrorHandler
  • Event
  • FileInput
  • FileSystem
  • FloatInput
  • Form
  • FormFieldset
  • FormInput
  • GenericModel
  • GifImage
  • HawkApi
  • HawkUpdater
  • HiddenInput
  • HtmlInput
  • HTTPRequest
  • Icon
  • Image
  • IntegerInput
  • ItemList
  • ItemListField
  • JpegImage
  • Lang
  • Language
  • LeftSidebarTab
  • Less
  • Logger
  • Mail
  • MenuItem
  • Model
  • NoSidebarTab
  • NumberInput
  • ObjectInput
  • Option
  • Panel
  • PasswordInput
  • Permission
  • Plugin
  • PluginInstaller
  • PngImage
  • ProfileQuestion
  • ProfileQuestionValue
  • RadioInput
  • Request
  • Response
  • RightSidebarTab
  • Role
  • RolePermission
  • Route
  • Router
  • SelectInput
  • Session
  • Singleton
  • SubmitInput
  • Tabs
  • TextareaInput
  • TextInput
  • Theme
  • TimeInput
  • Upload
  • User
  • View
  • ViewPlugin
  • Widget
  • WysiwygInput

Traits

  • Utils

Exceptions

  • AppStopException
  • DBExampleException
  • DBException
  • FileSystemException
  • HawkApiException
  • ImageException
  • MailException
  • UploadException
  • ViewException

Class Cache

This class is used to manage cache in Hawk. It allows to save cache files in the folder /cache, and detect if a file is cached. This class is very useful to increase the application performances.

Hawk\Singleton
Extended by Hawk\Cache
Namespace: Hawk
Package: Core
Located at Cache.php

Methods summary

public string
# getCacheFilePath( string $cacheFile )

Get the full path for a given cache file path, relative to CACHE_DIR

Get the full path for a given cache file path, relative to CACHE_DIR

Parameters

$cacheFile
The path of the cache file

Returns

string
The full path of the cache file
public boolean
# isCached( string $source, string $cacheFile )

Check if a file is cached. This function returns true if $cacheFile does not exist or if $source is newer than $cacheFile

Check if a file is cached. This function returns true if $cacheFile does not exist or if $source is newer than $cacheFile

Parameters

$source
The path of the source file
$cacheFile
The path of the cache file, relative to CACHE_DIR

Returns

boolean
True if the file cached, else false
public string
# getCacheContent( string $cacheFile )

Get the content of a cache file

Get the content of a cache file

Parameters

$cacheFile
The path of the cache file

Returns

string
The content of the cache file
public mixed
# includeCache( string $cacheFile )

Include a cache file

Include a cache file

Parameters

$cacheFile
The cache file to include

Returns

mixed
The data returned in the cache file
public
# save( string $cacheFile, string $content )

Save data in a cache file

Save data in a cache file

Parameters

$cacheFile
The path of the cache file, relative to CACHE_DIR
$content
The content to write in the cache file
public
# clear( string $cacheFile = '*' )

Clear a cache file or directory

Clear a cache file or directory

Parameters

$cacheFile
The cache file or directory to clear

Methods inherited from Hawk\Singleton

__construct(), getInstance()

Properties summary

protected static Hawk\Cache $instance

The cache instance

The cache instance

#
Hawk - PHP documentation API documentation generated by ApiGen