basics.php File Reference

Go to the source code of this file.

Enumerations

enum  SECOND
enum  MINUTE
enum  HOUR
enum  DAY
enum  WEEK
enum  MONTH
enum  YEAR
enum  KATA_DEBUG
enum  KATA_ERROR
enum  KATA_PANIC

Functions

 kataAutoloader ($cname)
 debug ($var=false, $escape=false)
if(!function_exists('kataDebugOutput')) kataGetLineInfo ()
 kataGetValueInfo ($val)
 stripslashes_deep ($value)
 kataMakeTmpPath ($dirname)
 urldecode_deep ($value)
 writeLog ($what, $where=KATA_DEBUG)
 loadModel ($name)
 getModel ($name)
 getUtil ($name)
 env ($key)
 am ()
 kataUse ()
 vendor ($name)
 h ($text)
 is (&$arg, $default=null)


Enumeration Type Documentation

enum DAY

Definition at line 22 of file basics.php.

enum HOUR

Definition at line 21 of file basics.php.

enum KATA_DEBUG

our error-level constants

Definition at line 30 of file basics.php.

enum KATA_ERROR

Definition at line 31 of file basics.php.

enum KATA_PANIC

Definition at line 32 of file basics.php.

enum MINUTE

Definition at line 20 of file basics.php.

enum MONTH

Definition at line 24 of file basics.php.

enum SECOND

some often used constants that should be part of PHP

Definition at line 19 of file basics.php.

enum WEEK

Definition at line 23 of file basics.php.

enum YEAR

Definition at line 25 of file basics.php.


Function Documentation

am (  ) 

merge any number of arrays

Parameters:
array first array
array second array and so on
Returns:
array the merged array

Definition at line 354 of file basics.php.

Referenced by Helper::parseAttributes().

Here is the caller graph for this function:

debug ( var = false,
escape = false 
)

print out type and content of the given variable if DEBUG-define (in config/core.php) > 0

Parameters:
mixed $var Variable to debug
boolean $escape If set to true variables content will be html-escaped

Parameters:
mixed $var variable to dump
bool $isTable if variable is an array we use a table to display each line

Definition at line 113 of file basics.php.

env ( key  ) 

Gets an environment variable from available sources. Used as a backup if $_SERVER/$_ENV are disabled.

Parameters:
string $key Environment variable name.
Returns:
string Environment variable setting.

Definition at line 316 of file basics.php.

Referenced by IpUtility::getIp(), IpUtility::isUsingProxy(), and SessionComponent::startup().

Here is the caller graph for this function:

getModel ( name  ) 

return a handle to the given model. loads and initializes the model if needed.

Parameters:
string $value model name (without .php)
Returns:
object

Definition at line 287 of file basics.php.

References classRegistry::getObject(), and loadModel().

Here is the call graph for this function:

getUtil ( name  ) 

return class-handle of a utility-class

Parameters:
string $name name of the utility
Returns:
object class-handle

Definition at line 301 of file basics.php.

References classRegistry::getObject().

Referenced by Model::cachedQuery(), Model::describe(), SessionComponent::getIp(), and ClusterlockUtility::initialize().

Here is the call graph for this function:

Here is the caller graph for this function:

h ( text  ) 

Convenience method for htmlspecialchars. you should use this instead of echo to avoid xss-exploits

Parameters:
string $text
Returns:
string

Definition at line 396 of file basics.php.

Referenced by HtmlHelper::selectTag().

Here is the caller graph for this function:

is ( &$  arg,
default = null 
)

convenience method to check if given value is set. if so, value is return, otherwise the default

Parameters:
mixed $arg value to check
mixed $default value returned if $value is unset

Definition at line 408 of file basics.php.

Referenced by HttpUtility::getReturnHeaders(), and HtmlHelper::tokenUrl().

Here is the caller graph for this function:

kataAutoloader ( cname  ) 

include the baseclass of whatever a model or controller is derived from. this happens only once per request, so the penalty of using __autoload is small.

Parameters:
string $cname classname

Definition at line 42 of file basics.php.

References kataUse().

Here is the call graph for this function:

if (!function_exists('kataDebugOutput')) kataGetLineInfo (  ) 

internal function to send kata debug info to the browser. just define your own function if you want firebug or something like it return the shortend path of the file currently begin executed

Returns:
string

Definition at line 156 of file basics.php.

Referenced by CacheUtility::add(), CacheUtility::read(), and CacheUtility::write().

Here is the caller graph for this function:

kataGetValueInfo ( val  ) 

return stacktrace-like information about the given variable

Returns:
string

Definition at line 179 of file basics.php.

Referenced by CacheUtility::add(), CacheUtility::read(), and CacheUtility::write().

Here is the caller graph for this function:

kataMakeTmpPath ( dirname  ) 

create a directory in TMPPATH and check if its writable

Definition at line 220 of file basics.php.

Referenced by SessionComponent::__construct(), CacheUtility::initialize(), LockUtility::lock(), and writeLog().

Here is the caller graph for this function:

kataUse (  ) 

load files from the from LIB-directory

Parameters:
string filename without .php

Definition at line 371 of file basics.php.

References $args.

Referenced by Controller::_constructClasses(), View::constructHelpers(), dispatcher::dispatch(), Controller::initViewClass(), kataAutoloader(), and Model::setupDbo().

Here is the caller graph for this function:

loadModel ( name  ) 

include all neccessary classes and the given model

Parameters:
string model name without .php - if null it just loads all needed classes

Definition at line 274 of file basics.php.

Referenced by Controller::_constructClasses(), and getModel().

Here is the caller graph for this function:

stripslashes_deep ( value  ) 

Recursively strips slashes from all values in an array

Parameters:
mixed $value
Returns:
mixed

Definition at line 209 of file basics.php.

urldecode_deep ( value  ) 

Recursively urldecodes all values in an array

Parameters:
mixed $value
Returns:
mixed

Definition at line 236 of file basics.php.

vendor ( name  ) 

loads the given files in the VENDORS directory if not already loaded

Parameters:
string $name Filename without the .php part.

Definition at line 382 of file basics.php.

References $args.

writeLog ( what,
where = KATA_DEBUG 
)

write a string to the log in KATATMP/logs

Parameters:
string $what string to write to the log
int $where log-level to log (default: KATA_DEBUG)

Definition at line 248 of file basics.php.

References kataMakeTmpPath().

Referenced by Model::log(), and Controller::log().

Here is the call graph for this function:

Here is the caller graph for this function:


Generated on Mon Apr 27 16:29:07 2009 for kata by  doxygen 1.5.8