Пример #1
0
 public static function init()
 {
     // self::$cacheDir = $_SERVER['DOCUMENT_ROOT'] . '/app/_cache/images';
     // self::$documentRoot = '../../..';
     // This must be the last line of this function
     parent::init();
 }
 public static function init()
 {
     self::$cacheDir = '../../../' . Config::$cache_folder . '/images';
     self::$documentRoot = '../../..';
     // This must be the last line of this function
     parent::init();
 }
Пример #3
0
 public static function init()
 {
     parent::init();
     self::$enableRequestCache = (bool) IMAGE::$config['cache'];
     self::$defaultImagePath = (string) IMAGE::$config['defaultImage'];
     self::$defaultQuality = (int) IMAGE::$config['defaultQuality'];
     self::$browserCacheTTL = (int) IMAGE::$config['browserCacheLifetime'];
     self::$garbageCollectFileCacheMaxLifetime = (int) IMAGE::$config['serverCacheLifetime'];
     self::$cacheDir = (string) IMAGE::$config['cacheDir'];
     self::$pathToCacheDir = (string) IMAGE::$config['pathToCacheDir'];
     if (!is_dir(self::$pathToCacheDir)) {
         $cachePath = explode('/', self::$cacheDir);
         $count = count($cachePath);
         $currentPath = IMAGE::$config['documentRoot'];
         for ($i = 0; $i < $count; $i++) {
             if ($cachePath[$i] !== '') {
                 $currentPath = $currentPath . '/' . $cachePath[$i];
                 if (!is_dir($currentPath)) {
                     mkdir($currentPath);
                 }
             }
         }
         chmod(self::$pathToCacheDir, 0777);
     }
 }
Пример #4
0
 public static function init()
 {
     if (isset($_GET['users'])) {
         self::$documentRoot = '../../../../files/uploads/users';
     }
     // This must be the last line of this function
     parent::init();
 }
 public static function init()
 {
     // This must be the last line of this function
     parent::init();
 }
 /**
  * Initialize variables that require some dynamic processing.
  *
  * @since 2.0
  * @return void
  */
 public static function init()
 {
     if (!defined('__DIR__')) {
         define('__DIR__', dirname(__FILE__));
     }
     if (self::$documentRoot === null) {
         self::$documentRoot = rtrim(realpath(preg_replace('`' . preg_quote($_SERVER['PHP_SELF']) . '$`', '', $_SERVER['SCRIPT_FILENAME'])), '/');
     }
     if (self::$pathToSLIR === null) {
         self::$pathToSLIR = realpath(__DIR__ . '/../');
     }
     if (self::$pathToCacheDir === null) {
         self::$pathToCacheDir = self::$pathToSLIR . '/cache';
     }
     if (self::$pathToErrorLog === null) {
         self::$pathToErrorLog = self::$pathToSLIR . '/slir-error-log';
     }
 }
 /**
  * Initialize variables that require some dynamic processing.
  *
  * @since 2.0
  * @return void
  */
 public static function init()
 {
     if (!defined('__DIR__')) {
         define('__DIR__', dirname(__FILE__));
     }
     if (self::$documentRoot === null) {
         self::$documentRoot = $_SERVER['DOCUMENT_ROOT'];
     }
     if (self::$pathToSLIR === null) {
         self::$pathToSLIR = realpath(__DIR__ . '/../');
     }
     if (self::$pathToCacheDir === null) {
         self::$pathToCacheDir = self::$pathToSLIR . '/cache';
     }
     if (self::$pathToErrorLog === null) {
         self::$pathToErrorLog = self::$pathToSLIR . '/slir-error-log';
     }
 }
 /**
  * Initialize variables that require some dynamic processing.
  * 
  * @since 2.0
  * @return void
  */
 public static function init()
 {
     if (self::$documentRoot === NULL) {
         self::$documentRoot = preg_replace('/\\/$/', '', $_SERVER['DOCUMENT_ROOT']);
     }
     if (self::$SLIRDir === NULL) {
         self::$SLIRDir = dirname($_SERVER['SCRIPT_NAME']);
     }
     if (self::$cacheDir === NULL) {
         self::$cacheDir = self::$documentRoot . self::$SLIRDir . self::$cacheDirName;
     }
     if (self::$errorLogPath === NULL) {
         self::$documentRoot . self::$SLIRDir . '/slir-error-log';
     }
 }