svn: /phpdoc/en/trunk/ install/ini.xml reference/info/functions/php-ini-scanned-files.xml

From: Date: Thu, 03 Dec 2015 16:19:52 +0000
Subject: svn: /phpdoc/en/trunk/ install/ini.xml reference/info/functions/php-ini-scanned-files.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-13870@lists.php.net to get a copy of this message
aharvey Thu, 03 Dec 2015 16:19:52 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=338206 Log: Document PHP_INI_SCAN_DIR, since we apparently never did. Changed paths: U phpdoc/en/trunk/install/ini.xml U phpdoc/en/trunk/reference/info/functions/php-ini-scanned-files.xml Modified: phpdoc/en/trunk/install/ini.xml =================================================================== --- phpdoc/en/trunk/install/ini.xml 2015-12-02 13:35:45 UTC (rev 338205) +++ phpdoc/en/trunk/install/ini.xml 2015-12-03 16:19:52 UTC (rev 338206) @@ -134,6 +134,59 @@ within .ini files. Example: <literal>open_basedir = ${open_basedir} ":/new/dir"</literal>. </para> + <sect2 xml:id="configuration.file.scan"> + <title>Scan directories</title> + + <para> + It is possible to configure PHP to scan for .ini files in a directory + after reading &php.ini;. This can be done at compile time by setting the + <option role="configure">--with-config-file-scan-dir</option> option. In + PHP 5.2.0 and later, the scan directory can then be overridden at run time + by setting the <varname>PHP_INI_SCAN_DIR</varname> environment variable. + </para> + + <para> + It is possible to scan multiple directories by separating them with the + platform-specific path separator (<literal>;</literal> on Windows, NetWare + and RISC OS; <literal>:</literal> on all other platforms; the value PHP is + using is available as the <constant>PATH_SEPARATOR</constant> constant). + If a blank directory is given in <varname>PHP_INI_SCAN_DIR</varname>, PHP + will also scan the directory given at compile time via + <option role="configure">--with-config-file-scan-dir</option>. + </para> + + <para> + Within each directory, PHP will scan all files ending in + <literal>.ini</literal> in alphabetical order. A list of the files that + were loaded, and in what order, is available by calling + <function>php_ini_scanned_files</function>, or by running PHP with the + <option>--ini</option> option. + </para> + + <informalexample> + <screen> +<![CDATA[ +Assuming PHP is configured with --with-config-file-scan-dir=/etc/php.d, +and that the path separator is :... + +$ php + PHP will load all files in /etc/php.d/*.ini as configuration files. + +$ PHP_INI_SCAN_DIR=/usr/local/etc/php.d php + PHP will load all files in /usr/local/etc/php.d/*.ini as + configuration files. + +$ PHP_INI_SCAN_DIR=:/usr/local/etc/php.d php + PHP will load all files in /etc/php.d/*.ini, then + /usr/local/etc/php.d/*.ini as configuration files. + +$ PHP_INI_SCAN_DIR=/usr/local/etc/php.d: php + PHP will load all files in /usr/local/etc/php.d/*.ini, then + /etc/php.d/*.ini as configuration files. +]]> + </screen> + </informalexample> + </sect2> <sect2 xml:id="configuration.file.changelog"> &reftitle.changelog; @@ -161,6 +214,13 @@ </entry> </row> <row> + <entry>5.2.0</entry> + <entry> + The <varname>PHP_INI_SCAN_DIR</varname> environment variable can be + set to override the scan directory set via the configure script. + </entry> + </row> + <row> <entry>5.1.0</entry> <entry> It is possible to refer to existing .ini variables from within .ini files. Modified: phpdoc/en/trunk/reference/info/functions/php-ini-scanned-files.xml =================================================================== --- phpdoc/en/trunk/reference/info/functions/php-ini-scanned-files.xml 2015-12-02 13:35:45 UTC (rev 338205) +++ phpdoc/en/trunk/reference/info/functions/php-ini-scanned-files.xml 2015-12-03 16:19:52 UTC (rev 338206) @@ -14,15 +14,13 @@ </methodsynopsis> <para> <function>php_ini_scanned_files</function> returns a comma-separated - list of configuration files parsed after &php.ini;. These files are - found in a directory defined by the - <option role="configure">--with-config-file-scan-dir</option> option - which is set during compilation. + list of configuration files parsed after &php.ini;. The directories + searched are set by a compile time option and, optionally, by an + environment variable at run time: more information can be found in the + <link linkend="configuration.file.scan">installation guide</link>. </para> <para> - The returned configuration files also include the path as declared in - the <option role="configure">--with-config-file-scan-dir</option> - option. + The returned configuration files include the full path. </para> </refsect1> @@ -30,12 +28,13 @@ &reftitle.returnvalues; <para> Returns a comma-separated string of .ini files on success. Each comma is - followed by a newline. If the directive <option - role="configure">--with-config-file-scan-dir</option> wasn't set, - &false; is returned. If it was set and the directory was empty, an - empty string is returned. If a file is unrecognizable, the file will - still make it into the returned string but a PHP error will also result. - This PHP error will be seen both at compile time and while using + followed by a newline. If the configure directive <option + role="configure">--with-config-file-scan-dir</option> wasn't set and the + <varname>PHP_INI_SCAN_DIR</varname> environment variable isn't set, &false; + is returned. If it was set and the directory was empty, an empty string is + returned. If a file is unrecognizable, the file will still make it into + the returned string but a PHP error will also result. This PHP error will + be seen both at compile time and while using <function>php_ini_scanned_files</function>. </para> </refsect1>

« previous php.doc.cvs (#13870) next »