Ejemplo n.º 1
0
 protected static function load()
 {
     if (!self::$loaded) {
         $config = \ManiaLive\Config\Config::getInstance();
         $path = Path::getInstance()->getLog(true) . DIRECTORY_SEPARATOR;
         if (!is_dir($path) && !mkdir($path, '0777', true)) {
             throw new \ManiaLive\Application\FatalException(sprintf("The log repository (%s) does not exists and can't be created", Path::getInstance()->getLog(true)));
         }
         self::$loaded = true;
         self::$staticPath = $path;
         self::$staticPrefix = $config->logsPrefix ? $config->logsPrefix . '-' : '';
     }
     return !empty(self::$staticPath);
 }
Ejemplo n.º 2
0
 protected static function load()
 {
     if (!self::$loaded) {
         $config = \ManiaLive\Config\Config::getInstance();
         if (!is_dir($config->logsPath)) {
             if (mkdir($config->logsPath, '0777', true)) {
                 self::$loaded = true;
                 self::$staticPath = $config->logsPath . '/';
                 self::$staticPrefix = $config->logsPrefix ? $config->logsPrefix . '-' : '';
             }
         } else {
             self::$loaded = true;
             self::$staticPath = $config->logsPath . '/';
             self::$staticPrefix = $config->logsPrefix ? $config->logsPrefix . '-' : '';
         }
     }
     return !empty(self::$staticPath);
 }