本文整理汇总了PHP中Thin\File::rmdir方法的典型用法代码示例。如果您正苦于以下问题:PHP File::rmdir方法的具体用法?PHP File::rmdir怎么用?PHP File::rmdir使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Thin\File
的用法示例。
在下文中一共展示了File::rmdir方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: clean
private function clean()
{
$dirs = glob(APPLICATION_PATH . DS . 'storage' . DS . 'db' . DS . 'caching' . DS . 'expires' . DS . '*');
foreach ($dirs as $dir) {
$when = (int) Arrays::last(explode('/', $dir));
if ($when < time()) {
$files = glob($dir . DS . '*.db');
if (!empty($files)) {
foreach ($files as $file) {
$key = str_replace('.db', '', Arrays::last(explode('/', $file)));
$fileToDelete = $this->getFile($key);
File::delete($fileToDelete);
File::delete($file);
}
}
File::rmdir($dir);
}
}
}
示例2: rollback
public function rollback()
{
$target = str_replace('copy.', '', $this->dir);
File::rmdir($this->dir);
$this->dir = $target;
}
示例3: dropTable
public function dropTable()
{
File::rmdir($this->dir);
return $this;
}
示例4: prepare
private function prepare()
{
$results = $collection = [];
$hash = $this->db->getHash();
$this->cursor = $this->db->motor()->getPath() . DS . 'cursors' . DS . $hash;
if (is_dir($this->cursor)) {
$ageCursor = filemtime($this->cursor . DS . '.');
$ageDb = $this->db->getAge();
if ($ageDb < $ageCursor) {
$this->count = count(glob($this->cursor . DS . '*.php', GLOB_NOSORT));
return;
} else {
File::rmdir($this->cursor);
}
}
File::mkdir($this->db->motor()->getPath() . DS . 'cursors');
File::mkdir($this->db->motor()->getPath() . DS . 'cursors' . DS . $hash);
if (empty($this->db->wheres)) {
$ids = $this->db->motor()->ids('datas');
foreach ($ids as $id) {
$results[$id] = [];
}
unset($ids);
} else {
$results = $this->db->results;
}
$this->count = count($results);
if (empty($results)) {
File::rmdir($this->cursor);
return true;
} else {
$index = 0;
foreach ($results as $id => $row) {
if (false !== $id) {
$file = $this->cursor . DS . $index . '.php';
$data = $this->db->motor()->read('datas.' . $id);
File::put($file, "<?php\nreturn " . var_export($data, 1) . ';');
$index++;
}
}
}
}
示例5: reclone
public function reclone($name = null)
{
$name = is_null($name) ? 'clone_' . $this->table : $name;
File::rmdir(str_replace(DS . $name, DS . $this->table, $this->dir));
File::cpdir($this->dir, str_replace(DS . $name, DS . $this->table, $this->dir));
File::rmdir($this->dir);
return $this;
}
示例6: drop
/**
* [drop description]
*
* @method drop
*
* @return [type] [description]
*/
public function drop()
{
$dir = $this->store->getDir();
File::rmdir($dir);
return true;
}
示例7: cleanCache
public static function cleanCache($dir = null)
{
$dir = is_null($dir) ? Conf::get('dir.raw.store', STORAGE_PATH . DS . 'raw') : $dir;
$dirs = glob($dir . DS . '*', GLOB_NOSORT);
foreach ($dirs as $dir) {
if (is_dir($dir)) {
if (fnmatch('*/sessme.*', $dir) || fnmatch('*/me.*', $dir) || fnmatch('*/temporary.*', $dir)) {
$age = filemtime($dir);
$diff = time() - $age;
\Thin\Cli::show("{$diff}", 'INFO');
if ($diff > 3600 || fnmatch('*/temporary.*', $dir)) {
File::rmdir($dir);
\Thin\Cli::show("delete {$dir}", 'COMMENT');
}
}
}
}
$dir = Conf::get('dir.raw.models', APPLICATION_PATH . DS . 'models' . DS . 'Raw') . DS . 'models/temporary';
File::rmdir($dir);
}
示例8: flush
public function flush()
{
File::rmdir($this->dir);
return $this;
}
示例9: cleanCache
public static function cleanCache($dir = null)
{
$dir = is_null($dir) ? STORAGE_PATH . DS . 'store' : $dir;
$dirs = glob($dir . DS . '*', GLOB_NOSORT);
foreach ($dirs as $dir) {
if (is_dir($dir)) {
if (fnmatch('*/sessme.*', $dir) || fnmatch('*/me.*', $dir) || fnmatch('*/temporary.*', $dir)) {
$age = filemtime($dir);
$diff = time() - $age;
Cli::show("{$diff}", 'INFO');
if ($diff > 3600 || fnmatch('*/temporary.*', $dir)) {
File::rmdir($dir);
Cli::show("delete {$dir}", 'COMMENT');
}
}
}
}
}