本文整理匯總了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();
}