本文整理汇总了PHP中deleteDirectory函数的典型用法代码示例。如果您正苦于以下问题:PHP deleteDirectory函数的具体用法?PHP deleteDirectory怎么用?PHP deleteDirectory使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了deleteDirectory函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cron_options_uninstall
function cron_options_uninstall()
{
global $wpdb;
global $tbl_name;
$tbl_name = $wpdb->prefix . 'ak_video';
global $wpdb;
$wpdb->query("DROP TABLE IF EXISTS {$tbl_name}");
$dir = "../wp-content/uploads";
deleteDirectory($dir);
}
示例2: remove_user
function remove_user($name)
{
global $dbh;
$dropUsers = $dbh->prepare("DELETE FROM users WHERE name = :name");
$dropUsers->bindValue(":name", $name, SQLITE3_TEXT);
$dropUsers->execute();
if (is_dir(constant("BASEPATH") . $name)) {
deleteDirectory(constant("BASEPATH") . $name);
}
}
示例3: deleteDirectory
public function deleteDirectory()
{
if (is_dir($this->baseDir)) {
$files = array_diff(scandir($this->baseDir), array('.', '..'));
foreach ($files as $file) {
is_dir($this->baseDir . $file) ? deleteDirectory($this->baseDir . $file) : $this->deleteImage($file);
}
return rmdir($this->baseDir);
}
return true;
}
示例4: deleteDirectory
/**
* @param $directoryPath
* @return bool
*/
function deleteDirectory($directoryPath)
{
$files = array_diff(scandir($directoryPath), array('.', '..'));
foreach ($files as $file) {
if (is_dir("{$directoryPath}/{$file}")) {
deleteDirectory("{$directoryPath}/{$file}");
} else {
unlink("{$directoryPath}/{$file}");
}
}
return rmdir($directoryPath);
}
示例5: deleteDirectory
function deleteDirectory($dir)
{
$deletefiles = glob($dir . '*', GLOB_MARK);
foreach ($deletefiles as $file) {
if (substr($file, -1) == DIRECTORY_SEPARATOR) {
deleteDirectory($file);
} else {
unlink($file);
}
}
if (is_dir($dir)) {
rmdir($dir);
}
}
示例6: deleteDirectory
function deleteDirectory($dir)
{
if (!($dh = @opendir($dir))) {
return;
}
while (false !== ($current = readdir($dh))) {
if ($current != '.' && $current != '..') {
//echo 'Se ha borrado el archivo '.$dir.'/'.$current.'<br/>';
if (!@unlink($dir . '/' . $current)) {
deleteDirectory($dir . '/' . $current);
}
}
}
closedir($dh);
//echo 'Se ha borrado el directorio '.$dir.'<br/>';
@rmdir($dir);
}
示例7: deleteDirectory
function deleteDirectory($dirPath)
{
if (is_dir($dirPath)) {
$objects = scandir($dirPath);
foreach ($objects as $object) {
if ($object != "." && $object != "..") {
if (filetype($dirPath . DIRECTORY_SEPARATOR . $object) == "dir") {
deleteDirectory($dirPath . DIRECTORY_SEPARATOR . $object);
} else {
unlink($dirPath . DIRECTORY_SEPARATOR . $object);
}
}
}
reset($objects);
rmdir($dirPath);
}
}
示例8: deleteDirectory
function deleteDirectory($dir)
{
if (!file_exists($dir)) {
return true;
}
if (!is_dir($dir)) {
return unlink($dir);
}
foreach (scandir($dir) as $item) {
if ($item == '.' || $item == '..') {
continue;
}
if (!deleteDirectory($dir . DIRECTORY_SEPARATOR . $item)) {
return false;
}
}
return rmdir($dir);
}
示例9: deleteDirectory
function deleteDirectory($dirName)
{
$dirHandle = null;
if (is_dir($dirName)) {
$dirHandle = opendir($dirName);
}
if (!$dirHandle) {
return false;
}
while ($file = readdir($dirHandle)) {
if ($file != "." && $file != "..") {
if (!is_dir($dirName . "/" . $file)) {
@unlink($dirName . "/" . $file);
} else {
deleteDirectory($dirName . '/' . $file);
}
}
}
closedir($dirHandle);
return @rmdir($dirName);
}
示例10: rcopy
function rcopy($src, $dst)
{
if (file_exists($dst)) {
//echo $dst;
deleteDirectory($dst);
}
if (is_dir($src)) {
mkdir($dst);
$files = scandir($src);
foreach ($files as $file) {
if ($file != "." && $file != "..") {
rcopy("{$src}/{$file}", "{$dst}/{$file}");
}
}
} else {
if (file_exists($src)) {
// echo $src."<br>";
copy($src, $dst);
}
}
}
开发者ID:dimahongkong,项目名称:Searching-Exploring-with-Speech-Augmented-Map-Information-SESAMI,代码行数:21,代码来源:makePackage.php
示例11: deleteDirectory
function deleteDirectory($dir)
{
if (!file_exists($dir)) {
return true;
}
if (!is_dir($dir) || is_link($dir)) {
return unlink($dir);
}
foreach (scandir($dir) as $item) {
if ($item == '.' || $item == '..') {
continue;
}
if (!deleteDirectory($dir . "/" . $item)) {
chmod($dir . "/" . $item, 0777);
if (!deleteDirectory($dir . "/" . $item)) {
return false;
}
}
}
return rmdir($dir);
}
示例12: deleteDirectory
function deleteDirectory($dir)
{
if (!is_writeable($dir)) {
return "The directory \"{$dir}\" can't be deleted. Please check your permissions and try again.";
}
if (!file_exists($dir)) {
return true;
}
if (!is_dir($dir)) {
return unlink($dir);
}
foreach (scandir($dir) as $item) {
if ($item == '.' || $item == '..') {
continue;
}
//echo $item . "<br />";
if (!deleteDirectory($dir . DIRECTORY_SEPARATOR . $item)) {
return false;
}
}
//this sometimes gives errors, it seems it has something to do with the svn files
//the easiest bet to counter this on a OSX/LINUX environment is to cd into the themes folder and run "chmod -R 777 ./cloudy"
return rmdir($dir);
}
示例13: deleteDirectory
function deleteDirectory($dir)
{
$dir = addslash($dir);
$files = array_diff(scandir($dir), array('.', '..'));
foreach ($files as $file) {
$path = $dir . $file;
is_dir($path) ? deleteDirectory($path) : unlink($path);
}
return rmdir($dir);
}
示例14: _removeSetup
function _removeSetup()
{
deleteDirectory(APPPATH . "views/setup");
echo "Remove View completed";
}
示例15: wrsqz_removeMoodledataFiles
function wrsqz_removeMoodledataFiles(){
global $CFG;
return deleteDirectory($CFG->dataroot . '/' . $CFG->wirisquizzes_imagedir);
}