Adding file headers to config files in test app.

Updating doc blocks.
Updating formatting.
This commit is contained in:
mark_story 2009-11-15 18:09:04 -05:00
parent 7a4793a20c
commit 28d3488cb2
3 changed files with 64 additions and 17 deletions

View file

@ -130,12 +130,14 @@ class Configure extends Object {
/** /**
* Used to read information stored in the Configure instance. * Used to read information stored in the Configure instance.
* *
* Usage * Usage:
* {{{
* Configure::read('Name'); will return all values for Name * Configure::read('Name'); will return all values for Name
* Configure::read('Name.key'); will return only the value of Configure::Name[key] * Configure::read('Name.key'); will return only the value of Configure::Name[key]
* }}}
* *
* @link http://book.cakephp.org/view/413/read * @link http://book.cakephp.org/view/413/read
* @param string $var Variable to obtain * @param string $var Variable to obtain. Use '.' to access array elements.
* @return string value of Configure::$var * @return string value of Configure::$var
* @access public * @access public
*/ */
@ -165,10 +167,12 @@ class Configure extends Object {
* Used to delete a variable from the Configure instance. * Used to delete a variable from the Configure instance.
* *
* Usage: * Usage:
* {{{
* Configure::delete('Name'); will delete the entire Configure::Name * Configure::delete('Name'); will delete the entire Configure::Name
* Configure::delete('Name.key'); will delete only the Configure::Name[key] * Configure::delete('Name.key'); will delete only the Configure::Name[key]
* }}}
* *
* @link http://book.cakephp.org/view/414/delete * @link http://book.cakephp.org/view/414/delete
* @param string $var the var to be deleted * @param string $var the var to be deleted
* @return void * @return void
* @access public * @access public
@ -188,27 +192,28 @@ class Configure extends Object {
/** /**
* Loads a file from app/config/configure_file.php. * Loads a file from app/config/configure_file.php.
* Config file variables should be formated like: * Config file variables should be formated like:
* $config['name'] = 'value'; * `$config['name'] = 'value';`
* These will be used to create dynamic Configure vars. * These will be used to create dynamic Configure vars. load() is also used to
* load stored config files created with Configure::store()
* *
* Usage Configure::load('configure_file'); * - To load config files from app/config use `Configure::load('configure_file');`.
* - To load config files from a plugin `Configure::load('plugin.configure_file');`.
* *
* @link http://book.cakephp.org/view/415/load * @link http://book.cakephp.org/view/415/load
* @param string $fileName name of file to load, extension must be .php and only the name * @param string $fileName name of file to load, extension must be .php and only the name
* should be used, not the extenstion * should be used, not the extenstion
* @return mixed false if file not found, void if load successful * @return mixed false if file not found, void if load successful
* @access public * @access public
*/ */
function load($fileName) { function load($fileName) {
$found = false; $found = $pluginPath = false;
$pluginPath = false; if (strpos($fileName, '.') !== false) {
if(strpos($fileName, '.') !== false) {
$plugin = explode('.', $fileName, 2); $plugin = explode('.', $fileName, 2);
$pluginPath = App::pluginPath($plugin[0]); $pluginPath = App::pluginPath($plugin[0]);
} }
if ($pluginPath && file_exists($pluginPath . 'config' . DS . $plugin[1] . '.php')) { if ($pluginPath && file_exists($pluginPath . 'config' . DS . $plugin[1] . '.php')) {
include($pluginPath . 'config' . DS . $plugin[1] . '.php'); include($pluginPath . 'config' . DS . $plugin[1] . '.php');
$found = true; $found = true;
} elseif (file_exists(CONFIGS . $fileName . '.php')) { } elseif (file_exists(CONFIGS . $fileName . '.php')) {
include(CONFIGS . $fileName . '.php'); include(CONFIGS . $fileName . '.php');
@ -241,9 +246,9 @@ class Configure extends Object {
/** /**
* Used to determine the current version of CakePHP. * Used to determine the current version of CakePHP.
* *
* Usage Configure::version(); * Usage `Configure::version();`
* *
* @link http://book.cakephp.org/view/416/version * @link http://book.cakephp.org/view/416/version
* @return string Current version of CakePHP * @return string Current version of CakePHP
* @access public * @access public
*/ */
@ -260,9 +265,11 @@ class Configure extends Object {
/** /**
* Used to write a config file to disk. * Used to write a config file to disk.
* *
* {{{
* Configure::store('Model', 'class.paths', array('Users' => array( * Configure::store('Model', 'class.paths', array('Users' => array(
* 'path' => 'users', 'plugin' => true * 'path' => 'users', 'plugin' => true
* ))); * )));
* }}}
* *
* @param string $type Type of config file to write, ex: Models, Controllers, Helpers, Components * @param string $type Type of config file to write, ex: Models, Controllers, Helpers, Components
* @param string $name file name. * @param string $name file name.
@ -1231,8 +1238,8 @@ class App extends Object {
/** /**
* Returns an array of filenames of PHP files in the given directory. * Returns an array of filenames of PHP files in the given directory.
* *
* @param string $path Path to scan for files * @param string $path Path to scan for files
* @param string $suffix if false, return only directories. if string, match and return files * @param string $suffix if false, return only directories. if string, match and return files
* @return array List of directories or files in directory * @return array List of directories or files in directory
*/ */
function __list($path, $suffix = false, $extension = false) { function __list($path, $suffix = false, $extension = false) {

View file

@ -1,3 +1,23 @@
<?php <?php
/**
* Test Suite TestPlugin config file.
*
* Long description for file
*
* PHP versions 4 and 5
*
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The Open Group Test Suite License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake
* @subpackage cake.tests.test_app
* @since CakePHP(tm) v 1.3
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/
$config['plugin_load'] = '/test_app/plugins/test_plugin/config/load.php'; $config['plugin_load'] = '/test_app/plugins/test_plugin/config/load.php';
?> ?>

View file

@ -1,3 +1,23 @@
<?php <?php
/**
* Test Suite TestPlugin config file.
*
* Long description for file
*
* PHP versions 4 and 5
*
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The Open Group Test Suite License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake
* @subpackage cake.tests.test_app
* @since CakePHP(tm) v 1.3
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/
$config['plugin_more_load'] = '/test_app/plugins/test_plugin/config/more.load.php'; $config['plugin_more_load'] = '/test_app/plugins/test_plugin/config/more.load.php';
?> ?>