public static function writable($directory) { if (!Hi_Tool_Dir::is($directory)) { return false; } return is_writable($directory); }
/** * 设置缓存路径 * * @param string $cacheDir * @throws Hi_Cache_Exception */ public function setCacheDir($cacheDir) { if (Hi_Tool_Dir::is($cacheDir) && !Hi_Tool_Dir::writable($cacheDir)) { throw new Hi_Cache_Exception('Cache path must be a writable'); } if (substr($cacheDir, -1) != DIRECTORY_SEPARATOR) { $cacheDir = $cacheDir . DIRECTORY_SEPARATOR; } $this->_dir = $cacheDir; return true; }