Change log file folder
This commit is contained in:
@@ -45,7 +45,7 @@ class Db extends PhpObject
|
||||
$this->asConf = $asConf;
|
||||
$this->asOptions = $asOptions;
|
||||
|
||||
parent::__construct(__FILE__, Settings::DEBUG);
|
||||
parent::__construct(__FILE__);
|
||||
$this->oConnection = new \mysqli($this->getConf('server'), $this->getConf('user'), $this->getConf('pass'));
|
||||
$this->syncPhpParams($this->getConf('encoding'));
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ class Feed extends PhpObject
|
||||
*/
|
||||
public function __construct($asChannel=array(), $asItems=array())
|
||||
{
|
||||
parent::__construct(__CLASS__, Settings::DEBUG);
|
||||
parent::__construct(__CLASS__);
|
||||
if(!empty($asChannel) && !array_key_exists('link', $asChannel))
|
||||
{
|
||||
$asChannel['link'] = $_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME'].'/rss';
|
||||
|
||||
@@ -48,9 +48,9 @@ abstract class Main extends PhpObject
|
||||
/**
|
||||
* Main constructor
|
||||
*/
|
||||
public function __construct($sProcessPage, $bDb=true, $sFile=__FILE__, $sTimeZone='')
|
||||
public function __construct($sProcessPage, $bDb=true, $sTimeZone='', $sLogPath='')
|
||||
{
|
||||
parent::__construct($sFile, Settings::DEBUG);
|
||||
parent::__construct(get_class($this), Settings::DEBUG, PhpObject::MODE_FILE, $sLogPath);
|
||||
|
||||
$this->setContext($sProcessPage, $sTimeZone);
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ class Mask extends PhpObject
|
||||
public function __construct($sFileName='', Translator $oLang=null, $sTimezone = '')
|
||||
{
|
||||
//init
|
||||
parent::__construct(__FILE__, Settings::DEBUG);
|
||||
parent::__construct(__CLASS__);
|
||||
$this->sMaskName = '';
|
||||
$this->sFilePath = '';
|
||||
$this->sMask = '';
|
||||
|
||||
@@ -12,6 +12,7 @@ class PhpObject
|
||||
{
|
||||
//Log file name
|
||||
const LOG_FILENAME = 'log.html';
|
||||
private $sLogPath;
|
||||
|
||||
//Message types
|
||||
const NOTICE_TAB = 'Notice';
|
||||
@@ -31,13 +32,14 @@ class PhpObject
|
||||
private $sChildClass;
|
||||
private $bDebug;
|
||||
|
||||
function __construct($sClass='', $bDebug=false, $iExtractMode=self::MODE_FILE)
|
||||
function __construct($sClass='', $bDebug=Settings::DEBUG, $iExtractMode=self::MODE_FILE, $sLogPath='')
|
||||
{
|
||||
$this->asMessageStack = array();
|
||||
$this->resetMessageStack();
|
||||
$this->setDebug($bDebug);
|
||||
$this->setExtractMode($iExtractMode);
|
||||
$this->sChildClass = $sClass;
|
||||
$this->setLogPath($sLogPath);
|
||||
}
|
||||
|
||||
public function setExtractMode($iExtractMode) {
|
||||
@@ -55,9 +57,14 @@ class PhpObject
|
||||
return $this->bDebug;
|
||||
}
|
||||
|
||||
private static function getLogPath()
|
||||
private function setLogPath($sLogPath) {
|
||||
if($sLogPath == '') $sLogPath = defined('Settings::LOG_FOLDER')?Settings::LOG_FOLDER:dirname(__FILE__);
|
||||
$this->sLogPath = $sLogPath.DIRECTORY_SEPARATOR.self::LOG_FILENAME;
|
||||
}
|
||||
|
||||
private function getLogPath()
|
||||
{
|
||||
return dirname(__FILE__).DIRECTORY_SEPARATOR.self::LOG_FILENAME;
|
||||
return $this->sLogPath;
|
||||
}
|
||||
|
||||
private function resetMessageStack($sType=self::ALL_TAB)
|
||||
|
||||
@@ -27,7 +27,7 @@ class Translator extends PhpObject
|
||||
*/
|
||||
public function __construct($sLang='', $sDefaultLang='')
|
||||
{
|
||||
parent::__construct(__FILE__, Settings::DEBUG);
|
||||
parent::__construct(__FILE__);
|
||||
$this->asLanguages = array();
|
||||
$this->asTranslations = array();
|
||||
$this->loadLanguages();
|
||||
|
||||
Reference in New Issue
Block a user