->{$name[0]});
}
}
/**
* Will load a file from app/config/configure_file.php
* variables in the files should be formated like:
* $config['name'] = 'value';
* These will be used to create dynamic Configure vars.
*
* Usage Configure::load('configure_file');
*
* @param string $fileName name of file to load, extension must be .php and only the name should be used, not the extenstion
* @return Configure::write
* @access public
*/
function load($fileName) {
$_this =& Configure::getInstance();
if(!file_exists(CONFIGS . $fileName . '.php')) {
trigger_error("Configure::load() - $fileName.php not found", E_USER_WARNING);
return false;
}
include(CONFIGS . $fileName . '.php');
if(!isset($config)){
trigger_error("Configure::load() - no variable \$config found in $fileName.php", E_USER_WARNING);
return false;
}
return $_this->write($config);
}
/**
* Used to determine the current version of CakePHP
*
* Usage Configure::version();
*
* @return string Current version of CakePHP
* @access public
*/
function version() {
$_this =& Configure::getInstance();
if(!isset($_this->Cake['version'])){
require(CORE_PATH . 'cake' . DS . 'config' . DS . 'config.php');
$_this->write($config);
}
return $_this->Cake['version'];
}
/**
* Checks $name for dot notation to create dynamic Configure::$var as an array when needed.
*
* @param mixed $name
* @return array
* @access private
*/
function __configVarNames($name) {
if (is_string($name)) {
if (strpos($name, ".")) {
$name = explode(".", $name);
} else {
$name = array($name);
}
}
return $name;
}
/**
* Sets the var modelPaths
*
* @param array $modelPaths
* @access private
*/
function __buildModelPaths($modelPaths) {
$_this =& Configure::getInstance();
$_this->modelPaths[] = MODELS;
if (isset($modelPaths)) {
foreach($modelPaths as $value) {
$_this->modelPaths[] = $value;
}
}
}
/**
* Sets the var viewPaths
*
* @param array $viewPaths
* @access private
*/
function __buildViewPaths($viewPaths) {
$_this =& Configure::getInstance();
$_this->viewPaths[] = VIEWS;
$_this->viewPaths[] = VIEWS . 'errors' . DS;
if (isset($viewPaths)) {
foreach($viewPaths as $value) {
$_this->viewPaths[] = $value;
}
}
}
/**
* Sets the var controllerPaths
*
* @param array $controllerPaths
* @access private
*/
function __buildControllerPaths($controllerPaths) {
$_this =& Configure::getInstance();
$_this->controllerPaths[] = CONTROLLERS;
if (isset($controllerPaths)) {
foreach($controllerPaths as $value) {
$_this->controllerPaths[] = $value;
}
}
}
/**
* Sets the var helperPaths
*
* @param array $helperPaths
* @access private
*/
function __buildHelperPaths($helperPaths) {
$_this =& Configure::getInstance();
$_this->helperPaths[] = HELPERS;
if (isset($helperPaths)) {
foreach($helperPaths as $value) {
$_this->helperPaths[] = $value;
}
}
}
/**
* Sets the var componentPaths
*
* @param array $componentPaths
* @access private
*/
function __buildComponentPaths($componentPaths) {
$_this =& Configure::getInstance();
$_this->componentPaths[] = COMPONENTS;
if (isset($componentPaths)) {
foreach($componentPaths as $value) {
$_this->componentPaths[] = $value