本文整理汇总了PHP中General::deleteDirectory方法的典型用法代码示例。如果您正苦于以下问题:PHP General::deleteDirectory方法的具体用法?PHP General::deleteDirectory怎么用?PHP General::deleteDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类General
的用法示例。
在下文中一共展示了General::deleteDirectory方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update
public function update($previousVersion = false)
{
try {
$this->meetDependencies();
} catch (Exception $e) {
$this->showAlertIfPossible($e);
}
if (version_compare($previousVersion, '1.4', '<')) {
Symphony::Configuration()->remove('fl_driver', 'frontend_localisation');
Symphony::Configuration()->set('lang_codes', '', 'frontend_localisation');
Symphony::Configuration()->set('main_lang', '', 'frontend_localisation');
$ref_lang = Symphony::Configuration()->get('reference_language', 'frontend_localisation');
Symphony::Configuration()->set('ref_lang', $ref_lang, 'frontend_localisation');
$consolidate = Symphony::Configuration()->get('consolidate_translations', 'frontend_localisation');
Symphony::Configuration()->set('consolidate', $consolidate, 'frontend_localisation');
}
if (version_compare($previousVersion, '2.0', '<')) {
General::deleteDirectory(WORKSPACE . Symphony::Configuration()->get('translation_path', 'frontend_localisation'));
try {
Symphony::Database()->query("ALTER TABLE `tbl_pages` DROP `translations`");
} catch (Exception $e) {
}
}
}
示例2: preg_replace
$clean_url = preg_replace(array('/\\/{2,}/i', '/install$/i'), array('/', null), $clean_url);
$clean_url = rtrim($clean_url, '/\\');
define('DOMAIN', $clean_url);
$clean_path = rtrim(dirname(__FILE__), '/\\');
$clean_path = preg_replace(array('/\\/{2,}/i', '/install$/i'), array('/', null), $clean_path);
$clean_path = rtrim($clean_path, '/\\');
define('DOCROOT', $clean_path);
// Required boot components
define('VERSION', '2.6.4');
define('INSTALL', DOCROOT . '/install');
// Include autoloader:
require_once DOCROOT . '/vendor/autoload.php';
// Include the boot script:
require_once DOCROOT . '/symphony/lib/boot/bundle.php';
define('INSTALL_LOGS', MANIFEST . '/logs');
define('INSTALL_URL', URL . '/install');
// If prompt to remove, delete the entire `/install` directory
// and then redirect to Symphony
if (isset($_GET['action']) && $_GET['action'] == 'remove') {
General::deleteDirectory(INSTALL);
redirect(SYMPHONY_URL);
}
// If Symphony is already installed, run the updater
if (file_exists(CONFIG)) {
// System updater
$script = Updater::instance();
} else {
// System installer
$script = Installer::instance();
}
return $script->run();
示例3: uninstall
public function uninstall()
{
return General::deleteDirectory(WORKSPACE . '/indecent/');
}
示例4: uninstall
public function uninstall()
{
General::deleteDirectory(WORKSPACE . '/jit-image-manipulation');
return $this->disable();
}
示例5: download
private function download()
{
// create the Gateway object
$gateway = new Gateway();
// set our url
$gateway->init($this->downloadUrl);
// get the raw response, ignore errors
$response = @$gateway->exec();
if (!$response) {
throw new Exception(__("Could not read from %s", array($this->downloadUrl)));
}
// write the output
$tmpFile = MANIFEST . '/tmp/' . Lang::createHandle($this->extensionHandle);
if (!General::writeFile($tmpFile, $response)) {
throw new Exception(__("Could not write file."));
}
// open the zip
$zip = new ZipArchive();
if (!$zip->open($tmpFile)) {
General::deleteFile($tmpFile, true);
throw new Exception(__("Could not open downloaded file."));
}
// get the directory name
$dirname = $zip->getNameIndex(0);
// extract
$zip->extractTo(EXTENSIONS);
$zip->close();
// delete tarbal
General::deleteFile($tmpFile, false);
// prepare
$curDir = EXTENSIONS . '/' . $dirname;
$toDir = $this->getDestinationDirectory();
// delete current version
if (!General::deleteDirectory($toDir)) {
throw new Exception(__('Could not delete %s', array($toDir)));
}
// rename extension folder
if (!@rename($curDir, $toDir)) {
throw new Exception(__('Could not rename %s to %s', array($curDir, $toDir)));
}
}