当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Log_Writer_Stream::shutdown方法代码示例

本文整理汇总了PHP中Zend_Log_Writer_Stream::shutdown方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Log_Writer_Stream::shutdown方法的具体用法?PHP Zend_Log_Writer_Stream::shutdown怎么用?PHP Zend_Log_Writer_Stream::shutdown使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Log_Writer_Stream的用法示例。


在下文中一共展示了Zend_Log_Writer_Stream::shutdown方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: shutdown

 /**
  * Close the stream resource.
  *
  * @return void
  */
 public function shutdown()
 {
     try {
         $this->_writeRepeated();
     } catch (Zend_Log_Exception $e) {
         // No problem if it should fail, don't want to break the program
     }
     // Close the file
     parent::shutdown();
 }
开发者ID:JeroenBoersma,项目名称:Srcode_Log,代码行数:15,代码来源:Stream.php

示例2: toLog

 public static function toLog($message, $level = Zend_Log::INFO, $file = 'system_log.txt')
 {
     $filename = implode(DIRECTORY_SEPARATOR, array(RM_Environment::getConnector()->getCorePath(), 'userdata', 'logs', $file));
     if (is_file($filename) == false) {
         return false;
     }
     if (is_writable($filename) == false) {
         return false;
     }
     try {
         $stream = new Zend_Log_Writer_Stream($filename);
         $logger = new RM_Log($stream);
         $logger->log($message, $level);
         $stream->shutdown();
         return true;
     } catch (Exception $e) {
         return false;
     }
 }
开发者ID:laiello,项目名称:resmania,代码行数:19,代码来源:Log.php

示例3: testShutdownClosesStreamResource

 public function testShutdownClosesStreamResource()
 {
     $writer = new Zend_Log_Writer_Stream('php://memory', 'w+');
     $writer->write(array('message' => 'this write should succeed'));
     $writer->shutdown();
     try {
         $writer->write(array('message' => 'this write should fail'));
         $this->fail();
     } catch (Exception $e) {
         $this->assertTrue($e instanceof Zend_Log_Exception);
         $this->assertRegExp('/unable to write/i', $e->getMessage());
     }
 }
开发者ID:crodriguezn,项目名称:crossfit-milagro,代码行数:13,代码来源:StreamTest.php


注:本文中的Zend_Log_Writer_Stream::shutdown方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。