CI_Log::__construct PHP Method

__construct() public method

Class constructor
public __construct ( ) : void
return void
    public function __construct()
    {
        $config =& get_config();
        $this->_log_path = $config['log_path'] !== '' ? $config['log_path'] : APPPATH . 'logs/';
        $this->_file_ext = isset($config['log_file_extension']) && $config['log_file_extension'] !== '' ? ltrim($config['log_file_extension'], '.') : 'php';
        file_exists($this->_log_path) or mkdir($this->_log_path, 0755, TRUE);
        if (!is_dir($this->_log_path) or !is_really_writable($this->_log_path)) {
            $this->_enabled = FALSE;
        }
        if (is_numeric($config['log_threshold'])) {
            $this->_threshold = (int) $config['log_threshold'];
        } elseif (is_array($config['log_threshold'])) {
            $this->_threshold = 0;
            $this->_threshold_array = array_flip($config['log_threshold']);
        }
        if (!empty($config['log_date_format'])) {
            $this->_date_fmt = $config['log_date_format'];
        }
        if (!empty($config['log_file_permissions']) && is_int($config['log_file_permissions'])) {
            $this->_file_permissions = $config['log_file_permissions'];
        }
    }

Usage Example

コード例 #1
0
ファイル: CORE_NAILS_Log.php プロジェクト: nailsapp/common
 public function __construct()
 {
     parent::__construct();
     // --------------------------------------------------------------------------
     //	Ignore whatever the aprent constructor says about whether logging is
     //	enabled or not. We'll work it out below.
     $this->_enabled = NULL;
 }
All Usage Examples Of CI_Log::__construct