本文整理汇总了PHP中Logger::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Logger::__construct方法的具体用法?PHP Logger::__construct怎么用?PHP Logger::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Logger
的用法示例。
在下文中一共展示了Logger::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor
*
* @param integer $level initial log level
*/
public function __construct($level = null)
{
parent::__construct('root');
if ($level == null) {
$level = LoggerLevel::getLevelAll();
}
$this->setLevel($level);
}
示例2: __construct
public function __construct()
{
// enable logging
parent::__construct();
// check if session exists
if (session_id() == '') {
session_start();
}
self::initCart();
}
示例3: __construct
/**
* Used in conjunction with IoC Setters for backwards compatibility
*
* @param $loggerFile
* @param $datesLocalTimeZone
* @param bool $loggerEnabled
* @param int $loggerLevel
* @param string $loggerAllow
* @param string $loggerDeny
*/
public function __construct($loggerFile, $datesLocalTimeZone, $loggerEnabled = true, $loggerLevel = LOG_DEBUG, $loggerAllow = 'all', $loggerDeny = 'none')
{
parent::__construct($loggerEnabled, $loggerLevel, $loggerAllow, $loggerDeny);
if ($datesLocalTimeZone) {
date_default_timezone_set($datesLocalTimeZone);
} else {
date_default_timezone_set('US/Eastern');
}
$this->logFile = $loggerFile;
}
示例4: __construct
public function __construct(Database $db, $bkpdir)
{
// enable logging
parent::__construct();
$this->db = $db;
if (file_exists($bkpdir) && is_writable($bkpdir)) {
$this->bkpdir = $bkpdir;
} else {
throw new Exception('Backup directory ' . $bkpdir . ' either dosn\'t exist or not writable');
}
}
示例5: __construct
/**
* This function first does some checks of the structure than set $this->structure.
*
* @access private
* @param array Array where keys are attrib names, values are CSV fields index
*/
public function __construct($structure)
{
// enable logging
parent::__construct();
if (!array_key_exists('id', $structure)) {
throw new Exception('Catalog structure must have attribute `id` defined');
} else {
if ($structure['id'] !== 'auto' && !is_numeric($structure['id'])) {
throw new Exception('Structure ID must be ether CSV field number or `auto`');
}
}
$this->structure = $structure;
}
示例6: __construct
/**
* Connects to SQL DB. MySQL and SQLite are supported.
*
* @access public
* @param string driver = (mysql|sqlite)
* @param string dsn = "mysql:host=$host;dbname=$name;charset=$char" or "sqlite:$dbfile"
* @param string dbuser
* @param string dbpass
*/
public function __construct($driver, $dsn, $dbuser = '', $dbpass = '')
{
//enable logging
parent::__construct();
try {
if ($driver === 'mysql') {
if ($dbuser === '' || $dbpass === '') {
throw new PDOException('DB username & password are required');
}
$this->dbh = new PDO($dsn, $dbuser, $dbpass);
} else {
if ($driver === 'sqlite') {
$this->dbh = new PDO($dsn);
} else {
throw new PDOException('DB driver is not supported');
}
}
} catch (PDOException $e) {
throw new PDOException($e->getMessage());
}
}
示例7: __construct
/**
* Class constructor. Sets defaults.
*
* We need to set the time the logger was created.
*
* @param array Hash of all values to override in the class
*/
public function __construct($args)
{
parent::__construct($args);
$this->start_time = $this->get_time();
}
示例8: __construct
public function __construct(Database $db)
{
// enable logging
parent::__construct();
$this->db = $db;
}
示例9: __construct
/**
* Constructor.
*
* @param array &$options Log object options.
*
* @since 11.1
* @deprecated 13.3
*/
public function __construct(array &$options)
{
Log::add('JLogger is deprecated. Use JLogLogger instead.', Log::WARNING, 'deprecated');
parent::__construct($options);
}
示例10:
function __construct($minimum, $filehandle, $dateformat = "r")
{
$this->filehandle = $filehandle;
$this->dateformat = $dateformat;
return parent::__construct($minimum);
}
示例11:
function __construct($env)
{
parent::__construct($env);
}
示例12:
function __construct($env)
{
parent::__construct($env);
ini_set("error_reporting", E_ALL);
ini_set("display_errors", "On");
}
示例13: __construct
/**
* Rewrite Magento style $name (Company_Module_Directory_Class) or PHP namespace $name
* (Company\Module\Directory\Class) to log4php style package (Company.Module.Directory.Class).
* @param string $name
*/
public function __construct($name)
{
parent::__construct(Praxigento_Log_Logger::rewriteName($name));
}
示例14: __construct
public function __construct($filename, Formatter $formatter)
{
parent::__construct();
self::$filename = $filename;
self::$formatter = $formatter;
}
示例15: __construct
public function __construct(Formatter $formatter)
{
$this->formatter = $formatter;
parent::__construct();
}