/**
  * Checks if the process is running in Web mode
  * @return boolean The process is running in Web mode
  */
 public static function isWebProcess()
 {
     return !SystemTool::isScriptProcess();
 }
Exemplo n.º 2
0
 /**
  * Gets current log file path
  * @return string Current log file path
  */
 public function getLogFilePath()
 {
     $this->currentLogDate = DateTool::getTimeString(DateTool::FORMAT_MYSQL_DATE);
     // Checks which context is used
     if (SystemTool::isScriptProcess()) {
         // process is an engine, get its name from file used
         $logFileName = basename($_SERVER['PHP_SELF'], '.php');
     } else {
         $logFileName = 'web';
     }
     $logFilePath = LOG_DIR . '/' . $this->currentLogDate . '-' . $logFileName . '.log';
     return $logFilePath;
 }