protected function defineConstants()
 {
     if (!defined('BASE_DIR')) {
         $index = strrpos(__DIR__, 'app');
         if ($index !== FALSE) {
             define('BASE_DIR', substr(__DIR__, 0, $index));
         } else {
             throw new LogicException('Unable to define BASE_DIR constant. Folder \'app\' not found.');
         }
     }
     if (!defined('LOG_DIR')) {
         define('LOG_DIR', PathTool::makePath(array(BASE_DIR, 'log')));
     }
     if (!defined('TEMP_DIR')) {
         $currentUser = trim(`whoami`);
         define('TEMP_DIR', PathTool::makePath(array(BASE_DIR, 'temp', $currentUser)));
     }
     if (!defined('APP_DIR')) {
         define('APP_DIR', PathTool::makePath(array(BASE_DIR, 'app')));
     }
     if (!defined('WWW_DIR')) {
         define('WWW_DIR', PathTool::makePath(array(BASE_DIR, 'www')));
     }
 }
Beispiel #2
0
 /**
  * @param int|string $id
  * @return string
  */
 protected function getFilePath($id)
 {
     $path = PathTool::makePath(array(TEMP_DIR, self::FOLDER));
     return PathTool::getPath(array($path, $id . '.' . self::EXTENSION), FALSE);
 }