cvs: phpdoc-ja /reference/filesystem/functions parse-ini-file.xml

From: Date: Mon, 29 Jun 2009 03:11:27 +0000
Subject: cvs: phpdoc-ja /reference/filesystem/functions parse-ini-file.xml
Groups: php.doc.ja 
Request: Send a blank email to doc-ja+get-2485@lists.php.net to get a copy of this message
takagi Mon Jun 29 03:11:27 2009 UTC Modified files: /phpdoc-ja/reference/filesystem/functions parse-ini-file.xml Log: sync with en. http://cvs.php.net/viewvc.cgi/phpdoc-ja/reference/filesystem/functions/parse-ini-file.xml?r1=1.20&r2=1.21&diff_format=u Index: phpdoc-ja/reference/filesystem/functions/parse-ini-file.xml diff -u phpdoc-ja/reference/filesystem/functions/parse-ini-file.xml:1.20 phpdoc-ja/reference/filesystem/functions/parse-ini-file.xml:1.21 --- phpdoc-ja/reference/filesystem/functions/parse-ini-file.xml:1.20 Sun May 24 06:08:30 2009 +++ phpdoc-ja/reference/filesystem/functions/parse-ini-file.xml Mon Jun 29 03:11:27 2009 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.20 $ --> -<!-- EN-Revision: 1.36 Maintainer: hirokawa Status: ready --> +<!-- $Revision: 1.21 $ --> +<!-- EN-Revision: 1.37 Maintainer: hirokawa Status: ready --> <!-- CREDITS: shimooka --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.parse-ini-file"> <refnamediv> @@ -227,6 +227,41 @@ </screen> </example> </para> + <para> + <example> + <title><function>parse_ini_file</function> による php.ini ファイルのパース</title> + <programlisting role="php"> +<![CDATA[ +<?php +// 以下の結果を比較するための簡単な関数 +function yesno($expression) +{ + return($expression ? 'Yes' : 'No'); +} + +// php.ini へのパスを the php_ini_loaded_file() 関数で取得します +// この関数は PHP 5.2.4 以降で使用可能です +$ini_path = php_ini_loaded_file(); + +// php.ini をパースします +$ini = parse_ini_file($ini_path); + +// 結果を表示して比較します。get_cfg_var() を使用すると、 +// ここでパースして読み込んだのと同じ結果が得られることに注意しましょう +echo '(parsed) magic_quotes_gpc = ' . yesno($ini['magic_quotes_gpc']) . PHP_EOL; +echo '(loaded) magic_quotes_gpc = ' . yesno(get_cfg_var('magic_quotes_gpc')) . PHP_EOL; +?> +]]> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ +(parsed) magic_quotes_gpc = Yes +(loaded) magic_quotes_gpc = Yes +]]> + </screen> + </example> + </para> </refsect1> <refsect1 role="notes">

« previous php.doc.ja (#2485) next »