Permalink
Browse files

Merge branch 'master' of git://github.com/zendframework/zf2

  • Loading branch information...
sgehrig committed Mar 23, 2011
2 parents 6cc59ca + 4235f98 commit 4c938d8bc6a56253d17ae659b0e075fac37a44fb
Showing with 3,779 additions and 310 deletions.
  1. +188 −5 documentation/manual/en/module_specs/Zend_Log-Factory.xml
  2. +1 −1 documentation/manual/en/module_specs/Zend_Log-Formatters.xml
  3. +1 −2 documentation/manual/en/module_specs/Zend_Log-Writers.xml
  4. +190 −9 documentation/manual/fr/module_specs/Zend_Log-Factory.xml
  5. +4 −4 documentation/manual/fr/module_specs/Zend_Log-Filters.xml
  6. +1 −1 documentation/manual/fr/module_specs/Zend_Log-Formatters.xml
  7. +1 −1 documentation/manual/fr/module_specs/Zend_Log-Overview.xml
  8. +6 −6 documentation/manual/fr/module_specs/Zend_Log-Writers-Mail.xml
  9. +1 −1 documentation/manual/fr/module_specs/Zend_Log-Writers.xml
  10. +7 −5 documentation/manual/ja/module_specs/Zend_Log-Filters.xml
  11. +23 −20 documentation/manual/ja/module_specs/Zend_Log-Formatters.xml
  12. +28 −11 documentation/manual/ja/module_specs/Zend_Log-Overview.xml
  13. +5 −5 documentation/manual/ja/module_specs/Zend_Log-Writers-Mail.xml
  14. +27 −19 documentation/manual/ja/module_specs/Zend_Log-Writers.xml
  15. +254 −0 library/Zend/Config/Json.php
  16. +100 −0 library/Zend/Config/Writer/Json.php
  17. +138 −0 library/Zend/Config/Writer/Yaml.php
  18. +370 −0 library/Zend/Config/Yaml.php
  19. +4 −2 library/Zend/EventManager/EventManager.php
  20. +0 −7 library/Zend/Log/Exception/NotImplementedException.php
  21. +2 −2 library/Zend/Log/Factory.php
  22. +0 −2 library/Zend/Log/Filter.php
  23. +5 −5 library/Zend/Log/Filter/AbstractFilter.php
  24. +3 −2 library/Zend/Log/Filter/Message.php
  25. +7 −6 library/Zend/Log/Filter/Priority.php
  26. +2 −2 library/Zend/Log/Filter/SuppressFilter.php
  27. +0 −2 library/Zend/Log/Formatter.php
  28. +40 −0 library/Zend/Log/Formatter/AbstractFormatter.php
  29. +14 −3 library/Zend/Log/Formatter/Firebug.php
  30. +31 −7 library/Zend/Log/Formatter/Simple.php
  31. +54 −13 library/Zend/Log/Formatter/Xml.php
  32. +57 −16 library/Zend/Log/Logger.php
  33. +7 −11 library/Zend/Log/Writer.php
  34. +7 −6 library/Zend/Log/Writer/AbstractWriter.php
  35. +6 −2 library/Zend/Log/Writer/Db.php
  36. +7 −3 library/Zend/Log/Writer/Firebug.php
  37. +133 −8 library/Zend/Log/Writer/Mail.php
  38. +6 −2 library/Zend/Log/Writer/Mock.php
  39. +2 −2 library/Zend/Log/Writer/Null.php
  40. +15 −13 library/Zend/Log/Writer/Stream.php
  41. +19 −7 library/Zend/Log/Writer/Syslog.php
  42. +29 −7 library/Zend/Log/Writer/ZendMonitor.php
  43. +75 −22 library/Zend/Queue/Stomp/Connection.php
  44. +62 −32 library/Zend/Queue/Stomp/Frame.php
  45. +0 −1 library/Zend/Tag/Item.php
  46. +38 −0 tests/Zend/Application/Resource/LogTest.php
  47. +286 −0 tests/Zend/Config/JsonTest.php
  48. +150 −0 tests/Zend/Config/Writer/JsonTest.php
  49. +139 −0 tests/Zend/Config/Writer/YamlTest.php
  50. +47 −0 tests/Zend/Config/Writer/files/allsections-pretty.json
  51. +1 −0 tests/Zend/Config/Writer/files/allsections.json
  52. +36 −0 tests/Zend/Config/Writer/files/allsections.yaml
  53. +306 −0 tests/Zend/Config/YamlTest.php
  54. +1 −0 tests/Zend/Config/_files/allsections.json
  55. +35 −0 tests/Zend/Config/_files/allsections.yaml
  56. +22 −0 tests/Zend/Config/_files/array.yaml
  57. +6 −0 tests/Zend/Config/_files/badindentation.yaml
  58. +29 −0 tests/Zend/Config/_files/booleans.yaml
  59. +1 −0 tests/Zend/Config/_files/circular.json
  60. +9 −0 tests/Zend/Config/_files/circular.yaml
  61. +1 −0 tests/Zend/Config/_files/config.json
  62. +38 −0 tests/Zend/Config/_files/config.yaml
  63. +3 −0 tests/Zend/Config/_files/constants.yaml
  64. +1 −0 tests/Zend/Config/_files/invalid.json
  65. +2 −0 tests/Zend/Config/_files/invalid.yaml
  66. +1 −0 tests/Zend/Config/_files/multipleinheritance.json
  67. +54 −0 tests/Zend/Config/_files/nested.json
  68. +1 −0 tests/Zend/Config/_files/nosections.json
  69. +9 −9 tests/Zend/Log/Filter/MessageTest.php
  70. +6 −6 tests/Zend/Log/Filter/PriorityTest.php
  71. +2 −2 tests/Zend/Log/Filter/SuppressFilterTest.php
  72. +59 −0 tests/Zend/Log/Formatter/FirebugTest.php
  73. +14 −2 tests/Zend/Log/Formatter/SimpleTest.php
  74. +37 −0 tests/Zend/Log/Formatter/XmlTest.php
  75. +92 −8 tests/Zend/Log/LoggerTest.php
  76. +13 −4 tests/Zend/Log/Writer/FirebugTest.php
  77. +186 −1 tests/Zend/Log/Writer/MailTest.php
  78. +2 −2 tests/Zend/Log/Writer/StreamTest.php
  79. +37 −1 tests/Zend/Log/Writer/SyslogTest.php
  80. +1 −0 tests/Zend/Log/_files/layout.phtml
  81. +19 −0 tests/Zend/Queue/Stomp/ClientTest.php
  82. +163 −0 tests/Zend/Queue/Stomp/ConnectionTest.php
@@ -17,11 +17,16 @@
<programlisting language="php"><![CDATA[
$logger = Zend_Log::factory(array(
+ 'timestampFormat' => 'Y-m-d',
array(
'writerName' => 'Stream',
'writerParams' => array(
'stream' => '/tmp/zend.log',
),
+ 'formatterName' => 'Simple',
+ 'formatterParams' => array(
+ 'format' => '%timestamp%: %message% -- %info%',
+ ),
'filterName' => 'Priority',
'filterParams' => array(
'priority' => Zend_Log::WARN,
@@ -43,6 +48,11 @@ $logger = Zend_Log::factory(array(
maximum priorities.
</para>
+ <para>
+ By default, events are logged with the ISO 8601 date format. You can choose your own format
+ with the option <emphasis>timestampFormat</emphasis>.
+ </para>
+
<para>
Each writer can be defined with the following keys:
</para>
@@ -84,6 +94,42 @@ $logger = Zend_Log::factory(array(
</listitem>
</varlistentry>
+ <varlistentry>
+ <term>formatterName (optional)</term>
+
+ <listitem>
+ <para>
+ The "short" name of a formatter to use with the given log writer; the name of the
+ formatter minus the leading class prefix/namespace. See the "formatterNamespace"
+ entry below for more details. Examples: "Simple", "Xml".
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>formatterParams (optional)</term>
+
+ <listitem>
+ <para>
+ An associative array of parameters to use when instantiating the log formatter.
+ Each log formatter's <methodname>factory()</methodname> method will map these to
+ constructor arguments, as noted below.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>formatterNamespace (optional)</term>
+
+ <listitem>
+ <para>
+ The class prefix/namespace to use when constructing the final log formatter
+ classname. By default, if this is not provided, "Zend_Log_Formatter" is assumed;
+ however, you can pass your own namespace if you are using a custom log formatter.
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry>
<term>filterName (optional)</term>
@@ -176,11 +222,148 @@ $logger = Zend_Log::factory(array(
<sect3 id="zend.log.factory.writer-options.mail">
<title>Zend_Log_Writer_Mail Options</title>
- <para>
- <classname>Zend_Log_Writer_Mail</classname> currently (as of 1.10) does not
- implement a factory, and will raise an exception if you attempt to instantiate it
- via <methodname>Zend_Log::factory()</methodname>.
- </para>
+ <table id="zend.log.factory.writer-options.mail.table">
+ <title>Zend_Log_Writer_Mail 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><emphasis>mail</emphasis></entry>
+ <entry><type>String</type></entry>
+ <entry><classname>Zend_Mail</classname></entry>
+
+ <entry>
+ An <classname>Zend_Mail</classname> instance
+ </entry>
+ </row>
+
+ <row>
+ <entry><emphasis>charset</emphasis></entry>
+ <entry><type>String</type></entry>
+ <entry>iso-8859-1</entry>
+
+ <entry>
+ Charset of the mail
+ </entry>
+ </row>
+
+ <row>
+ <entry><emphasis>from</emphasis></entry>
+ <entry><type>String</type> or <type>Array</type></entry>
+ <entry><constant>NULL</constant></entry>
+
+ <entry>
+ Sender of the mail
+
+ The parameters for <type>Array</type> type are :
+ <itemizedlist>
+ <listitem>
+ <para>
+ <property>email</property> : address of sender
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <property>name</property> : name of sender
+ </para>
+ </listitem>
+ </itemizedlist>
+ </entry>
+ </row>
+
+ <row>
+ <entry><emphasis>to</emphasis></entry>
+ <entry><type>String</type> or <type>Array</type></entry>
+ <entry><constant>NULL</constant></entry>
+
+ <entry>
+ Recipient(s) of the mail
+ </entry>
+ </row>
+
+ <row>
+ <entry><emphasis>cc</emphasis></entry>
+ <entry><type>String</type> or <type>Array</type></entry>
+ <entry><constant>NULL</constant></entry>
+
+ <entry>
+ Carbon copy recipient(s) of the mail
+ </entry>
+ </row>
+
+ <row>
+ <entry><emphasis>bcc</emphasis></entry>
+ <entry><type>String</type> or <type>Array</type></entry>
+ <entry><constant>NULL</constant></entry>
+
+ <entry>
+ Blind carbon copy recipient(s) of the mail
+ </entry>
+ </row>
+
+ <row>
+ <entry><emphasis>subject</emphasis></entry>
+ <entry><type>String</type></entry>
+ <entry><constant>NULL</constant></entry>
+
+ <entry>
+ Subject of the mail
+ </entry>
+ </row>
+
+ <row>
+ <entry><emphasis>subjectPrependText</emphasis></entry>
+ <entry><type>String</type></entry>
+ <entry><constant>NULL</constant></entry>
+
+ <entry>
+ A summary of number of errors per priority is appended to the
+ subject of the mail
+ </entry>
+ </row>
+
+ <row>
+ <entry><emphasis>layout</emphasis></entry>
+ <entry><type>String</type></entry>
+ <entry><constant>NULL</constant></entry>
+
+ <entry>
+ An <classname>Zend_Layout</classname> instance
+ </entry>
+ </row>
+
+ <row>
+ <entry><emphasis>layoutOptions</emphasis></entry>
+ <entry><type>Array</type></entry>
+ <entry><constant>NULL</constant></entry>
+
+ <entry>
+ See the section <xref linked="zend.layout.options" />
+ </entry>
+ </row>
+
+ <row>
+ <entry><emphasis>layoutFormatter</emphasis></entry>
+ <entry><type>String</type></entry>
+ <entry><constant>NULL</constant></entry>
+
+ <entry>
+ An <classname>Zend_Log_Formatter_Interface</classname> instance
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
</sect3>
<sect3 id="zend.log.factory.writer-options.mock">
@@ -50,7 +50,7 @@ $logger->info('there');
<para>
The constructor of <classname>Zend_Log_Formatter_Simple</classname> accepts a single
parameter: the format string. This string contains keys surrounded by
- percent signs (e.g. <property>%message%</property>). The format string may
+ percent signs (e.g. <command>%message%</command>). The format string may
contain any key from the event data array.
You can retrieve the default keys by using the DEFAULT_FORMAT constant from
<classname>Zend_Log_Formatter_Simple</classname>.
@@ -100,8 +100,7 @@ $logger->info('Informational message');
<para>
The example above writes a single row of log data to the database table named
'log_table_name' table. The database column named 'lvl'
- receives the priority number and the column named 'msg' receives the
- log message.
+ receives the priority number and the column named 'msg' receives the log message.
</para>
</sect2>
Oops, something went wrong.

0 comments on commit 4c938d8

Please sign in to comment.