/** * Constructor * * @param integer $level initial log level */ public function __construct($level = null) { parent::__construct('root'); if ($level == null) { $level = LoggerLevel::getLevelAll(); } $this->setLevel($level); }
public function __construct() { // enable logging parent::__construct(); // check if session exists if (session_id() == '') { session_start(); } self::initCart(); }
/** * 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; }
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'); } }
/** * 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; }
/** * 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()); } }
/** * 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(); }
public function __construct(Database $db) { // enable logging parent::__construct(); $this->db = $db; }
/** * 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); }
function __construct($minimum, $filehandle, $dateformat = "r") { $this->filehandle = $filehandle; $this->dateformat = $dateformat; return parent::__construct($minimum); }
function __construct($env) { parent::__construct($env); }
function __construct($env) { parent::__construct($env); ini_set("error_reporting", E_ALL); ini_set("display_errors", "On"); }
/** * 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)); }
public function __construct($filename, Formatter $formatter) { parent::__construct(); self::$filename = $filename; self::$formatter = $formatter; }
public function __construct(Formatter $formatter) { $this->formatter = $formatter; parent::__construct(); }