示例#1
0
文件: Factory.php 项目: pyrsmk/imagix
 public static function forge($path)
 {
     // Prepare
     $excludes = array('AbstractAdapter.php', 'AdapterInterface.php');
     // Browse adapters
     foreach (lessdir(__DIR__ . '/Adapter') as $file) {
         if (in_array($file, $excludes)) {
             continue;
         }
         $class = 'Imagix\\Adapter\\' . pathinfo($file, PATHINFO_FILENAME);
         if ($class::supports($path)) {
             return new Image(new $class($path));
         }
     }
     // No adapter found
     throw new Exception("'{$path}' image file is not supported");
 }
示例#2
0
文件: Http.php 项目: pyrsmk/lumy
 public function unpublish($path)
 {
     $path = $this->_formatPath($path);
     if (is_dir($path)) {
         foreach (lessdir($path) as $file) {
             $this->unpublish($path . '/' . $file);
         }
     } else {
         $this->__lock->deny($path);
     }
     return $this;
 }
示例#3
0
function rrmdir($path)
{
    if (is_dir($path)) {
        foreach (lessdir($path) as $file) {
            if (is_dir("{$path}/{$file}")) {
                rrmdir("{$path}/{$file}");
            } else {
                unlink("{$path}/{$file}");
            }
        }
        rmdir($path);
    }
}