Exemple #1
0
function tbxTemplateCacheFlush($quiet = false)
{
    Privileges::Check(Privileges::TEMPLATES);
    $dirs = Dir::ReadDirectories(TEMPLATE_CACHE_DIR, '~^[^.]~');
    foreach ($dirs as $dir) {
        Dir::Remove(TEMPLATE_CACHE_DIR . '/' . $dir);
    }
    if (!$quiet) {
        JSON::Success('Template cache has been flushed!');
    }
}
Exemple #2
0
                XML_Schema::DeleteColumn($table['name'], $xcolumn->name->val());
            }
        }
    }
    // Remove all database tables
    foreach ($tables as $table) {
        $DB->Update('DROP TABLE IF EXISTS #', array($table));
    }
    // Clear out directories
    $dirs = array('temp', 'uploads', 'videos', 'templates/_cache');
    foreach ($dirs as $dir) {
        $dir = BASE_DIR . '/' . $dir;
        // Remove sub-directories and their contents
        $removals = Dir::ReadDirectories($dir, '~^[^.]~');
        foreach ($removals as $removal) {
            Dir::Remove($dir . '/' . $removal);
        }
        // Remove files
        $files = Dir::ReadFiles($dir, '~^[^.]~');
        foreach ($files as $file) {
            @unlink($dir . '/' . $file);
        }
    }
}
$fp = fopen(__FILE__, 'r');
fseek($fp, __COMPILER_HALT_OFFSET__);
eval(stream_get_contents($fp));
fclose($fp);
__halt_compiler();?>
<html>
<head>
Exemple #3
0
 public function Remove()
 {
     Dir::Remove($this->base_dir);
 }