1: <?php
2: /**
3: * Base Log Engine class
4: *
5: * PHP 5
6: *
7: * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
8: * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
9: *
10: * Licensed under The MIT License
11: * Redistributions of files must retain the above copyright notice.
12: *
13: * @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
14: * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
15: * @package Cake.Log.Engine
16: * @since CakePHP(tm) v 2.2
17: * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
18: */
19:
20: App::uses('CakeLogInterface', 'Log');
21:
22: /**
23: * Base log engine class.
24: *
25: * @package Cake.Log.Engine
26: */
27: abstract class BaseLog implements CakeLogInterface {
28:
29: /**
30: * Engine config
31: *
32: * @var string
33: */
34: protected $_config = array();
35:
36: /**
37: * __construct method
38: *
39: * @return void
40: */
41: public function __construct($config = array()) {
42: $this->config($config);
43: }
44:
45: /**
46: * Sets instance config. When $config is null, returns config array
47: *
48: * Config
49: *
50: * - `types` string or array, levels the engine is interested in
51: * - `scopes` string or array, scopes the engine is interested in
52: *
53: * @param array $config engine configuration
54: * @return array
55: */
56: public function config($config = array()) {
57: if (!empty($config)) {
58: if (isset($config['types']) && is_string($config['types'])) {
59: $config['types'] = array($config['types']);
60: }
61: $this->_config = $config;
62: }
63: return $this->_config;
64: }
65:
66: }
67: