示例#1
0
 public static function CheckCacheDir()
 {
     avada_Less_Cache::$cache_dir = str_replace('\\', '/', avada_Less_Cache::$cache_dir);
     avada_Less_Cache::$cache_dir = rtrim(avada_Less_Cache::$cache_dir, '/') . '/';
     if (!file_exists(avada_Less_Cache::$cache_dir)) {
         if (!mkdir(avada_Less_Cache::$cache_dir)) {
             throw new Less_Exception_Parser('Less.php cache directory couldn\'t be created: ' . avada_Less_Cache::$cache_dir);
         }
     } elseif (!is_dir(avada_Less_Cache::$cache_dir)) {
         throw new Less_Exception_Parser('Less.php cache directory doesn\'t exist: ' . avada_Less_Cache::$cache_dir);
     } elseif (!is_writable(avada_Less_Cache::$cache_dir)) {
         throw new Less_Exception_Parser('Less.php cache directory isn\'t writable: ' . avada_Less_Cache::$cache_dir);
     }
 }
示例#2
0
 /**
  * @deprecated 1.5.1.2
  *
  */
 public function SetCacheDir($dir)
 {
     if (!file_exists($dir)) {
         if (mkdir($dir)) {
             return true;
         }
         throw new Avada_Less_Exception_Parser('Less.php cache directory couldn\'t be created: ' . $dir);
     } elseif (!is_dir($dir)) {
         throw new Avada_Less_Exception_Parser('Less.php cache directory doesn\'t exist: ' . $dir);
     } elseif (!is_writable($dir)) {
         throw new Avada_Less_Exception_Parser('Less.php cache directory isn\'t writable: ' . $dir);
     } else {
         $dir = self::WinPath($dir);
         avada_Less_Cache::$cache_dir = rtrim($dir, '/') . '/';
         return true;
     }
 }