CC-2166: Packaging Improvements. Moved the Zend app into airtime_mvc. It is now installed to /var/www/airtime. Storage is now set to /srv/airtime/stor. Utils are now installed to /usr/lib/airtime/utils/. Added install/airtime-dircheck.php as a simple test to see if everything is install/uninstalled correctly.
This commit is contained in:
parent
514777e8d2
commit
b11cbd8159
4546 changed files with 138 additions and 51 deletions
129
airtime_mvc/library/Zend/Log/Writer/Abstract.php
Normal file
129
airtime_mvc/library/Zend/Log/Writer/Abstract.php
Normal file
|
@ -0,0 +1,129 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Log
|
||||
* @subpackage Writer
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Abstract.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/** Zend_Log_Filter_Priority */
|
||||
require_once 'Zend/Log/Filter/Priority.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Log
|
||||
* @subpackage Writer
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Abstract.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
abstract class Zend_Log_Writer_Abstract implements Zend_Log_FactoryInterface
|
||||
{
|
||||
/**
|
||||
* @var array of Zend_Log_Filter_Interface
|
||||
*/
|
||||
protected $_filters = array();
|
||||
|
||||
/**
|
||||
* Formats the log message before writing.
|
||||
* @var Zend_Log_Formatter_Interface
|
||||
*/
|
||||
protected $_formatter;
|
||||
|
||||
/**
|
||||
* Add a filter specific to this writer.
|
||||
*
|
||||
* @param Zend_Log_Filter_Interface $filter
|
||||
* @return void
|
||||
*/
|
||||
public function addFilter($filter)
|
||||
{
|
||||
if (is_integer($filter)) {
|
||||
$filter = new Zend_Log_Filter_Priority($filter);
|
||||
}
|
||||
|
||||
$this->_filters[] = $filter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Log a message to this writer.
|
||||
*
|
||||
* @param array $event log data event
|
||||
* @return void
|
||||
*/
|
||||
public function write($event)
|
||||
{
|
||||
foreach ($this->_filters as $filter) {
|
||||
if (! $filter->accept($event)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// exception occurs on error
|
||||
$this->_write($event);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a new formatter for this writer
|
||||
*
|
||||
* @param Zend_Log_Formatter_Interface $formatter
|
||||
* @return void
|
||||
*/
|
||||
public function setFormatter($formatter)
|
||||
{
|
||||
$this->_formatter = $formatter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform shutdown activites such as closing open resources
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function shutdown()
|
||||
{}
|
||||
|
||||
/**
|
||||
* Write a message to the log.
|
||||
*
|
||||
* @param array $event log data event
|
||||
* @return void
|
||||
*/
|
||||
abstract protected function _write($event);
|
||||
|
||||
/**
|
||||
* Validate and optionally convert the config to array
|
||||
*
|
||||
* @param array|Zend_Config $config Zend_Config or Array
|
||||
* @return array
|
||||
* @throws Zend_Log_Exception
|
||||
*/
|
||||
static protected function _parseConfig($config)
|
||||
{
|
||||
if ($config instanceof Zend_Config) {
|
||||
$config = $config->toArray();
|
||||
}
|
||||
|
||||
if (!is_array($config)) {
|
||||
require_once 'Zend/Log/Exception.php';
|
||||
throw new Zend_Log_Exception(
|
||||
'Configuration must be an array or instance of Zend_Config'
|
||||
);
|
||||
}
|
||||
|
||||
return $config;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue