cvs: peardoc /en/package/configuration config.xml /en/package/configuration/config avail-container.xml /en/package/configuration/config/config
registerconfigtype.xml
| From: | Adam Harvey | Date: | Fri, 22 Dec 2006 00:36:27 +0000 |
| Subject: | cvs: peardoc /en/package/configuration config.xml /en/package/configuration/config avail-container.xml /en/package/configuration/config/config registerconfigtype.xml |
||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-9129@lists.php.net to get a copy of this message | ||
aharvey Fri Dec 22 00:36:27 2006 UTC
Added files:
/peardoc/en/package/configuration/config/config
registerconfigtype.xml
Modified files:
/peardoc/en/package/configuration config.xml
/peardoc/en/package/configuration/config avail-container.xml
Log:
Added documentation for Config::registerConfigType() and updated Config container information with
the newest options.
http://cvs.php.net/viewvc.cgi/peardoc/en/package/configuration/config.xml?r1=1.5&r2=1.6&diff_format=u Index: peardoc/en/package/configuration/config.xml diff -u peardoc/en/package/configuration/config.xml:1.5 peardoc/en/package/configuration/config.xml:1.6 --- peardoc/en/package/configuration/config.xml:1.5 Sat Feb 18 16:47:32 2006 +++ peardoc/en/package/configuration/config.xml Fri Dec 22 00:36:26 2006 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <sect1 id="package.configuration.config"> @@ -16,6 +16,7 @@ &package.configuration.config.config.getroot; &package.configuration.config.config.isconfigtyperegistered; &package.configuration.config.config.parseconfig; +&package.configuration.config.config.registerconfigtype; &package.configuration.config.config.setroot; &package.configuration.config.config.writeconfig; http://cvs.php.net/viewvc.cgi/peardoc/en/package/configuration/config/avail-container.xml?r1=1.2&r2=1.3&diff_format=u Index: peardoc/en/package/configuration/config/avail-container.xml diff -u peardoc/en/package/configuration/config/avail-container.xml:1.2 peardoc/en/package/configuration/config/avail-container.xml:1.3 --- peardoc/en/package/configuration/config/avail-container.xml:1.2 Sun Nov 26 22:57:38 2006 +++ peardoc/en/package/configuration/config/avail-container.xml Fri Dec 22 00:36:26 2006 @@ -1,5 +1,5 @@ <?xml version='1.0' encoding='ISO-8859-1' ?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="package.configuration.config.avail-container"> <refnamediv> <refname>Available Containers</refname> @@ -15,7 +15,8 @@ <term><literal>Apache</literal></term> <listitem> <para> - Apache configuration files + Parses and saves Apache configuration files. No options are provided by + this container. </para> </listitem> </varlistentry> @@ -26,14 +27,74 @@ Generic configuration files. The equals, comment start and new line characters in the parser can be customised to match your prefered configuration format. + <table> + <title>Available Options</title> + <tgroup cols="4"> + <thead> + <row> + <entry>Option</entry> + <entry>Data Type</entry> + <entry>Default value</entry> + <entry>Description</entry> + </row> + </thead> + <tbody> + <row> + <entry> + <quote>comment</quote> + </entry> + <entry> + &type.string; + </entry> + <entry> + <quote>#</quote> + </entry> + <entry> + The character that signifies the start of a comment. + </entry> + </row> + <row> + <entry> + <quote>equals</quote> + </entry> + <entry> + &type.string; + </entry> + <entry> + <quote>:</quote> + </entry> + <entry> + The character that separates keys from values. + </entry> + </row> + <row> + <entry> + <quote>newline</quote> + </entry> + <entry> + &type.string; + </entry> + <entry> + <quote>\</quote> + </entry> + <entry> + The character that signifies that a value continues across multiple + lines. + </entry> + </row> + </tbody> + </tgroup> + </table> </para> + </listitem> </varlistentry> <varlistentry> <term><literal>IniCommented</literal></term> <listitem> <para> - Parse standard INI files and maintain comments. + Parses standard INI files, maintaining comments within the file. No + options are available for this container. </para> </listitem> </varlistentry> @@ -42,7 +103,8 @@ <listitem> <para> Parse standard INI files using PHP's in built - <function>parse_ini_file</function>. Does not read in comments. + <function>parse_ini_file</function>. Does not read in comments. No + options are available for this container. </para> </listitem> </varlistentry> @@ -50,8 +112,55 @@ <term><literal>PHPArray</literal></term> <listitem> <para> - Parse PHP Array structures. Can read from a PHP Source file or - from an in memory array. + Parses PHP Array structures. Can read from a PHP Source file or + from an in memory array. Due to technical limitations, this container + does not parse blank lines or comments when reading from a configuration + file, therefore any information contained within PHP comments will be + lost. + <table> + <title>Available Options</title> + <tgroup cols="4"> + <thead> + <row> + <entry>Option</entry> + <entry>Data Type</entry> + <entry>Default value</entry> + <entry>Description</entry> + </row> + </thead> + <tbody> + <row> + <entry> + <quote>name</quote> + </entry> + <entry> + &type.string; + </entry> + <entry> + <quote>conf</quote> + </entry> + <entry> + The name to use for the root configuration variable, both when + parsing and writing PHP source files. + </entry> + </row> + <row> + <entry> + <quote>useAttr</quote> + </entry> + <entry> + &type.bool; + </entry> + <entry> + &true; + </entry> + <entry> + Controls whether attributes are parsed and saved. + </entry> + </row> + </tbody> + </tgroup> + </table> </para> <warning> <para> @@ -66,8 +175,9 @@ <term><literal>PHPConstants</literal></term> <listitem> <para> - Parse a set of PHP <function>define</function> from a PHP source - file. + Parses a set of PHP <function>define</function> from a PHP source file. + Comments are maintained by this container, although blank lines will be + lost. There are no options for this container. </para> </listitem> </varlistentry> @@ -75,7 +185,156 @@ <term><literal>XML</literal></term> <listitem> <para> - Parse a XML file. + Parses a XML file using <link + linkend="package.xml.xml-parser">XML_Parser</link>. + <table> + <title>Available Options</title> + <tgroup cols="4"> + <thead> + <row> + <entry>Option</entry> + <entry>Data Type</entry> + <entry>Default value</entry> + <entry>Description</entry> + </row> + </thead> + <tbody> + <row> + <entry> + <quote>version</quote> + </entry> + <entry> + &type.string; + </entry> + <entry> + <quote>1.0</quote> + </entry> + <entry> + The XML version to use. + </entry> + </row> + <row> + <entry> + <quote>encoding</quote> + </entry> + <entry> + &type.string; + </entry> + <entry> + <quote>ISO-8859-1</quote> + </entry> + <entry> + The content encoding to use when parsing and storing data. + </entry> + </row> + <row> + <entry> + <quote>name</quote> + </entry> + <entry> + &type.string; + </entry> + <entry> + <quote>conf</quote> + </entry> + <entry> + As with PHPArray, this defines the name of the global configuration + root. + </entry> + </row> + <row> + <entry> + <quote>indent</quote> + </entry> + <entry> + &type.string; + </entry> + <entry> + <quote> </quote> + </entry> + <entry> + The character used for indentation when writing the XML document, + if any. By default, two spaces are used. + </entry> + </row> + <row> + <entry> + <quote>linebreak</quote> + </entry> + <entry> + &type.string; + </entry> + <entry> + <quote>\n</quote> + </entry> + <entry> + The line-breaking character(s) to use when writing the XML + document. + </entry> + </row> + <row> + <entry> + <quote>addDecl</quote> + </entry> + <entry> + &type.bool; + </entry> + <entry> + &true; + </entry> + <entry> + Controls whether the XML declaration is added to the start of the + XML document. + </entry> + </row> + <row> + <entry> + <quote>useAttr</quote> + </entry> + <entry> + &type.bool; + </entry> + <entry> + &true; + </entry> + <entry> + Controls whether attributes are parsed and saved. + </entry> + </row> + <row> + <entry> + <quote>isFile</quote> + </entry> + <entry> + &type.bool; + </entry> + <entry> + &true; + </entry> + <entry> + If &true;, the first argument to <function>parseConfig</function> + will be taken as the file name for the XML file to load. If + &false;, the argument will be taken as the XML data itself and + parsed accordingly. + </entry> + </row> + <row> + <entry> + <quote>useCData</quote> + </entry> + <entry> + &type.bool; + </entry> + <entry> + &false; + </entry> + <entry> + Controls whether data is enclosed in CDATA blocks. + </entry> + </row> + </tbody> + </tgroup> + </table> </para> </listitem> </varlistentry> http://cvs.php.net/viewvc.cgi/peardoc/en/package/configuration/config/config/registerconfigtype.xml?view=markup&rev=1.1 Index: peardoc/en/package/configuration/config/config/registerconfigtype.xml +++ peardoc/en/package/configuration/config/config/registerconfigtype.xml <!-- $Rev$ --> <refentry id="package.configuration.config.config.registerconfigtype"> <refnamediv> <refname><function>Config::registerConfigType</function></refname> <refpurpose>Registers a custom Config container</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'Config.php'; </funcsynopsisinfo> <funcprototype> <funcdef>bool <function>Config::registerConfigType</function></funcdef> <paramdef>string <parameter>$configType</parameter></paramdef> <paramdef>array <parameter><optional>$configInfo = false</optional></parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.configuration.config.config.registerconfigtype.desc"> &title.desc; <para> This method registers a new container type with the <classname>Config</classname> class. </para> </refsect1> <refsect1 id="package.configuration.config.config.registerconfigtype.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$configType</parameter> </term> <listitem> <para> The name of the configuration type. </para> </listitem> </varlistentry> <varlistentry> <term> &type.array; <parameter>$configInfo</parameter> </term> <listitem> <para> An array defining the file containing the container's class definition and the class name. The format for this array is as follows: <programlisting role="php"> <![CDATA[ $configInfo = array('path/to/Name.php', // The path to the source file for the class. 'Config_Container_Class_Name' // The name of the container class. ); ]]> </programlisting> </para> <para> If omitted, the default values are: <programlisting role="php"> <![CDATA[ $configInfo = array("Config/Container/$configType.php", "Config_Container_$configType" ); ]]> </programlisting> </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.configuration.config.config.registerconfigtype.return"> &title.returns; <para> <parameter>mixed</parameter> - &return.success-pearerror; </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->
http://cvs.php.net/viewvc.cgi/peardoc/en/package/configuration/config.xml?r1=1.5&r2=1.6&diff_format=u Index: peardoc/en/package/configuration/config.xml diff -u peardoc/en/package/configuration/config.xml:1.5 peardoc/en/package/configuration/config.xml:1.6 --- peardoc/en/package/configuration/config.xml:1.5 Sat Feb 18 16:47:32 2006 +++ peardoc/en/package/configuration/config.xml Fri Dec 22 00:36:26 2006 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <sect1 id="package.configuration.config"> @@ -16,6 +16,7 @@ &package.configuration.config.config.getroot; &package.configuration.config.config.isconfigtyperegistered; &package.configuration.config.config.parseconfig; +&package.configuration.config.config.registerconfigtype; &package.configuration.config.config.setroot; &package.configuration.config.config.writeconfig; http://cvs.php.net/viewvc.cgi/peardoc/en/package/configuration/config/avail-container.xml?r1=1.2&r2=1.3&diff_format=u Index: peardoc/en/package/configuration/config/avail-container.xml diff -u peardoc/en/package/configuration/config/avail-container.xml:1.2 peardoc/en/package/configuration/config/avail-container.xml:1.3 --- peardoc/en/package/configuration/config/avail-container.xml:1.2 Sun Nov 26 22:57:38 2006 +++ peardoc/en/package/configuration/config/avail-container.xml Fri Dec 22 00:36:26 2006 @@ -1,5 +1,5 @@ <?xml version='1.0' encoding='ISO-8859-1' ?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="package.configuration.config.avail-container"> <refnamediv> <refname>Available Containers</refname> @@ -15,7 +15,8 @@ <term><literal>Apache</literal></term> <listitem> <para> - Apache configuration files + Parses and saves Apache configuration files. No options are provided by + this container. </para> </listitem> </varlistentry> @@ -26,14 +27,74 @@ Generic configuration files. The equals, comment start and new line characters in the parser can be customised to match your prefered configuration format. + <table> + <title>Available Options</title> + <tgroup cols="4"> + <thead> + <row> + <entry>Option</entry> + <entry>Data Type</entry> + <entry>Default value</entry> + <entry>Description</entry> + </row> + </thead> + <tbody> + <row> + <entry> + <quote>comment</quote> + </entry> + <entry> + &type.string; + </entry> + <entry> + <quote>#</quote> + </entry> + <entry> + The character that signifies the start of a comment. + </entry> + </row> + <row> + <entry> + <quote>equals</quote> + </entry> + <entry> + &type.string; + </entry> + <entry> + <quote>:</quote> + </entry> + <entry> + The character that separates keys from values. + </entry> + </row> + <row> + <entry> + <quote>newline</quote> + </entry> + <entry> + &type.string; + </entry> + <entry> + <quote>\</quote> + </entry> + <entry> + The character that signifies that a value continues across multiple + lines. + </entry> + </row> + </tbody> + </tgroup> + </table> </para> + </listitem> </varlistentry> <varlistentry> <term><literal>IniCommented</literal></term> <listitem> <para> - Parse standard INI files and maintain comments. + Parses standard INI files, maintaining comments within the file. No + options are available for this container. </para> </listitem> </varlistentry> @@ -42,7 +103,8 @@ <listitem> <para> Parse standard INI files using PHP's in built - <function>parse_ini_file</function>. Does not read in comments. + <function>parse_ini_file</function>. Does not read in comments. No + options are available for this container. </para> </listitem> </varlistentry> @@ -50,8 +112,55 @@ <term><literal>PHPArray</literal></term> <listitem> <para> - Parse PHP Array structures. Can read from a PHP Source file or - from an in memory array. + Parses PHP Array structures. Can read from a PHP Source file or + from an in memory array. Due to technical limitations, this container + does not parse blank lines or comments when reading from a configuration + file, therefore any information contained within PHP comments will be + lost. + <table> + <title>Available Options</title> + <tgroup cols="4"> + <thead> + <row> + <entry>Option</entry> + <entry>Data Type</entry> + <entry>Default value</entry> + <entry>Description</entry> + </row> + </thead> + <tbody> + <row> + <entry> + <quote>name</quote> + </entry> + <entry> + &type.string; + </entry> + <entry> + <quote>conf</quote> + </entry> + <entry> + The name to use for the root configuration variable, both when + parsing and writing PHP source files. + </entry> + </row> + <row> + <entry> + <quote>useAttr</quote> + </entry> + <entry> + &type.bool; + </entry> + <entry> + &true; + </entry> + <entry> + Controls whether attributes are parsed and saved. + </entry> + </row> + </tbody> + </tgroup> + </table> </para> <warning> <para> @@ -66,8 +175,9 @@ <term><literal>PHPConstants</literal></term> <listitem> <para> - Parse a set of PHP <function>define</function> from a PHP source - file. + Parses a set of PHP <function>define</function> from a PHP source file. + Comments are maintained by this container, although blank lines will be + lost. There are no options for this container. </para> </listitem> </varlistentry> @@ -75,7 +185,156 @@ <term><literal>XML</literal></term> <listitem> <para> - Parse a XML file. + Parses a XML file using <link + linkend="package.xml.xml-parser">XML_Parser</link>. + <table> + <title>Available Options</title> + <tgroup cols="4"> + <thead> + <row> + <entry>Option</entry> + <entry>Data Type</entry> + <entry>Default value</entry> + <entry>Description</entry> + </row> + </thead> + <tbody> + <row> + <entry> + <quote>version</quote> + </entry> + <entry> + &type.string; + </entry> + <entry> + <quote>1.0</quote> + </entry> + <entry> + The XML version to use. + </entry> + </row> + <row> + <entry> + <quote>encoding</quote> + </entry> + <entry> + &type.string; + </entry> + <entry> + <quote>ISO-8859-1</quote> + </entry> + <entry> + The content encoding to use when parsing and storing data. + </entry> + </row> + <row> + <entry> + <quote>name</quote> + </entry> + <entry> + &type.string; + </entry> + <entry> + <quote>conf</quote> + </entry> + <entry> + As with PHPArray, this defines the name of the global configuration + root. + </entry> + </row> + <row> + <entry> + <quote>indent</quote> + </entry> + <entry> + &type.string; + </entry> + <entry> + <quote> </quote> + </entry> + <entry> + The character used for indentation when writing the XML document, + if any. By default, two spaces are used. + </entry> + </row> + <row> + <entry> + <quote>linebreak</quote> + </entry> + <entry> + &type.string; + </entry> + <entry> + <quote>\n</quote> + </entry> + <entry> + The line-breaking character(s) to use when writing the XML + document. + </entry> + </row> + <row> + <entry> + <quote>addDecl</quote> + </entry> + <entry> + &type.bool; + </entry> + <entry> + &true; + </entry> + <entry> + Controls whether the XML declaration is added to the start of the + XML document. + </entry> + </row> + <row> + <entry> + <quote>useAttr</quote> + </entry> + <entry> + &type.bool; + </entry> + <entry> + &true; + </entry> + <entry> + Controls whether attributes are parsed and saved. + </entry> + </row> + <row> + <entry> + <quote>isFile</quote> + </entry> + <entry> + &type.bool; + </entry> + <entry> + &true; + </entry> + <entry> + If &true;, the first argument to <function>parseConfig</function> + will be taken as the file name for the XML file to load. If + &false;, the argument will be taken as the XML data itself and + parsed accordingly. + </entry> + </row> + <row> + <entry> + <quote>useCData</quote> + </entry> + <entry> + &type.bool; + </entry> + <entry> + &false; + </entry> + <entry> + Controls whether data is enclosed in CDATA blocks. + </entry> + </row> + </tbody> + </tgroup> + </table> </para> </listitem> </varlistentry> http://cvs.php.net/viewvc.cgi/peardoc/en/package/configuration/config/config/registerconfigtype.xml?view=markup&rev=1.1 Index: peardoc/en/package/configuration/config/config/registerconfigtype.xml +++ peardoc/en/package/configuration/config/config/registerconfigtype.xml <!-- $Rev$ --> <refentry id="package.configuration.config.config.registerconfigtype"> <refnamediv> <refname><function>Config::registerConfigType</function></refname> <refpurpose>Registers a custom Config container</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'Config.php'; </funcsynopsisinfo> <funcprototype> <funcdef>bool <function>Config::registerConfigType</function></funcdef> <paramdef>string <parameter>$configType</parameter></paramdef> <paramdef>array <parameter><optional>$configInfo = false</optional></parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.configuration.config.config.registerconfigtype.desc"> &title.desc; <para> This method registers a new container type with the <classname>Config</classname> class. </para> </refsect1> <refsect1 id="package.configuration.config.config.registerconfigtype.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$configType</parameter> </term> <listitem> <para> The name of the configuration type. </para> </listitem> </varlistentry> <varlistentry> <term> &type.array; <parameter>$configInfo</parameter> </term> <listitem> <para> An array defining the file containing the container's class definition and the class name. The format for this array is as follows: <programlisting role="php"> <![CDATA[ $configInfo = array('path/to/Name.php', // The path to the source file for the class. 'Config_Container_Class_Name' // The name of the container class. ); ]]> </programlisting> </para> <para> If omitted, the default values are: <programlisting role="php"> <![CDATA[ $configInfo = array("Config/Container/$configType.php", "Config_Container_$configType" ); ]]> </programlisting> </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.configuration.config.config.registerconfigtype.return"> &title.returns; <para> <parameter>mixed</parameter> - &return.success-pearerror; </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->