本文整理汇总了PHP中CMS::rmdir方法的典型用法代码示例。如果您正苦于以下问题:PHP CMS::rmdir方法的具体用法?PHP CMS::rmdir怎么用?PHP CMS::rmdir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMS
的用法示例。
在下文中一共展示了CMS::rmdir方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
public function delete($var)
{
if (is_string($var)) {
$var = $this->load($var);
}
$path = $this->path($var->name());
if ($var->is_dir()) {
CMS::rmdir($path);
} else {
IO_FS::rm($path);
}
}
示例2: action_install
protected function action_install()
{
$item = $this->load_item($this->id);
if (!$item) {
return $this->page_not_found();
}
$error = false;
foreach ($item->not_install_if_exists as $entry) {
$entry = $this->validate_path($entry);
if ($entry) {
if (IO_FS::exists($entry)) {
$error = "<b>Файл (каталог) {$entry}</b> уже существует. Установка невозможна!";
}
}
}
if ($item['download'] == '-') {
$error = 'Невозможно получить инсталляционный пакет!';
}
if ($this->env->request->method == 'post') {
$files = $this->get_install_pack($item);
if (is_string($files)) {
$error = $files;
} else {
foreach ($files as $file => $data) {
$from = $data['path'];
$to = "../{$file}";
if ($m = Core_Regexps::match_with_results('{^(.+)/[^/]+$}', $to)) {
$dir = $m[1];
if (!IO_FS::exists($dir)) {
@CMS::mkdirs($dir);
if (!IO_FS::exists($dir)) {
$error = "Невозможно создать каталог {$dir}";
break;
}
}
copy($from, $to);
CMS::chmod_file($to);
$item->set_installed_hash($file, $data['hash']);
}
}
$item->save_info_file();
CMS::rmdir($item->install_temp_dir());
return $this->redirect_to($this->action_url('instok', $item));
}
}
Events::call('cms.stockroom.after_install', $item, $error);
return $this->render('install', array('item' => $item, 'error' => $error, 'list_url' => $this->action_url('list', $this->page), 'list_button_caption' => $this->button_list()));
}
示例3: del
public function del($id)
{
$rows = DB_SQL::db()->vars->select_childs($id);
foreach ($rows as $row) {
$row->del($row->id);
}
DB_SQL::db()->vars->delete($id);
CMS::rmdir(CMS_Vars1::$files_dir . "/{$id}");
}
示例4: check_assets_symlink
static function check_assets_symlink($path)
{
if (is_link($path)) {
return;
}
if (!function_exists('symlink')) {
throw new CMS_Exception("Error creating symlink {$path} (function not exists)");
}
if (is_dir($path)) {
CMS::rmdir($path);
}
$dir = IO_FS::File($path)->dir_name;
CMS::mkdirs($dir);
symlink(self::$stdfiles_path, $path);
}
示例5: before_delete
public function before_delete()
{
$this->multilink_delete_all();
if ($dir = $this->homedir()) {
CMS::rmdir($dir);
}
if ($dir = $this->homedir(true)) {
CMS::rmdir($dir);
}
return true && parent::before_delete();
}