Microsoft_Log
[ class tree: Microsoft_Log ] [ index: Microsoft_Log ] [ all elements ]

Source for file Suppress.php

Documentation is available at Suppress.php

  1. <?php
  2. /**
  3.  * Zend Framework
  4.  *
  5.  * LICENSE
  6.  *
  7.  * This source file is subject to the new BSD license that is bundled
  8.  * with this package in the file LICENSE.txt.
  9.  * It is also available through the world-wide-web at this URL:
  10.  * http://framework.zend.com/license/new-bsd
  11.  * If you did not receive a copy of the license and are unable to
  12.  * obtain it through the world-wide-web, please send an email
  13.  * to license@zend.com so we can send you a copy immediately.
  14.  *
  15.  * @category   Microsoft
  16.  * @package    Microsoft_Log
  17.  * @subpackage Filter
  18.  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  19.  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  20.  * @version    $Id: Suppress.php 20096 2010-01-06 02:05:09Z bkarwin $
  21.  */
  22.  
  23. /**
  24.  * @see Microsoft_AutoLoader
  25.  */
  26. require_once dirname(__FILE__'/../../AutoLoader.php';
  27.  
  28. /**
  29.  * @category   Microsoft
  30.  * @package    Microsoft_Log
  31.  * @subpackage Filter
  32.  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  33.  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  34.  * @version    $Id: Suppress.php 20096 2010-01-06 02:05:09Z bkarwin $
  35.  */
  36. {
  37.     /**
  38.      * @var boolean 
  39.      */
  40.     protected $_accept = true;
  41.  
  42.     /**
  43.      * This is a simple boolean filter.
  44.      *
  45.      * Call suppress(true) to suppress all log events.
  46.      * Call suppress(false) to accept all log events.
  47.      *
  48.      * @param  boolean  $suppress  Should all log events be suppressed?
  49.      * @return  void 
  50.      */
  51.     public function suppress($suppress)
  52.     {
  53.         $this->_accept = ($suppress);
  54.     }
  55.  
  56.     /**
  57.      * Returns TRUE to accept the message, FALSE to block it.
  58.      *
  59.      * @param  array    $event    event data
  60.      * @return boolean            accepted?
  61.      */
  62.     public function accept($event)
  63.     {
  64.         return $this->_accept;
  65.     }
  66.  
  67.     /**
  68.      * Create a new instance of Microsoft_Log_Filter_Suppress
  69.      * 
  70.      * @param  array $config 
  71.      * @return Microsoft_Log_Filter_Suppress 
  72.      * @throws Microsoft_Log_Exception
  73.      */
  74.     static public function factory($config)
  75.     {
  76.         return new self();
  77.     }
  78. }

Documentation generated on Wed, 18 May 2011 12:06:56 +0200 by phpDocumentor 1.4.3