Go to the source code of this file.
Namespaces | |
| namespace | cake |
Enumerations | |
| enum | DAY |
| enum | HOUR |
| enum | MINUTE |
| enum | MONTH |
| enum | SECOND |
| enum | WEEK |
| enum | YEAR |
Functions | |
| __ ($singular, $return=false) | |
| __c ($msg, $category, $return=false) | |
| __d ($domain, $msg, $return=false) | |
| __dc ($domain, $msg, $category, $return=false) | |
| __dcn ($domain, $singular, $plural, $count, $category, $return=false) | |
| __dn ($domain, $singular, $plural, $count, $return=false) | |
| __n ($singular, $plural, $count, $return=false) | |
| a () | |
| aa () | |
| am () | |
| cache ($path, $data=null, $expires= '+1 day', $target= 'cache') | |
| clearCache ($params=null, $type= 'views', $ext= '.php') | |
| config () | |
| convertSlash ($string) | |
| debug ($var=false, $showHtml=false, $showFrom=true) | |
| e ($text) | |
| env ($key) | |
| fileExistsInPath ($file) | |
| ife ($condition, $val1=null, $val2=null) | |
| low ($str) | |
| params ($p) | |
| pr ($var) | |
| r ($search, $replace, $subject) | |
| stripslashes_deep ($values) | |
| up ($str) | |
| uses () | |
Variables | |
| $a2 = array_values($a2) | |
| $argc = func_num_args() | |
| $bad = array("\n", "\r", "\t") | |
| $c1 = count($a1) | |
| $c2 = count($a2) | |
| $good = ' ' | |
| $out = array() | |
| $res = @fopen($fileName, 'w+b') | |
| return | $write |
| return | false |
| enum DAY |
Definition at line 33 of file basics.php.
| enum HOUR |
Definition at line 32 of file basics.php.
| enum MINUTE |
Definition at line 31 of file basics.php.
| enum MONTH |
Definition at line 35 of file basics.php.
| enum SECOND |
Basic defines for timing functions.
Definition at line 30 of file basics.php.
| enum WEEK |
Definition at line 34 of file basics.php.
| enum YEAR |
Definition at line 36 of file basics.php.
| __ | ( | $ | singular, | |
| $ | return = false | |||
| ) |
Returns a translated string if one is found; Otherwise, the submitted message.
| string | $singular Text to translate | |
| boolean | $return Set to true to return translated string, or false to echo |
Definition at line 594 of file basics.php.
References App::import(), and I18n::translate().
Referenced by FileEngine::__active(), Overloadable2::__call(), Overloadable::__call(), Controller::__construct(), AclBase::__construct(), AclComponent::__construct(), SchemaShell::__create(), ExtractTask::__extract(), ExtractTask::__extractTokens(), FormHelper::__generateOptions(), __initSession(), TestTask::__interactive(), PluginTask::__interactive(), ModelTask::__interactive(), ControllerTask::__interactive(), Configure::__loadBootstrap(), ViewTask::__loadController(), ApiShell::__parseClass(), SchemaShell::__run(), Scaffold::__scaffoldDelete(), Scaffold::__scaffoldSave(), Scaffold::__scaffoldView(), AuthComponent::__setDefaults(), SchemaShell::__update(), TranslateBehavior::afterFind(), BakeShell::all(), DbAcl::allow(), TestTask::bake(), ProjectTask::bake(), PluginTask::bake(), ControllerTask::bakeActions(), TranslateBehavior::beforeFind(), TranslateBehavior::bindTranslation(), Helper::call__(), DbAcl::check(), AclShell::check(), AclShell::checkNodeType(), Debugger::checkSessionKey(), Folder::chmod(), Security::cipher(), Validation::comparison(), DboOracle::constraint(), ContainableBehavior::containments(), Folder::copy(), Folder::create(), AclShell::create(), Shell::createFile(), Validation::custom(), HttpSocket::decodeBody(), HttpSocket::decodeChunkedBody(), Folder::delete(), AclShell::deny(), ModelTask::doAssociations(), DboOracle::dropSchema(), DboMysqlBase::dropSchema(), SchemaShell::dump(), FormHelper::end(), FormHelper::error(), ErrorHandler::error404(), ProjectTask::execute(), PluginTask::execute(), DboPostgres::fields(), DboMssql::fields(), DboAdodb::fields(), TextHelper::flay(), SchemaShell::generate(), Model::getColumnTypes(), ViewTask::getContent(), AuthComponent::getModel(), ModelTask::getName(), ControllerTask::getName(), AclShell::grant(), ExtractTask::help(), I18nShell::help(), AclShell::help(), AclShell::inherit(), ClassRegistry::init(), FormHelper::inputs(), Model::invalidFields(), AuthComponent::isAuthorized(), Controller::isAuthorized(), Model::joinModel(), FormHelper::label(), ModelTask::listAll(), ControllerTask::listAll(), Configure::load(), ConnectionManager::loadDataSource(), BakeShell::loadTasks(), SecurityComponent::loginCredentials(), I18nShell::main(), BakeShell::main(), ApiShell::main(), AclShell::main(), ErrorHandler::missingAction(), ErrorHandler::missingComponentClass(), ErrorHandler::missingComponentFile(), ErrorHandler::missingConnection(), ErrorHandler::missingController(), ErrorHandler::missingDatabase(), ErrorHandler::missingHelperClass(), ErrorHandler::missingHelperFile(), ErrorHandler::missingLayout(), ErrorHandler::missingModel(), ErrorHandler::missingTable(), ErrorHandler::missingView(), DboPostgres::name(), TimeHelper::niceShort(), Controller::paginate(), ErrorHandler::privateAction(), DboSource::queryAssociation(), DboOracle::queryAssociation(), FormHelper::radio(), CakeSocket::read(), CacheEngine::read(), View::render(), View::renderLayout(), DboPostgres::resultSet(), DboMssql::resultSet(), DboAdodb::resultSet(), SchemaShell::run(), EmailComponent::send(), TranslateBehavior::setup(), PaginatorHelper::sort(), AuthComponent::startup(), I18nShell::startup(), AclShell::startup(), FormHelper::submit(), TimeHelper::timeAgoInWords(), NumberHelper::toReadableSize(), SchemaShell::view(), TimeHelper::wasWithinLast(), SessionHelper::write(), and CacheEngine::write().
| __c | ( | $ | msg, | |
| $ | category, | |||
| $ | return = false | |||
| ) |
The category argument allows a specific category of the locale settings to be used for fetching a message. Valid categories are: LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES and LC_ALL.
Note that the category must be specified with a numeric value, instead of the constant name. The values are: LC_CTYPE 0 LC_NUMERIC 1 LC_TIME 2 LC_COLLATE 3 LC_MONETARY 4 LC_MESSAGES 5 LC_ALL 6
| string | $msg String to translate | |
| integer | $category Category | |
| string | $return true to return, false to echo |
Definition at line 774 of file basics.php.
References App::import(), and I18n::translate().
Referenced by ExtractTask::__extractTokens().
| __d | ( | $ | domain, | |
| $ | msg, | |||
| $ | return = false | |||
| ) |
Allows you to override the current domain for a single message lookup.
| string | $domain Domain | |
| string | $msg String to translate | |
| string | $return true to return, false to echo |
Definition at line 640 of file basics.php.
References App::import(), and I18n::translate().
| __dc | ( | $ | domain, | |
| $ | msg, | |||
| $ | category, | |||
| $ | return = false | |||
| ) |
Allows you to override the current domain for a single message lookup. It also allows you to specify a category.
The category argument allows a specific category of the locale settings to be used for fetching a message. Valid categories are: LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES and LC_ALL.
Note that the category must be specified with a numeric value, instead of the constant name. The values are: LC_CTYPE 0 LC_NUMERIC 1 LC_TIME 2 LC_COLLATE 3 LC_MONETARY 4 LC_MESSAGES 5 LC_ALL 6
| string | $domain Domain | |
| string | $msg Message to translate | |
| integer | $category Category | |
| boolean | $return true to return, false to echo |
Definition at line 702 of file basics.php.
References App::import(), and I18n::translate().
Referenced by ExtractTask::__extractTokens().
| __dcn | ( | $ | domain, | |
| $ | singular, | |||
| $ | plural, | |||
| $ | count, | |||
| $ | category, | |||
| $ | return = false | |||
| ) |
Allows you to override the current domain for a single plural message lookup. It also allows you to specify a category. Returns correct plural form of message identified by $singular and $plural for count $count from domain $domain.
The category argument allows a specific category of the locale settings to be used for fetching a message. Valid categories are: LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES and LC_ALL.
Note that the category must be specified with a numeric value, instead of the constant name. The values are: LC_ALL 0 LC_COLLATE 1 LC_CTYPE 2 LC_MONETARY 3 LC_NUMERIC 4 LC_TIME 5 LC_MESSAGES 6
| string | $domain Domain | |
| string | $singular Singular string to translate | |
| string | $plural Plural | |
| integer | $count Count | |
| integer | $category Category | |
| boolean | $return true to return, false to echo |
Definition at line 742 of file basics.php.
References App::import(), and I18n::translate().
Referenced by ExtractTask::__extractTokens().
| __dn | ( | $ | domain, | |
| $ | singular, | |||
| $ | plural, | |||
| $ | count, | |||
| $ | return = false | |||
| ) |
Allows you to override the current domain for a single plural message lookup. Returns correct plural form of message identified by $singular and $plural for count $count from domain $domain.
| string | $domain Domain | |
| string | $singular Singular string to translate | |
| string | $plural Plural | |
| integer | $count Count | |
| boolean | $return true to return, false to echo |
Definition at line 666 of file basics.php.
References App::import(), and I18n::translate().
Referenced by ExtractTask::__extractTokens().
| __n | ( | $ | singular, | |
| $ | plural, | |||
| $ | count, | |||
| $ | return = false | |||
| ) |
Returns correct plural form of message identified by $singular and $plural for count $count. Some languages have more than one form for plural messages dependent on the count.
| string | $singular Singular text to translate | |
| string | $plural Plural text | |
| integer | $count Count | |
| boolean | $return true to return, false to echo |
Definition at line 618 of file basics.php.
References App::import(), and I18n::translate().
Referenced by ExtractTask::__extractTokens(), TimeHelper::timeAgoInWords(), and NumberHelper::toReadableSize().
| a | ( | ) |
Returns an array of all the given parameters.
Example: a('a', 'b')
Would return: array('a', 'b')
Definition at line 227 of file basics.php.
Referenced by TestSuiteShell::__canRun(), EmailComponent::__createHeader(), __initPluralRules(), __initSingularRules(), DbConfigTask::__interactive(), Router::__parseExtension(), EmailComponent::__strip(), BakeShell::all(), XmlNode::append(), ControllerTask::bakeActions(), ProjectTask::cakeAdmin(), Debugger::checkSessionKey(), String::cleanInsert(), ContainableBehavior::containments(), Folder::create(), AclShell::create(), Validation::custom(), ModelTask::doAssociations(), Validation::email(), Set::extract(), TextHelper::flay(), Model::getColumnTypes(), ClassRegistry::init(), AuthComponent::isAuthorized(), DboMssql::lastError(), I18nShell::main(), ConsoleShell::main(), BakeShell::main(), ApiShell::main(), Xml::parse(), Router::parse(), ShellDispatcher::parseParams(), SchemaShell::run(), I18nShell::startup(), TextHelper::stripLinks(), TextHelper::truncate(), TreeBehavior::verify(), SessionHelper::write(), and Router::writeRoute().
| aa | ( | ) |
Constructs associative array from pairs of arguments.
Example: aa('a','b')
Would return: array('a'=>'b')
Definition at line 247 of file basics.php.
References $argc.
| am | ( | ) |
Merge a group of arrays
| array | First array | |
| array | Second array | |
| array | Third array | |
| array | Etc... |
Definition at line 342 of file basics.php.
Referenced by FormHelper::__generateOptions(), ContainableBehavior::contain(), FormHelper::dateTime(), and Model::deconstruct().
| cache | ( | $ | path, | |
| $ | data = null, |
|||
| $ | expires = '+1 day', |
|||
| $ | target = 'cache' | |||
| ) |
Reads/writes temporary data to cache files or session.
| string | $path File path within /tmp to save the file. | |
| mixed | $data The data to save to the temporary file. | |
| mixed | $expires A valid strtotime string when the data expires. | |
| string | $target The target of the cached data; either 'cache' or 'public'. |
Definition at line 466 of file basics.php.
References $filename, $path, low(), and Configure::read().
Referenced by ShellDispatcher::__bootstrap(), __close(), JavascriptHelper::__construct(), __initSession(), Cache::__loadEngine(), Configure::__writeConfig(), View::_render(), Object::_savePersistent(), View::element(), ApiShell::initialize(), MediaView::render(), View::render(), and JavascriptHelper::writeEvents().
| clearCache | ( | $ | params = null, |
|
| $ | type = 'views', |
|||
| $ | ext = '.php' | |||
| ) |
Used to delete files in the cache directories, or clear contents of cache directories
| mixed | $params As String name to be searched for deletion, if name is a directory all files in directory will be deleted. If array, names to be searched for deletion. If clearCache() without params, all files in app/tmp/cache/views will be deleted | |
| string | $type Directory in tmp/cache defaults to view directory | |
| string | $ext The file extension you are deleting |
Definition at line 518 of file basics.php.
Referenced by Model::_clearCache().
| config | ( | ) |
Loads configuration files. Receives a set of configuration files to load. Example: config('config1', 'config2');
Definition at line 59 of file basics.php.
Referenced by ShellDispatcher::__bootstrap(), CakeSocket::__construct(), ConnectionManager::__construct(), HttpSocket::__construct(), DbConfigTask::__interactive(), Configure::__loadBootstrap(), Shell::_loadDbConfig(), CakeSocket::address(), CakeSocket::addresses(), IniAcl::check(), Debugger::checkSessionKey(), HttpSocket::configUri(), CakeSocket::connect(), DboSybase::connect(), DboSqlite::connect(), DboPostgres::connect(), DboOracle::connect(), DboOdbc::connect(), DboMysqli::connect(), DboMysql::connect(), DboMssql::connect(), DboFirebird::connect(), DboDb2::connect(), DboAdodb::connect(), DboPostgres::describe(), ConnectionManager::enumConnectionObjects(), ProjectTask::execute(), DboSource::fullTableName(), Shell::getAdmin(), ConnectionManager::getDataSource(), CakeSocket::host(), DboPostgres::index(), DbConfigTask::initialize(), ModelTask::listAll(), ControllerTask::listAll(), DboPostgres::listSources(), DboMysqli::listSources(), DboMysql::listSources(), DataSource::listSources(), Configure::load(), ConsoleShell::main(), BakeShell::main(), CakeSchema::read(), HttpSocket::request(), ProjectTask::securitySalt(), DataSource::setConfig(), Model::setDataSource(), I18nShell::startup(), AclShell::startup(), HttpSocket::url(), and Configure::version().
| convertSlash | ( | $ | string | ) |
Convert forward slashes to underscores and removes first and last underscores in a string
| string | String to convert |
Definition at line 880 of file basics.php.
Prints out debug information about given variable.
Only runs if debug level is greater than zero.
| boolean | $var Variable to show debug information for. | |
| boolean | $showHtml If set to true, the method prints the debug data in a screen-friendly way. | |
| boolean | $showFrom If set to true, the method prints from where the function was called. http://book.cakephp.org/view/458/Basic-Debugging |
Definition at line 104 of file basics.php.
References Configure::read().
Referenced by ShellDispatcher::__bootstrap(), SchemaShell::__run(), Debugger::_output(), Xml::error(), ExtractTask::execute(), ExtractTask::help(), and CakeLog::write().
| e | ( | $ | text | ) |
Convenience method for echo().
| string | $text String to echo http://book.cakephp.org/view/700/e |
Definition at line 266 of file basics.php.
Referenced by EmailComponent::__createHeader(), and ConsoleShell::main().
| env | ( | $ | key | ) |
Gets an environment variable from available sources, and provides emulation for unsupported or inconsistent environment variables (i.e. DOCUMENT_ROOT on IIS, or SCRIPT_NAME in CGI mode). Also exposes some additional custom environment information.
| string | $key Environment variable name. |
Definition at line 363 of file basics.php.
References $filename.
Referenced by XcacheEngine::__auth(), L10n::__autoLanguage(), __construct(), __initSession(), Router::__matchRoute(), EmailComponent::__smtp(), AjaxHelper::afterRender(), Dispatcher::baseUrl(), Dispatcher::cached(), DboMssql::connect(), AjaxHelper::div(), AjaxHelper::divEnd(), SecurityComponent::loginCredentials(), Dispatcher::parseParams(), Controller::referer(), MediaView::render(), AuthComponent::startup(), Dispatcher::uri(), String::uuid(), and Helper::webroot().
| fileExistsInPath | ( | $ | file | ) |
Searches include path for files.
| string | $file File to look for |
Definition at line 860 of file basics.php.
References $path.
Referenced by CacheHelper::__parseFile(), and ConnectionManager::loadDataSource().
| ife | ( | $ | condition, | |
| $ | val1 = null, |
|||
| $ | val2 = null | |||
| ) |
Wraps ternary operations. If $condition is a non-empty value, $val1 is returned, otherwise $val2. Don't use for isset() conditions, or wrap your variable with @ operator: Example: ife(isset($variable), $variable, 'default');
| mixed | $condition Conditional expression | |
| mixed | $val1 Value to return in case condition matches | |
| mixed | $val2 Value to return if condition doesn't match |
Definition at line 939 of file basics.php.
Referenced by AclShell::__dataVars(), AclShell::__getParams(), AclShell::getPath(), AclShell::nodeExists(), JavascriptHelper::value(), and AclShell::view().
| low | ( | $ | str | ) |
Convenience method for strtolower().
| string | $str String to lowercase |
Definition at line 276 of file basics.php.
Referenced by __initSession(), DbConfigTask::__interactive(), __write(), cache(), ApiShell::help(), AclShell::help(), and Security::inactiveMins().
| params | ( | $ | p | ) |
Display parameters.
| mixed | $p Parameter as string or array |
Definition at line 323 of file basics.php.
Referenced by ShellDispatcher::__bootstrap(), Shell::__construct(), CakeErrorController::__construct(), Dispatcher::__extractParams(), Dispatcher::__getController(), ViewTask::__interactive(), Dispatcher::__loadController(), ShellDispatcher::__parseParams(), FormHelper::__secure(), CacheHelper::__writeFile(), ShellDispatcher::_initEnvironment(), FormHelper::_initInputField(), View::_loadHelpers(), Shell::_welcome(), AuthComponent::action(), BakeShell::all(), ProjectTask::bake(), FormHelper::create(), Dispatcher::dispatch(), FormHelper::end(), ProjectTask::execute(), PluginTask::execute(), ExtractTask::execute(), SessionHelper::flash(), SchemaShell::generate(), ShellDispatcher::help(), AuthComponent::initialize(), DbConfigTask::initialize(), AjaxHelper::isAjax(), AuthComponent::isAuthorized(), BakeShell::loadTasks(), ApiShell::main(), Controller::paginate(), ShellDispatcher::parseParams(), Controller::render(), SchemaShell::run(), FormHelper::secure(), SecurityComponent::startup(), AuthComponent::startup(), SchemaShell::startup(), I18nShell::startup(), and AclShell::startup().
| pr | ( | $ | var | ) |
Print_r convenience function, which prints out
tags around the output of given array. Similar to debug().
| array | $var Variable to print out | |
| boolean | $showFrom If set to true, the method prints from where the function was called http://book.cakephp.org/view/707/pr |
Definition at line 310 of file basics.php.
References Configure::read().
Referenced by Debugger::_output(), Debugger::dump(), and DboSource::showQuery().
| r | ( | $ | search, | |
| $ | replace, | |||
| $ | subject | |||
| ) |
Convenience method for str_replace().
| string | $search String to be replaced | |
| string | $replace String to insert | |
| string | $subject String to search |
Definition at line 298 of file basics.php.
Referenced by EmailComponent::__strip(), Validation::date(), and ConsoleShell::initialize().
| stripslashes_deep | ( | $ | values | ) |
Recursively strips slashes from all values in an array
| array | $values Array of values to strip slashes |
Definition at line 576 of file basics.php.
Referenced by Router::parse(), and Dispatcher::parseParams().
| up | ( | $ | str | ) |
Convenience method for strtoupper().
| string | $str String to uppercase |
Definition at line 286 of file basics.php.
Referenced by SchemaShell::__create(), SchemaShell::__run(), and SchemaShell::__update().
| uses | ( | ) |
Loads component/components from LIBS. Takes optional number of parameters.
Example: uses('flay', 'time');
| string | $name Filename without the .php part |
Definition at line 88 of file basics.php.
Referenced by DbAcl::__construct(), __initPluralRules(), __initSession(), __initSingularRules(), Controller::__mergeVars(), Shell::_loadModels(), Controller::constructClasses(), Shell::createFile(), TextHelper::flay(), Controller::loadModel(), Object::log(), Controller::paginate(), ProjectTask::securitySalt(), AclBehavior::setup(), and AuthComponent::startup().
| $a2 = array_values($a2) |
Definition at line 173 of file basics.php.
| $argc = func_num_args() |
| $bad = array("\n", "\r", "\t") |
| $c1 = count($a1) |
Definition at line 174 of file basics.php.
| $c2 = count($a2) |
Definition at line 175 of file basics.php.
| $good = ' ' |
Definition at line 850 of file basics.php.
| $out = array() |
Definition at line 904 of file basics.php.
Referenced by Set::__map(), HtmlHelper::__nestedListItem(), Debugger::__object(), DboPostgres::_alterIndexes(), DboMysqlBase::_alterIndexes(), AjaxHelper::_buildOptions(), Debugger::_output(), Helper::_parseAttributes(), View::_render(), AjaxHelper::afterRender(), DboPostgres::alterSchema(), DboOracle::alterSchema(), DboMysqlBase::alterSchema(), TestTask::bake(), PluginTask::bake(), ModelTask::bake(), DbConfigTask::bake(), ControllerTask::bake(), ControllerTask::bakeTest(), DboSqlite::buildColumn(), DboPostgres::buildColumn(), DboAdodb::buildColumn(), DboSqlite::buildIndex(), DboPostgres::buildIndex(), DboMssql::buildIndex(), CacheHelper::cache(), Security::cipher(), Set::combine(), DboSource::conditionKeysToString(), DboSource::conditions(), PaginatorHelper::counter(), HtmlHelper::css(), Set::diff(), DboOracle::dropSchema(), DboMysqlBase::dropSchema(), XmlHelper::elem(), FormHelper::end(), Shell::error(), Debugger::exportVar(), DboSource::fetchAll(), Folder::findRecursive(), PaginatorHelper::first(), ModelTask::fixture(), SessionHelper::flash(), NumberHelper::format(), Set::format(), JavascriptHelper::getCache(), HtmlHelper::getCrumbs(), JsHelper::if_(), FormHelper::input(), FormHelper::inputs(), RssHelper::items(), PaginatorHelper::last(), JavascriptHelper::link(), SecurityComponent::loginRequest(), AclShell::main(), HtmlHelper::meta(), PaginatorHelper::numbers(), JsHelper::object(), JavascriptHelper::object(), Router::parse(), FormHelper::radio(), View::render(), View::renderCache(), Set::reverse(), FormHelper::secure(), DboSource::showQuery(), AclShell::startup(), HtmlHelper::style(), FormHelper::submit(), HtmlHelper::tableCells(), HtmlHelper::tableHeaders(), XmlNode::toArray(), Flay::toHtml(), CakeSchema::write(), and JavascriptHelper::writeEvents().
| $res = @fopen($fileName, 'w+b') |
Definition at line 442 of file basics.php.
Referenced by DboFirebird::lastInsertId(), and DboOracle::queryAssociation().
| return $write |
Definition at line 450 of file basics.php.
Referenced by Configure::__writeConfig(), SchemaShell::dump(), and Configure::store().
Definition at line 453 of file basics.php.
Referenced by DboSource::fields(), FormHelper::inputs(), and Model::invalidFields().
1.4.7