Configure Class Reference

Inheritance diagram for Configure:

Object List of all members.

Public Member Functions

 __configVarNames ($name)
 __destruct ()
 __list ($path, $suffix=false, $extension=false)
 __loadBootstrap ($boot)
 __writeConfig ($content, $name, $write=true)
 buildPaths ($paths)
 corePaths ($type=null)
 delete ($var=null)
getInstance ($boot=true)
 listObjects ($type, $path=null, $cache=true)
 load ($fileName)
 read ($var= 'debug')
 store ($type, $name, $data=array())
 version ()
 write ($config, $value=null)

Public Attributes

 $__cache = false
 $__objects = array()
 $behaviorPaths = array()
 $componentPaths = array()
 $controllerPaths = array()
 $debug = null
 $helperPaths = array()
 $localePaths = array()
 $modelPaths = array()
 $pluginPaths = array()
 $shellPaths = array()
 $vendorPaths = array()
 $viewPaths = array()

Detailed Description

Definition at line 34 of file configure.php.


Constructor & Destructor Documentation

Configure::__destruct (  ) 

Caches the object map when the instance of the Configure class is destroyed

public

Definition at line 706 of file configure.php.

References Cache::write().


Member Function Documentation

Configure::__configVarNames ( name  ) 

Checks $name for dot notation to create dynamic Configure::$var as an array when needed.

Parameters:
mixed $name Name to split
Returns:
array Name separated in items through dot notation private

Definition at line 575 of file configure.php.

Configure::__list ( path,
suffix = false,
extension = false 
)

Returns an array of filenames of PHP files in the given directory.

Parameters:
string $path Path to scan for files
string $suffix if false, return only directories. if string, match and return files
Returns:
array List of directories or files in directory

Definition at line 221 of file configure.php.

References $path, and Folder().

Configure::__loadBootstrap ( boot  ) 

Loads app/config/bootstrap.php. If the alternative paths are set in this file they will be added to the paths vars.

Parameters:
boolean $boot Load application bootstrap (if true)
Returns:
void private

Definition at line 645 of file configure.php.

References $path, __(), buildPaths(), check(), config(), Cache::config(), read(), and write().

Configure::__writeConfig ( content,
name,
write = true 
)

Creates a cached version of a configuration file. Appends values passed from Configure::store() to the cached file

Parameters:
string $content Content to write on file
string $name Name to use for cache file
boolean $write true if content should be written, false otherwise
Returns:
void private

Definition at line 543 of file configure.php.

References $write, cache(), read(), and writable().

Referenced by store().

Configure::buildPaths ( paths  ) 

Build path references. Merges the supplied $paths with the base paths and the default core paths.

Parameters:
array $paths paths defines in config/bootstrap.php
Returns:
void public

Definition at line 592 of file configure.php.

References $path, and getInstance().

Referenced by ShellDispatcher::__bootstrap(), and __loadBootstrap().

Configure::corePaths ( type = null  ) 

Returns a key/value list of all paths where core libs are found. Passing $type only returns the values for a given value of $key.

Parameters:
string $type valid values are: 'model', 'behavior', 'controller', 'component', 'view', 'helper', 'datasource', 'libs', and 'cake'
Returns:
array numeric keyed array of core lib paths public

Definition at line 491 of file configure.php.

References $path, Cache::read(), and Cache::write().

Referenced by App::__destruct(), App::__paths(), App::__settings(), TestSuiteShell::initialize(), load(), and Debugger::trimPath().

Configure::delete ( var = null  ) 

Used to delete a variable from the Configure instance.

Usage: Configure::delete('Name'); will delete the entire Configure::Name Configure::delete('Name.key'); will delete only the Configure::Name[key]

string $var the var to be deleted void public

Definition at line 372 of file configure.php.

References getInstance().

Referenced by Multibyte::__find().

& Configure::getInstance ( boot = true  ) 

Returns a singleton instance of the Configure class.

Returns:
Configure instance public

Definition at line 133 of file configure.php.

Referenced by ShellDispatcher::__bootstrap(), buildPaths(), delete(), listObjects(), read(), version(), and write().

Configure::listObjects ( type,
path = null,
cache = true 
)

Returns an index of objects of the given type, with the physical path to each object.

Parameters:
string $type Type of object, i.e. 'model', 'controller', 'helper', or 'plugin'
mixed $path Optional
Returns:
Configure instance public

Definition at line 149 of file configure.php.

References $path, camelize(), getInstance(), and Cache::read().

Referenced by I18n::__bindTextDomain(), Router::__connectDefaultRoutes(), ShellDispatcher::help(), TestSuiteShell::initialize(), ConsoleShell::initialize(), ApiShell::main(), and CakeSchema::read().

Configure::load ( fileName  ) 

Loads a file from app/config/configure_file.php. Config file variables should be formated like: $config['name'] = 'value'; These will be used to create dynamic Configure vars.

Usage Configure::load('configure_file');

string $fileName name of file to load, extension must be .php and only the name should be used, not the extenstion mixed false if file not found, void if load successful public

Definition at line 396 of file configure.php.

References $config, $path, __(), config(), corePaths(), and write().

Referenced by Multibyte::__find().

Configure::read ( var = 'debug'  ) 

Used to read information stored in the Configure instance.

Usage Configure::read('Name'); will return all values for Name Configure::read('Name.key'); will return only the value of Configure::Name[key]

string $var Variable to obtain string value of Configure::$var public

Definition at line 326 of file configure.php.

References getInstance().

Referenced by I18n::__bindTextDomain(), ShellDispatcher::__buildPaths(), __close(), DboSource::__construct(), SessionHelper::__construct(), __construct(), Permission::__construct(), AclNode::__construct(), CakeSchema::__construct(), AclComponent::__construct(), ErrorHandler::__construct(), __destroy(), ConnectionManager::__destruct(), Multibyte::__find(), TestSuiteShell::__findFolderByCategory(), __gc(), __initSession(), __loadBootstrap(), App::__paths(), __read(), __regenerateId(), Scaffold::__scaffold(), L10n::__setLanguage(), App::__settings(), __write(), __writeConfig(), _checkValid(), Model::_clearCache(), TranslateBehavior::_getLocale(), ScaffoldView::_getViewFileName(), View::_getViewFileName(), Debugger::_output(), View::_paths(), View::_render(), Object::_savePersistent(), Dispatcher::baseUrl(), cache(), Dispatcher::cached(), HtmlHelper::charset(), Debugger::checkSessionKey(), debug(), View::element(), Xml::error(), ViewTask::execute(), ControllerTask::execute(), Shell::getAdmin(), ViewTask::getContent(), Router::getInstance(), Debugger::getInstance(), Debugger::handleError(), Security::hash(), XmlHelper::header(), HtmlHelper::image(), Security::inactiveMins(), EmailComponent::initialize(), CookieComponent::initialize(), AuthComponent::initialize(), Cache::isInitialized(), JavascriptHelper::link(), Multibyte::mimeEncode(), pr(), DboSource::queryAssociation(), DboOracle::queryAssociation(), CakeSchema::read(), View::render(), Controller::render(), View::renderCache(), View::renderLayout(), FormHelper::secure(), DboSource::showQuery(), AuthComponent::startup(), AclShell::startup(), I18n::translate(), String::uuid(), and valid().

Configure::store ( type,
name,
data = array() 
)

Used to write a config file to disk.

Configure::store('Model', 'class.paths', array('Users' => array( 'path' => 'users', 'plugin' => true )));

Parameters:
string $type Type of config file to write, ex: Models, Controllers, Helpers, Components
string $name file name.
array $data array of values to store.
Returns:
void public

Definition at line 457 of file configure.php.

References $write, and __writeConfig().

Configure::version (  ) 

Used to determine the current version of CakePHP.

Usage Configure::version();

string Current version of CakePHP public

Definition at line 435 of file configure.php.

References $config, config(), and getInstance().

Referenced by Shell::_welcome(), Debugger::getInstance(), and ShellDispatcher::help().

Configure::write ( config,
value = null 
)

Used to store a dynamic variable in the Configure instance.

Usage: {{{ Configure::write('One.key1', 'value of the Configure::One[key1]'); Configure::write(array('One.key1' => 'value of the Configure::One[key1]')); Configure::write('One', array( 'key1' => 'value of the Configure::One[key1]', 'key2' => 'value of the Configure::One[key2]' );

Configure::write(array( 'One.key1' => 'value of the Configure::One[key1]', 'One.key2' => 'value of the Configure::One[key2]' )); }}}

array $config Name of var to write mixed $value Value to set for var void public

Definition at line 270 of file configure.php.

References $config, and getInstance().

Referenced by ShellDispatcher::__bootstrap(), Dispatcher::__construct(), __initSession(), __loadBootstrap(), SchemaShell::__run(), L10n::__setLanguage(), ProjectTask::cakeAdmin(), Shell::getAdmin(), load(), and ProjectTask::securitySalt().


Member Data Documentation

Configure::$__cache = false

Definition at line 119 of file configure.php.

Configure::$__objects = array()

Definition at line 126 of file configure.php.

Configure::$behaviorPaths = array()

Definition at line 48 of file configure.php.

Configure::$componentPaths = array()

Definition at line 62 of file configure.php.

Configure::$controllerPaths = array()

Definition at line 55 of file configure.php.

Configure::$debug = null

Definition at line 112 of file configure.php.

Configure::$helperPaths = array()

Definition at line 76 of file configure.php.

Configure::$localePaths = array()

Definition at line 97 of file configure.php.

Configure::$modelPaths = array()

Definition at line 41 of file configure.php.

Configure::$pluginPaths = array()

Definition at line 83 of file configure.php.

Configure::$shellPaths = array()

Definition at line 104 of file configure.php.

Configure::$vendorPaths = array()

Definition at line 90 of file configure.php.

Configure::$viewPaths = array()

Definition at line 69 of file configure.php.


The documentation for this class was generated from the following file:
Generated on Sun Nov 22 00:30:55 2009 for CakePHP 1.2.x.x (v1.2.4.8284) by doxygen 1.4.7