本文整理汇总了PHP中FileUtil::deldir方法的典型用法代码示例。如果您正苦于以下问题:PHP FileUtil::deldir方法的具体用法?PHP FileUtil::deldir怎么用?PHP FileUtil::deldir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileUtil
的用法示例。
在下文中一共展示了FileUtil::deldir方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: removeLocalDir
/**
* Remove a directory from zikula's local cache directory.
*
* @param string $dir The name of the directory to remove.
* @param bool $absolute Whether to process the passed dir as an absolute path or not.
*
* @return boolean true if successful, false otherwise.
*/
public static function removeLocalDir($dir, $absolute = false)
{
$sm = ServiceUtil::getManager();
$base = $sm['kernel.cache_dir'] . '/ztemp';
$path = $base . '/' . $dir;
return FileUtil::deldir($path, $absolute);
}
示例2: actionDelTemplate
public function actionDelTemplate($template)
{
$fileutil = new FileUtil();
$fileutil->deldir("themes/" . $template);
$defTheme = $this->connection->createCommand("select content from xm_config where syskey = 'theme'")->queryScalar();
if ($defTheme == $template) {
$templates = $fileutil->getFileList('themes');
$this->actionSetDefault($templates[0]);
}
echo 1;
}
示例3: removeLocalDir
/**
* Remove a directory from zikula's local cache directory.
*
* @param string $dir The name of the directory to remove.
* @param bool $absolute Whether to process the passed dir as an absolute path or not.
*
* @return boolean true if successful, false otherwise.
*/
public static function removeLocalDir($dir, $absolute = false)
{
$path = DataUtil::formatForOS(System::getVar('temp'), true) . '/' . $dir;
return FileUtil::deldir($path, $absolute);
}
示例4: deletefiles
/**
* delete theme files from the file system if possible
*/
public function deletefiles($args)
{
// check our input
if (!isset($args['themename']) || empty($args['themename'])) {
return LogUtil::registerArgsError();
} else {
$themename = $args['themename'];
}
if (!isset($args['themedirectory']) || empty($args['themedirectory'])) {
return LogUtil::registerArgsError();
} else {
$osthemedirectory = DataUtil::formatForOS($args['themedirectory']);
}
// Security check
if (!SecurityUtil::checkPermission('Theme::', $themename .'::', ACCESS_ADMIN)) {
return LogUtil::registerPermissionError();
}
if (is_writable('themes') && is_writable('themes/' . $osthemedirectory)) {
$res = FileUtil::deldir('themes/' .$osthemedirectory);
if ($res == true) {
return LogUtil::registerStatus(__('Done! Removed theme files from the file system.'));
}
return LogUtil::registerError(__('Error! Could not delete theme files from the file system. Please remove them by another means (FTP, SSH, ...).'));
}
LogUtil::registerStatus(__f('Notice: Theme files cannot be deleted because Zikula does not have write permissions for the themes folder and/or themes/%s folder.', DataUtil::formatForDisplay($args['themedirectory'])));
return false;
}