SproutCMS

This is the code documentation for the SproutCMS project

Page options:

Inherited members

class Kohana

Provides Kohana-specific helper functions. This is where the magic happens!

$Id: Kohana.php 4372 2009-05-28 17:00:34Z ixmatus $

Authors

Variables

NameVisibilityDescription
$buffer_level (static) 
$cache_lifetime (static) 
$configuration (static) 
$has_error (static) 
$include_paths (static) 
$instance (static) 
$internal_cache (static) 
$internal_cache_path (static) 
$locale (static) 
$output (static) 
$user_agent (static) 
$write_cache (static) 

Functions

NameVisibilityDescription
_obEndCleanprotected (static)Ends the current output buffer with callback in mind
backtracepublic (static)Displays nice backtrace information.
cachepublic (static)Load data from a simple cache file. This should only be used internally,
cacheSavepublic (static)Save data to a simple cache file. This should only be used internally, and
closeBufferspublic (static)Closes all open output buffers, either by flushing or cleaning, and stores the Kohana
configpublic (static)Get a config item or group.
configClearpublic (static)Clears a config group from the cached configuration.
configLoadpublic (static)Load a config file.
configSetpublic (static)Sets a configuration item, if allowed.
debugpublic (static)Quick debugging of any variable. Any number of parameters can be set.
disableCachepublic (static)Disable the find-files and configuration caches
errorHandlerpublic (static)Converts PHP errors into ErrorExceptions
exceptionHandlerpublic (static)Exception handler.
findFilepublic (static)Find a resource file in a given directory. Files will be located according
includePathspublic (static)Get all include paths. APPPATH is the first path, followed by module
instancepublic (static)Loads the controller and initializes it. Runs the pre_controller,
internalCacheSavepublic (static)Saves the internal caches: configuration, include paths, etc.
keyStringpublic (static)Returns the value of a key, defined by a 'dot-noted' string, from an array.
keyStringSetpublic (static)Sets values in an array by using a 'dot-noted' string.
langpublic (static)Fetch an i18n language item.
listFilespublic (static)Lists all files and directories in a resource path.
logpublic (static)Deprecated.
logExceptionpublic (static)Log exceptions in the database
outputBufferpublic (static)Kohana output handler. Called during ob_clean, ob_flush, and their variants.
renderpublic (static)Inserts global Kohana variables into the generated output and prints it.
setuppublic (static)Sets up the PHP environment. Adds error/exception handling, output
show404public (static)Displays a 404 page.
shutdownpublic (static)Triggers the shutdown of Kohana by closing the output buffer, runs the system.display event.
userAgentpublic (static)Retrieves current user agent information:

protected _obEndClean

boolean Kohana::_obEndClean ( [ callback $callback ] );

Ends the current output buffer with callback in mind
PHP doesn't pass the output to the callback defined in ob_start() since 5.4

public backtrace

string Kohana::backtrace ( array $trace );

Displays nice backtrace information.

public cache

mixed Kohana::cache ( string $name );

Load data from a simple cache file. This should only be used internally,
and is NOT a replacement for the Cache library.

public cacheSave

boolean Kohana::cacheSave ( string $name , mixed $data );

Save data to a simple cache file. This should only be used internally, and
is NOT a replacement for the Cache library.

public closeBuffers

void Kohana::closeBuffers ( [ boolean $flush ] );

Closes all open output buffers, either by flushing or cleaning, and stores the Kohana
output buffer for display during shutdown.

public config

mixed Kohana::config ( string $key [, boolean $slash [, boolean $required ]] );

Get a config item or group.

public configClear

void Kohana::configClear ( string $group );

Clears a config group from the cached configuration.

public configLoad

array Kohana::configLoad ( string $name [, boolean $required ] );

Load a config file.

public configSet

boolean Kohana::configSet ( string $key , string $value );

Sets a configuration item, if allowed.

public debug

string Kohana::debug ( );

Quick debugging of any variable. Any number of parameters can be set.

public disableCache

void Kohana::disableCache ( );

Disable the find-files and configuration caches
This may be required if the caching is causing problems

public errorHandler

void Kohana::errorHandler ( int $errno , string $errmsg , string $file , int $line );

Converts PHP errors into ErrorExceptions

public exceptionHandler

void Kohana::exceptionHandler ( object $exception );

Exception handler.

public findFile

FALSE|string|array Kohana::findFile ( string $directory , string $filename [, boolean $required [, string $ext ]] );

Find a resource file in a given directory. Files will be located according
to the order of the include paths. Configuration and i18n files will be
returned in reverse order.

public includePaths

array Kohana::includePaths ( [ boolean &$process ] );

Get all include paths. APPPATH is the first path, followed by module
paths in the order they are configured.

public instance

object Kohana::instance ( );

Loads the controller and initializes it. Runs the pre_controller,
post_controller_constructor, and post_controller events. Triggers
a system.404 event when the route cannot be mapped to a controller.

public internalCacheSave

boolean Kohana::internalCacheSave ( );

Saves the internal caches: configuration, include paths, etc.

public keyString

void|string Kohana::keyString ( array $array , string $keys );

Returns the value of a key, defined by a 'dot-noted' string, from an array.

public keyStringSet

void|mixed Kohana::keyStringSet ( array &$array , string $keys [, mixed $fill ] );

Sets values in an array by using a 'dot-noted' string.

public lang

string Kohana::lang ( string $key , array $args );

Fetch an i18n language item.

public listFiles

array Kohana::listFiles ( string $directory [, boolean $recursive [, string $path ]] );

Lists all files and directories in a resource path.

public log

void Kohana::log ( mixed $type , mixed $message );

Deprecated.

This function has been removed, and it's signature has
been left for compatibilty only.

public logException

int Kohana::logException ( (\Exception|\Throwable) $exception );

Log exceptions in the database

public outputBuffer

string Kohana::outputBuffer ( string $output );

Kohana output handler. Called during ob_clean, ob_flush, and their variants.

public render

void Kohana::render ( string $output );

Inserts global Kohana variables into the generated output and prints it.

public setup

void Kohana::setup ( );

Sets up the PHP environment. Adds error/exception handling, output
buffering, and adds an auto-loading method for loading classes.

For security, this function also destroys the $_REQUEST global variable.
Using the proper global (GET, POST, COOKIE, etc) is inherently more secure.

public show404

void Kohana::show404 ( [ string $page ] );

Displays a 404 page.

public shutdown

void Kohana::shutdown ( );

Triggers the shutdown of Kohana by closing the output buffer, runs the system.display event.

public userAgent

boolean|array|string Kohana::userAgent ( [ string $key [, string $compare ]] );

Retrieves current user agent information:
keys:  browser, version, platform, mobile, robot, referrer, languages, charsets
tests: is_browser, is_mobile, is_robot, accept_lang, accept_charset