Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' into merges/svntrunk
Browse files Browse the repository at this point in the history
Conflicts:
	demos/Zend/Service/LiveDocx/MailMerge/bitmaps/generate-bitmaps.php
	demos/Zend/Service/LiveDocx/MailMerge/constructors/hosted-licensed.php
	demos/Zend/Service/LiveDocx/MailMerge/constructors/public-zend_config.php
	demos/Zend/Service/LiveDocx/MailMerge/constructors/public.php
	demos/Zend/Service/LiveDocx/MailMerge/convert/convert-document.php
	demos/Zend/Service/LiveDocx/MailMerge/license-agreement/generate-document-concat.php
	demos/Zend/Service/LiveDocx/MailMerge/license-agreement/generate-document.php
	demos/Zend/Service/LiveDocx/MailMerge/metafiles/generate-metafiles.php
	demos/Zend/Service/LiveDocx/MailMerge/pdf-security/generate-document.php
	demos/Zend/Service/LiveDocx/MailMerge/supported-fonts/show-supported-fonts-cached.php
	demos/Zend/Service/LiveDocx/MailMerge/supported-fonts/show-supported-fonts.php
	demos/Zend/Service/LiveDocx/MailMerge/supported-formats/show-supported-formats-cached.php
	demos/Zend/Service/LiveDocx/MailMerge/supported-formats/show-supported-formats.php
	demos/Zend/Service/LiveDocx/MailMerge/telephone-bill/generate-document.php
	demos/Zend/Service/LiveDocx/MailMerge/template-info/list-template-info.php
	demos/Zend/Service/LiveDocx/MailMerge/templates/delete-all.php
	demos/Zend/Service/LiveDocx/MailMerge/templates/download.php
	demos/Zend/Service/LiveDocx/MailMerge/templates/list.php
	demos/Zend/Service/LiveDocx/MailMerge/templates/template-exists.php
	demos/Zend/Service/LiveDocx/MailMerge/templates/upload.php
	demos/Zend/Service/LiveDocx/check-environment.php
	demos/Zend/Service/LiveDocx/configuration.php.dist
	documentation/manual/de/module_specs/Zend_Application-CoreFunctionality-Application.xml
	documentation/manual/de/module_specs/Zend_Cache-Frontends.xml
	documentation/manual/de/module_specs/Zend_Config_Ini.xml
	documentation/manual/de/module_specs/Zend_Date-Introduction.xml
	documentation/manual/de/module_specs/Zend_Date-Overview.xml
	documentation/manual/de/module_specs/Zend_Db_Adapter.xml
	documentation/manual/de/module_specs/Zend_Dojo-BuildLayers.xml
	documentation/manual/de/module_specs/Zend_Dojo-Form-Elements.xml
	documentation/manual/de/module_specs/Zend_Dojo-View-Helpers.xml
	documentation/manual/de/module_specs/Zend_Feed_Writer.xml
	documentation/manual/de/module_specs/Zend_Filter-Decryption.xml
	documentation/manual/de/module_specs/Zend_Filter-Encryption.xml
	documentation/manual/de/module_specs/Zend_Filter-Inflector.xml
	documentation/manual/de/module_specs/Zend_Filter-Set.xml
	documentation/manual/de/module_specs/Zend_Filter.xml
	documentation/manual/de/module_specs/Zend_Gdata_Books.xml
	documentation/manual/de/module_specs/Zend_Http_Client-Adapters.xml
	documentation/manual/de/module_specs/Zend_Http_Client-Advanced.xml
	documentation/manual/de/module_specs/Zend_Serializer-Introduction.xml
	documentation/manual/de/module_specs/Zend_Service_Amazon.xml
	documentation/manual/de/module_specs/Zend_Service_Amazon_Ec2-Ebs.xml
	documentation/manual/de/module_specs/Zend_Service_LiveDocx.xml
	documentation/manual/de/module_specs/Zend_Service_WindowsAzure_Blob.xml
	documentation/manual/de/module_specs/Zend_Tool-Extending.xml
	documentation/manual/de/module_specs/Zend_Translate-Plurals.xml
	documentation/manual/de/module_specs/Zend_Translate-Using.xml
	documentation/manual/de/module_specs/Zend_Validate-Barcode.xml
	documentation/manual/de/module_specs/Zend_Validate-Between.xml
	documentation/manual/de/module_specs/Zend_Validate-Callback.xml
	documentation/manual/de/module_specs/Zend_Validate-CreditCard.xml
	documentation/manual/de/module_specs/Zend_Validate-GreaterThan.xml
	documentation/manual/de/module_specs/Zend_Validate-Hostname.xml
	documentation/manual/de/module_specs/Zend_Validate-Identical.xml
	documentation/manual/de/module_specs/Zend_Validate-Ip.xml
	documentation/manual/de/module_specs/Zend_Validate-Isbn.xml
	documentation/manual/de/module_specs/Zend_Validate-Messages.xml
	documentation/manual/de/module_specs/Zend_Validate-PostCode.xml
	documentation/manual/de/module_specs/Zend_Validate-Regex.xml
	documentation/manual/de/module_specs/Zend_Validate-Set.xml
	documentation/manual/de/module_specs/Zend_Validate-StringLength.xml
	documentation/manual/de/module_specs/Zend_Validate.xml
	documentation/manual/de/ref/coding_standard.xml
	documentation/manual/de/ref/migration-19.xml
	documentation/manual/en/module_specs/Zend_Dojo-Form-Elements.xml
	documentation/manual/en/module_specs/Zend_Feed-ConsumingRss.xml
	documentation/manual/en/module_specs/Zend_Feed_Reader.xml
	documentation/manual/en/module_specs/Zend_File_Transfer-Validators.xml
	documentation/manual/en/module_specs/Zend_Filter-Encryption.xml
	documentation/manual/en/module_specs/Zend_Filter-Inflector.xml
	documentation/manual/en/module_specs/Zend_Filter.xml
	documentation/manual/en/module_specs/Zend_Form-Decorators.xml
	documentation/manual/en/module_specs/Zend_Form-Elements.xml
	documentation/manual/en/module_specs/Zend_Form-Forms.xml
	documentation/manual/en/module_specs/Zend_Form-QuickStart.xml
	documentation/manual/en/module_specs/Zend_Form-StandardDecorators.xml
	documentation/manual/en/module_specs/Zend_Log-Overview.xml
	documentation/manual/en/module_specs/Zend_Validate-Between.xml
	documentation/manual/en/module_specs/Zend_Validate-GreaterThan.xml
	documentation/manual/en/module_specs/Zend_Validate-Hostname.xml
	documentation/manual/en/module_specs/Zend_Validate-Identical.xml
	documentation/manual/en/module_specs/Zend_Validate-Isbn.xml
	documentation/manual/en/module_specs/Zend_Validate-Messages.xml
	documentation/manual/en/module_specs/Zend_Validate-Regex.xml
	documentation/manual/en/module_specs/Zend_Validate-Set.xml
	documentation/manual/en/module_specs/Zend_Validate-StringLength.xml
	documentation/manual/fr/module_specs/Zend_Application-AvailableResources-Frontcontroller.xml
	documentation/manual/fr/module_specs/Zend_Application-CoreFunctionality-Application.xml
	documentation/manual/fr/module_specs/Zend_Cache-Backends.xml
	documentation/manual/fr/module_specs/Zend_Cache-Frontends.xml
	documentation/manual/fr/module_specs/Zend_Config_Ini.xml
	documentation/manual/fr/module_specs/Zend_Db_Adapter.xml
	documentation/manual/fr/module_specs/Zend_Filter-Decryption.xml
	documentation/manual/fr/module_specs/Zend_Ldap-Node.xml
	documentation/manual/fr/module_specs/Zend_Markup.xml
	documentation/manual/fr/module_specs/Zend_Service_Twitter.xml
	documentation/manual/fr/module_specs/Zend_Validate-Between.xml
	documentation/manual/fr/module_specs/Zend_Validate-GreaterThan.xml
	documentation/manual/fr/module_specs/Zend_Validate-StringLength.xml
	documentation/manual/ja/module_specs/Zend_Feed-ModifyingFeed.xml
	documentation/manual/ja/module_specs/Zend_Filter-Decryption.xml
	documentation/manual/ja/module_specs/Zend_Filter-Encryption.xml
	documentation/manual/ja/module_specs/Zend_Filter-Set.xml
	documentation/manual/ja/module_specs/Zend_Filter.xml
	documentation/manual/ja/module_specs/Zend_Mail-HtmlMails.xml
	documentation/manual/ja/module_specs/Zend_Mail-Introduction.xml
	documentation/manual/ja/module_specs/Zend_Mail_Read.xml
	documentation/manual/ja/module_specs/Zend_Mime_Part.xml
	documentation/manual/ja/module_specs/Zend_Translate-Using.xml
	documentation/manual/ja/module_specs/Zend_Validate-Ip.xml
	documentation/manual/ja/module_specs/Zend_Validate-Messages.xml
	documentation/manual/ja/module_specs/Zend_Validate-Set.xml
	documentation/manual/ja/module_specs/Zend_Validate.xml
	documentation/manual/ja/module_specs/Zend_XmlRpc_Server.xml
	documentation/manual/ja/ref/coding_standard.xml
	documentation/manual/ja/ref/migration-19.xml
	documentation/manual/pl/module_specs/Zend_Db_Adapter.xml
	documentation/manual/pl/module_specs/Zend_Db_Select.xml
	documentation/manual/pl/tutorials/quickstart-create-layout.xml
	documentation/manual/pl/tutorials/quickstart-create-project.xml
	documentation/manual/pl/tutorials/quickstart-intro-mvc.xml
	documentation/manual/pt-br/module_specs/Zend_Db_Adapter.xml
	documentation/manual/pt-br/module_specs/Zend_Search_Lucene-Charset.xml
	documentation/manual/pt-br/module_specs/Zend_Search_Lucene-Extending.xml
	library/Zend/Acl.php
	library/Zend/Amf/Parse/Amf0/Deserializer.php
	library/Zend/Amf/Parse/Amf0/Serializer.php
	library/Zend/Amf/Parse/Amf3/Deserializer.php
	library/Zend/Amf/Parse/Amf3/Serializer.php
	library/Zend/Amf/Parse/Serializer.php
	library/Zend/Amf/Response.php
	library/Zend/Amf/Response/Http.php
	library/Zend/Amf/Server.php
	library/Zend/Amf/Util/BinaryStream.php
	library/Zend/Application/Bootstrap/BootstrapAbstract.php
	library/Zend/Application/Resource/Multidb.php
	library/Zend/Application/Resource/Translate.php
	library/Zend/Auth/Adapter/DbTable.php
	library/Zend/Auth/Adapter/Ldap.php
	library/Zend/Barcode/Object/ObjectAbstract.php
	library/Zend/Barcode/Renderer/Pdf.php
	library/Zend/Barcode/Renderer/RendererAbstract.php
	library/Zend/Cache.php
	library/Zend/Cache/Backend/File.php
	library/Zend/Cache/Backend/Memcached.php
	library/Zend/Cache/Backend/Static.php
	library/Zend/Cache/Backend/Test.php
	library/Zend/Cache/Backend/TwoLevels.php
	library/Zend/Cache/Core.php
	library/Zend/Cache/Frontend/Function.php
	library/Zend/Cache/Manager.php
	library/Zend/CodeGenerator/Php/Class.php
	library/Zend/CodeGenerator/Php/Parameter.php
	library/Zend/CodeGenerator/Php/Property/DefaultValue.php
	library/Zend/Config/Writer/Ini.php
	library/Zend/Controller/Request/Http.php
	library/Zend/Controller/Response/Abstract.php
	library/Zend/Crypt/Rsa.php
	library/Zend/Currency.php
	library/Zend/Date.php
	library/Zend/Db/Adapter/Sqlsrv.php
	library/Zend/Db/Statement/Sqlsrv.php
	library/Zend/Db/Table/Row/Abstract.php
	library/Zend/Dojo/BuildLayer.php
	library/Zend/Dom/Query.php
	library/Zend/Dom/Query/Css2Xpath.php
	library/Zend/Feed/Pubsubhubbub/Model/Subscription.php
	library/Zend/Feed/Pubsubhubbub/Subscriber/Callback.php
	library/Zend/Feed/Reader.php
	library/Zend/Feed/Reader/Entry/Rss.php
	library/Zend/Feed/Reader/Feed/Atom.php
	library/Zend/Feed/Reader/Feed/Rss.php
	library/Zend/Feed/Reader/FeedAbstract.php
	library/Zend/Feed/Writer/Entry.php
	library/Zend/Feed/Writer/Feed/FeedAbstract.php
	library/Zend/Feed/Writer/Renderer/Entry/Rss.php
	library/Zend/Feed/Writer/Renderer/Feed/Atom/AtomAbstract.php
	library/Zend/Feed/Writer/Renderer/Feed/Rss.php
	library/Zend/File/Transfer.php
	library/Zend/File/Transfer/Adapter/Abstract.php
	library/Zend/Filter/Encrypt/Mcrypt.php
	library/Zend/Filter/Encrypt/Openssl.php
	library/Zend/Filter/Inflector.php
	library/Zend/Filter/Input.php
	library/Zend/Filter/StripTags.php
	library/Zend/Form.php
	library/Zend/Form/Decorator/FormErrors.php
	library/Zend/Form/DisplayGroup.php
	library/Zend/Form/Element.php
	library/Zend/Gdata/App.php
	library/Zend/Gdata/Gapps.php
	library/Zend/Http/Client.php
	library/Zend/Http/Client/Adapter/Curl.php
	library/Zend/Http/Client/Adapter/Proxy.php
	library/Zend/Http/Client/Adapter/Socket.php
	library/Zend/Http/Response.php
	library/Zend/Json/Encoder.php
	library/Zend/Json/Server.php
	library/Zend/Ldap.php
	library/Zend/Ldap/Attribute.php
	library/Zend/Loader/Autoloader.php
	library/Zend/Loader/Autoloader/Interface.php
	library/Zend/Locale.php
	library/Zend/Locale/Format.php
	library/Zend/Log.php
	library/Zend/Log/Filter/Abstract.php
	library/Zend/Log/Writer/Abstract.php
	library/Zend/Log/Writer/Db.php
	library/Zend/Log/Writer/Syslog.php
	library/Zend/Log/Writer/ZendMonitor.php
	library/Zend/Mail.php
	library/Zend/Mail/Protocol/Abstract.php
	library/Zend/Mail/Transport/Sendmail.php
	library/Zend/Markup/Renderer/Html.php
	library/Zend/Markup/Renderer/RendererAbstract.php
	library/Zend/Measure/Abstract.php
	library/Zend/Oauth/Client.php
	library/Zend/Oauth/Consumer.php
	library/Zend/Oauth/Http/Utility.php
	library/Zend/Paginator.php
	library/Zend/Pdf.php
	library/Zend/Pdf/Action.php
	library/Zend/Pdf/Element/String.php
	library/Zend/Pdf/Filter/Ascii85.php
	library/Zend/Pdf/StringParser.php
	library/Zend/Search/Lucene.php
	library/Zend/Search/Lucene/Document/Html.php
	library/Zend/Service/Twitter.php
	library/Zend/Soap/AutoDiscover.php
	library/Zend/Soap/Wsdl.php
	library/Zend/Soap/Wsdl/Strategy/ArrayOfTypeComplex.php
	library/Zend/Test/PHPUnit/Constraint/DomQuery.php
	library/Zend/Test/PHPUnit/ControllerTestCase.php
	library/Zend/Tool/Framework/Loader/Interface.php
	library/Zend/Translate.php
	library/Zend/Translate/Adapter.php
	library/Zend/Translate/Adapter/Csv.php
	library/Zend/Translate/Plural.php
	library/Zend/Uri.php
	library/Zend/Validate.php
	library/Zend/Validate/Abstract.php
	library/Zend/Validate/Barcode.php
	library/Zend/Validate/CreditCard.php
	library/Zend/Validate/Db/Abstract.php
	library/Zend/Validate/EmailAddress.php
	library/Zend/Validate/File/Count.php
	library/Zend/Validate/File/ExcludeMimeType.php
	library/Zend/Validate/File/MimeType.php
	library/Zend/Validate/File/Upload.php
	library/Zend/Validate/Float.php
	library/Zend/Validate/Iban.php
	library/Zend/Validate/Identical.php
	library/Zend/Validate/Isbn.php
	library/Zend/Validate/PostCode.php
	library/Zend/Validate/Regex.php
	library/Zend/Validate/Sitemap/Changefreq.php
	library/Zend/Validate/Sitemap/Lastmod.php
	library/Zend/Validate/Sitemap/Loc.php
	library/Zend/Validate/Sitemap/Priority.php
	library/Zend/View/Abstract.php
	library/Zend/View/Helper/FormButton.php
	library/Zend/View/Helper/FormLabel.php
	library/Zend/View/Helper/HeadTitle.php
	library/Zend/XmlRpc/Response.php
	library/Zend/XmlRpc/Value/Array.php
	resources/languages/de/Zend_Validate.php
	resources/languages/en/Zend_Validate.php
	resources/languages/ja/Zend_Validate.php
	resources/languages/pt_BR/Zend_Validate.php
	tests/Zend/Application/Bootstrap/BootstrapAbstractTest.php
	tests/Zend/Application/Resource/MultidbTest.php
	tests/Zend/Application/Resource/NavigationTest.php
	tests/Zend/Auth/Adapter/DbTable/BasicSqliteTest.php
	tests/Zend/Barcode/AllTests.php
	tests/Zend/Barcode/Renderer/TestCommon.php
	tests/Zend/Cache/AllTests.php
	tests/Zend/Cache/CommonBackendTest.php
	tests/Zend/Cache/CommonExtendedBackendTest.php
	tests/Zend/Cache/FunctionFrontendTest.php
	tests/Zend/Cache/ManagerTest.php
	tests/Zend/CodeGenerator/Php/ClassTest.php
	tests/Zend/CodeGenerator/Php/PropertyTest.php
	tests/Zend/Crypt/Rsa/RsaTest.php
	tests/Zend/CurrencyTest.php
	tests/Zend/DateTest.php
	tests/Zend/Db/Adapter/SqlsrvTest.php
	tests/Zend/Db/Statement/MysqliTest.php
	tests/Zend/Db/Statement/SqlsrvTest.php
	tests/Zend/Db/Table/Row/TestCommon.php
	tests/Zend/Dojo/BuildLayerTest.php
	tests/Zend/Dojo/_files/BuildProfile.js
	tests/Zend/Dojo/_files/BuildProfileWithDependencies.js
	tests/Zend/Dom/Query/Css2XpathTest.php
	tests/Zend/Dom/QueryTest.php
	tests/Zend/Feed/Pubsubhubbub/AllTests.php
	tests/Zend/Feed/Reader/Entry/RssTest.php
	tests/Zend/Feed/Reader/Feed/RssTest.php
	tests/Zend/Feed/Reader/Integration/WordpressRss2DcAtomTest.php
	tests/Zend/Feed/Writer/EntryTest.php
	tests/Zend/Feed/Writer/FeedTest.php
	tests/Zend/Feed/Writer/Renderer/Entry/RssTest.php
	tests/Zend/Feed/Writer/Renderer/Feed/RssTest.php
	tests/Zend/File/Transfer/Adapter/AbstractTest.php
	tests/Zend/File/Transfer/Adapter/HttpTest.php
	tests/Zend/Filter/AllTests.php
	tests/Zend/Filter/Encrypt/McryptTest.php
	tests/Zend/Filter/Encrypt/OpensslTest.php
	tests/Zend/Filter/InflectorTest.php
	tests/Zend/Filter/StripTagsTest.php
	tests/Zend/Form/AllTests.php
	tests/Zend/Form/Decorator/AllTests.php
	tests/Zend/Form/Decorator/FieldsetTest.php
	tests/Zend/Form/DisplayGroupTest.php
	tests/Zend/Form/Element/ImageTest.php
	tests/Zend/Form/Element/RadioTest.php
	tests/Zend/Form/Element/SubmitTest.php
	tests/Zend/Form/ElementTest.php
	tests/Zend/Form/FormTest.php
	tests/Zend/Form/SubFormTest.php
	tests/Zend/Gdata/AllTests.php
	tests/Zend/Gdata/GappsOnlineTest.php
	tests/Zend/Http/Client/CommonHttpTests.php
	tests/Zend/Http/Client/CurlTest.php
	tests/Zend/Http/Client/StaticTest.php
	tests/Zend/Http/ResponseTest.php
	tests/Zend/Json/ServerTest.php
	tests/Zend/JsonTest.php
	tests/Zend/Ldap/AttributeTest.php
	tests/Zend/Ldap/CrudTest.php
	tests/Zend/LoaderTest.php
	tests/Zend/Locale/FormatTest.php
	tests/Zend/LocaleTest.php
	tests/Zend/Log/AllTests.php
	tests/Zend/Log/LogTest.php
	tests/Zend/Log/Writer/DbTest.php
	tests/Zend/Markup/BbcodeAndHtmlTest.php
	tests/Zend/Measure/TimeTest.php
	tests/Zend/Oauth/Oauth/Token/AccessTest.php
	tests/Zend/PaginatorTest.php
	tests/Zend/Pdf/Element/StringTest.php
	tests/Zend/Reflection/_files/TestSampleClass.php
	tests/Zend/Search/Lucene/LuceneTest.php
	tests/Zend/Service/AllTests.php
	tests/Zend/Service/Twitter/TwitterSearchTest.php
	tests/Zend/Service/Twitter/TwitterTest.php
	tests/Zend/Soap/ServerTest.php
	tests/Zend/Soap/Wsdl/ArrayOfTypeComplexStrategyTest.php
	tests/Zend/Soap/_files/commontypes.php
	tests/Zend/TimeSyncTest.php
	tests/Zend/Translate/Adapter/ArrayTest.php
	tests/Zend/Translate/Adapter/CsvTest.php
	tests/Zend/Translate/Adapter/GettextTest.php
	tests/Zend/Translate/Adapter/IniTest.php
	tests/Zend/Translate/Adapter/QtTest.php
	tests/Zend/Translate/Adapter/TbxTest.php
	tests/Zend/Translate/Adapter/TmxTest.php
	tests/Zend/Translate/Adapter/XliffTest.php
	tests/Zend/Translate/Adapter/XmlTmTest.php
	tests/Zend/TranslateTest.php
	tests/Zend/UriTest.php
	tests/Zend/Validate/AllTests.php
	tests/Zend/Validate/CreditCardTest.php
	tests/Zend/Validate/File/AllTests.php
	tests/Zend/Validate/File/IsCompressedTest.php
	tests/Zend/Validate/File/IsImageTest.php
	tests/Zend/Validate/File/MimeTypeTest.php
	tests/Zend/Validate/FloatTest.php
	tests/Zend/Validate/IdenticalTest.php
	tests/Zend/Validate/IsbnTest.php
	tests/Zend/Validate/PostCodeTest.php
	tests/Zend/Validate/RegexTest.php
	tests/Zend/Validate/Sitemap/ChangefreqTest.php
	tests/Zend/Validate/Sitemap/LastmodTest.php
	tests/Zend/Validate/Sitemap/LocTest.php
	tests/Zend/Validate/Sitemap/PriorityTest.php
	tests/Zend/ValidateTest.php
	tests/Zend/ViewTest.php
	tests/Zend/Wildfire/WildfireTest.php
	tests/Zend/XmlRpc/ResponseTest.php
  • Loading branch information
weierophinney committed Jul 12, 2010
3 parents 7e2c3cc + 307038c + 829cfe1 commit ca34104
Show file tree
Hide file tree
Showing 13 changed files with 442 additions and 24 deletions.
3 changes: 1 addition & 2 deletions src/Filter/AbstractFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/
abstract class AbstractFilter
implements Filter, Factory
abstract class AbstractFilter implements Filter, Factory
{
/**
* Validate and optionally convert the config to array
Expand Down
40 changes: 37 additions & 3 deletions src/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,25 @@ class Logger implements Factory
* @var callback
*/
protected $_origErrorHandler = null;

/**
*
* @var boolean
*/
protected $_registeredErrorHandler = false;

/**
*
* @var array
*/
protected $_errorHandlerMap = false;

/**
*
* @var string
*/
protected $_timestampFormat = 'c';

/**
* Class constructor. Create a new logger
*
Expand Down Expand Up @@ -154,6 +160,9 @@ protected function _constructWriterFromConfig($config)
$writer = $this->_constructFromConfig('writer', $config, $this->_defaultWriterNamespace);

if (!$writer instanceof Writer) {
$writerName = is_object($writer)
? get_class($writer)
: 'The specified writer';
throw new Exception("{$writerName} does not extend Zend\\Log\\Writer!");
}

Expand All @@ -176,6 +185,9 @@ protected function _constructFilterFromConfig($config)
$filter = $this->_constructFromConfig('filter', $config, $this->_defaultFilterNamespace);

if (!$filter instanceof Filter) {
$filterName = is_object($filter)
? get_class($filter)
: 'The specified filter';
throw new Exception("{$filterName} does not implement Zend\\Log\\Filter");
}

Expand Down Expand Up @@ -252,7 +264,7 @@ protected function getClassName($config, $type, $defaultNamespace)
protected function _packEvent($message, $priority)
{
return array_merge(array(
'timestamp' => date('c'),
'timestamp' => date($this->_timestampFormat),
'message' => $message,
'priority' => $priority,
'priorityName' => $this->_priorities[$priority]
Expand Down Expand Up @@ -513,4 +525,26 @@ public function errorHandler($errno, $errstr, $errfile, $errline, $errcontext)
}
return false;
}

/**
* Set timestamp format for log entries.
*
* @param string $format
* @return Zend\Log\Logger
*/
public function setTimestampFormat($format)
{
$this->_timestampFormat = $format;
return $this;
}

/**
* Get timestamp format used for log entries.
*
* @return string
*/
public function getTimestampFormat()
{
return $this->_timestampFormat;
}
}
4 changes: 4 additions & 0 deletions src/Writer/AbstractWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ public function addFilter($filter)
$filter = new \Zend\Log\Filter\Priority($filter);
}

if (!$filter instanceof \Zend\Log\Filter) {
throw new \Zend\Log\Exception('Invalid filter provided');
}

$this->_filters[] = $filter;
}

Expand Down
10 changes: 5 additions & 5 deletions src/Writer/Db.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ static public function factory($config = array())
{
$config = self::_parseConfig($config);
$config = array_merge(array(
'db' => null,
'table' => null,
'db' => null,
'table' => null,
'columnMap' => null,
), $config);

if (isset($config['columnmap'])) {
$config['columnMap'] = $config['columnmap'];
}

return new self(
$config['db'],
$config['table'],
Expand All @@ -101,7 +101,7 @@ static public function factory($config = array())
/**
* Formatting is not possible on this writer
*/
public function setFormatter($formatter)
public function setFormatter(Zend_Log_Formatter_Interface $formatter)
{
throw new Log\Exception(get_class() . ' does not support formatting');
}
Expand Down
81 changes: 73 additions & 8 deletions src/Writer/Syslog.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,17 @@ class Syslog extends AbstractWriter

/**
* Facility used by this syslog-writer instance
* @var string
* @var int
*/
protected $_facility = LOG_USER;

/**
* _validFacilities
*
* @var array
*/
protected $_validFacilities = array();

/**
* Class constructor
*
Expand All @@ -95,15 +102,21 @@ public function __construct(array $params = array())
if (isset($params['application'])) {
$this->_application = $params['application'];
}

$runInitializeSyslog = true;
if (isset($params['facility'])) {
$this->_facility = $params['facility'];
$this->_facility = $this->setFacility($params['facility']);
$runInitializeSyslog = false;
}

if ($runInitializeSyslog) {
$this->_initializeSyslog();
}
$this->_initializeSyslog();
}

/**
* Create a new instance of Zend_Log_Writer_Syslog
*
*
* @param array|\Zend\Config\Config $config
* @return \Zend\Log\Writer\Syslog
* @throws \Zend\Log\Exception
Expand All @@ -113,11 +126,45 @@ static public function factory($config = array())
return new self(self::_parseConfig($config));
}

/**
* Initialize values facilities
*
* @return void
*/
protected function _initializeValidFacilities()
{
$constants = array(
'LOG_AUTH',
'LOG_AUTHPRIV',
'LOG_CRON',
'LOG_DAEMON',
'LOG_KERN',
'LOG_LOCAL0',
'LOG_LOCAL1',
'LOG_LOCAL2',
'LOG_LOCAL3',
'LOG_LOCAL4',
'LOG_LOCAL5',
'LOG_LOCAL6',
'LOG_LOCAL7',
'LOG_LPR',
'LOG_MAIL',
'LOG_NEWS',
'LOG_SYSLOG',
'LOG_USER',
'LOG_UUCP'
);

foreach ($constants as $constant) {
if (defined($constant)) {
$this->_validFacilities[] = constant($constant);
}
}
}

/**
* Initialize syslog / set application name and facility
*
* @param string $application Application name
* @param string $facility Syslog facility
* @return void
*/
protected function _initializeSyslog()
Expand All @@ -130,14 +177,32 @@ protected function _initializeSyslog()
/**
* Set syslog facility
*
* @param string $facility Syslog facility
* @param int $facility Syslog facility
* @return void
* @throws Zend_Log_Exception for invalid log facility
*/
public function setFacility($facility)
{
if ($this->_facility === $facility) {
return;
}

if (!count($this->_validFacilities)) {
$this->_initializeValidFacilities();
}

if (!in_array($facility, $this->_validFacilities)) {
require_once 'Zend/Log/Exception.php';
throw new Zend_Log_Exception('Invalid log facility provided; please see http://php.net/openlog for a list of valid facility values');
}

if ('WIN' == strtoupper(substr(PHP_OS, 0, 3))
&& ($facility !== LOG_USER)
) {
require_once 'Zend/Log/Exception.php';
throw new Zend_Log_Exception('Only LOG_USER is a valid log facility on Windows');
}

$this->_facility = $facility;
$this->_initializeSyslog();
}
Expand Down
8 changes: 4 additions & 4 deletions src/Writer/ZendMonitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ static public function factory($config = array())
/**
* Is logging to this writer enabled?
*
* If the Zend Monitor extension is not enabled, this log writer will
* fail silently. You can query this method to determine if the log
* If the Zend Monitor extension is not enabled, this log writer will
* fail silently. You can query this method to determine if the log
* writer is enabled.
*
*
* @return bool
*/
public function isEnabled()
Expand Down Expand Up @@ -106,7 +106,7 @@ protected function _write($event)
unset($event['priority'], $event['message']);

if (!empty($event)) {
monitor_custom_event($priority, $message, $event);
monitor_custom_event($priority, $message, false, $event);
} else {
monitor_custom_event($priority, $message);
}
Expand Down
57 changes: 57 additions & 0 deletions test/LoggerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@

namespace ZendTest\Log;

require_once __DIR__ . '/TestAsset/NotExtendedWriterAbstract.php';
require_once __DIR__ . '/TestAsset/NotImplementsFilterInterface.php';

use \Zend\Log\Logger,
\Zend\Log;

Expand Down Expand Up @@ -321,4 +324,58 @@ public function verifyHandlerData($errno, $errstr, $errfile, $errline, $errconte
$this->assertTrue(empty($this->errWriter->events));
}
}

/**
* @group ZF-9870
*/
public function testSetAndGetTimestampFormat()
{
$logger = new Logger($this->writer);
$this->assertEquals('c', $logger->getTimestampFormat());
$this->assertSame($logger, $logger->setTimestampFormat('Y-m-d H:i:s'));
$this->assertEquals('Y-m-d H:i:s', $logger->getTimestampFormat());
}

/**
* @group ZF-9870
*/
public function testLogWritesWithModifiedTimestampFormat()
{
$logger = new Logger($this->writer);
$logger->setTimestampFormat('Y-m-d');
$logger->debug('ZF-9870');
rewind($this->log);
$message = stream_get_contents($this->log);
$this->assertEquals(date('Y-m-d'), substr($message, 0, 10));
}

/**
* @group ZF-9955
*/
public function testExceptionConstructWriterFromConfig()
{
try {
$logger = new Logger();
$writer = array('writerName' => 'NotExtendedWriterAbstract');
$logger->addWriter($writer);
} catch (\Exception $e) {
$this->assertType('Zend\Log\Exception', $e);
$this->assertRegExp('#^(Zend\\\\Log\\\\Writer\\\\NotExtendedWriterAbstract|The\sspecified\swriter)#', $e->getMessage());
}
}

/**
* @group ZF-9956
*/
public function testExceptionConstructFilterFromConfig()
{
try {
$logger = new Logger();
$filter = array('filterName' => 'NotImplementsFilterInterface');
$logger->addFilter($filter);
} catch (\Exception $e) {
$this->assertType('Zend\Log\Exception', $e);
$this->assertRegExp('#^(Zend\\\\Log\\\\Filter\\\\NotImplementsFilterInterface|The\sspecified\sfilter)#', $e->getMessage());
}
}
}
11 changes: 11 additions & 0 deletions test/TestAsset/NotExtendedWriterAbstract.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
namespace Zend\Log\Writer;

use Zend\Log\Factory;

class NotExtendedWriterAbstract implements Factory
{
public static function factory($config = array())
{
}
}
11 changes: 11 additions & 0 deletions test/TestAsset/NotImplementsFilterInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
namespace Zend\Log\Filter;

use Zend\Log\Factory;

class NotImplementsFilterInterface implements Factory
{
public static function factory($config = array())
{
}
}
Loading

0 comments on commit ca34104

Please sign in to comment.