mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 00:48:25 +00:00
Updating docs for Configure classes.
This commit is contained in:
parent
c35d52eba0
commit
f534ea0f08
2 changed files with 29 additions and 10 deletions
|
@ -23,14 +23,29 @@
|
|||
* regards to boolean and null values.
|
||||
*
|
||||
* In addition to the native parse_ini_file features, IniReader also allows you
|
||||
* to create nested array structures through usage of . delimited names. This allows
|
||||
* to create nested array structures through usage of `.` delimited names. This allows
|
||||
* you to create nested arrays structures in an ini config file. For example:
|
||||
*
|
||||
* `db.password = secret` would turn into `array('db' => array('password' => 'secret'))`
|
||||
*
|
||||
* You can nest properties as deeply as needed using .'s. IniReader also manipulates
|
||||
* how the special ini values of 'yes', 'no', 'on', 'off', 'null' are handled.
|
||||
* These values will be converted to their boolean equivalents.
|
||||
* You can nest properties as deeply as needed using `.`'s. In addition to using `.` you
|
||||
* can use standard ini section notation to create nested structures:
|
||||
*
|
||||
* {{{
|
||||
* [section]
|
||||
* key = value
|
||||
* }}}
|
||||
*
|
||||
* Once loaded into Configure, the above would be accessed using:
|
||||
*
|
||||
* `Configure::read('section.key');
|
||||
*
|
||||
* You can combine `.` separated values with sections to create more deeply
|
||||
* nested structures.
|
||||
*
|
||||
* IniReader also manipulates how the special ini values of
|
||||
* 'yes', 'no', 'on', 'off', 'null' are handled. These values will be
|
||||
* converted to their boolean equivalents.
|
||||
*
|
||||
* @package cake.config
|
||||
* @see http://php.net/parse_ini_file
|
||||
|
@ -56,7 +71,8 @@ class IniReader implements ConfigReaderInterface {
|
|||
* ini files that are on the filesystem.
|
||||
*
|
||||
* @param string $path Path to load ini config files from.
|
||||
* @param string $section Only get one section.
|
||||
* @param string $section Only get one section, leave null to parse and fetch
|
||||
* all sections in the ini file.
|
||||
*/
|
||||
public function __construct($path, $section = null) {
|
||||
$this->_path = $path;
|
||||
|
@ -66,7 +82,8 @@ class IniReader implements ConfigReaderInterface {
|
|||
/**
|
||||
* Read an ini file and return the results as an array.
|
||||
*
|
||||
* @param string $file Name of the file to read.
|
||||
* @param string $file Name of the file to read. The chosen file
|
||||
* must be on the reader's path.
|
||||
* @return array
|
||||
*/
|
||||
public function read($file) {
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
* PHP Reader allows Configure to load configuration values from
|
||||
* files containing simple PHP arrays.
|
||||
*
|
||||
* Files compatible with PhpReader should define a `$config` variable, that
|
||||
* contains all of the configuration data contained in the file.
|
||||
*
|
||||
* @package cake.libs.config
|
||||
*/
|
||||
class PhpReader implements ConfigReaderInterface {
|
||||
|
@ -46,10 +49,9 @@ class PhpReader implements ConfigReaderInterface {
|
|||
/**
|
||||
* Read a config file and return its contents.
|
||||
*
|
||||
* Keys with `.` will be treated as values in plugins. Instead of reading from
|
||||
* Files with `.` in the name will be treated as values in plugins. Instead of reading from
|
||||
* the initialized path, plugin keys will be located using App::pluginPath().
|
||||
*
|
||||
*
|
||||
* @param string $key The identifier to read from. If the key has a . it will be treated
|
||||
* as a plugin prefix.
|
||||
* @return array Parsed configuration values.
|
||||
|
|
Loading…
Add table
Reference in a new issue