-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
16 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
/** | ||
* | ||
* @package Mind | ||
* @version Release: 5.9.7 | ||
* @version Release: 5.9.8 | ||
* @license GPL3 | ||
* @author Ali YILMAZ <[email protected]> | ||
* @category Php Framework, Design pattern builder for PHP. | ||
|
@@ -5898,32 +5898,25 @@ public function captcha($level=3, $length=8, $width=320, $height=60){ | |
* @return bool | ||
*/ | ||
public function rm_r($paths) { | ||
|
||
if(!is_array($paths)){ | ||
$paths = array($paths); | ||
} | ||
|
||
foreach ($paths as $path) { | ||
|
||
if(is_file($path)){ | ||
return unlink($path); | ||
if (is_array($paths)) { | ||
foreach ($paths as $path) { | ||
$this->rm_r($path); | ||
} | ||
|
||
if(is_dir($path)){ | ||
|
||
$files = array_diff(scandir($path), array('.','..')); | ||
foreach ($files as $file) { | ||
$this->rm_r($path.'/'.$file); | ||
} else { | ||
if (is_file($paths)) { | ||
unlink($paths); | ||
$dirPath = dirname($paths); | ||
while (is_dir($dirPath)) { | ||
$files = scandir($dirPath); | ||
if (count($files) === 2 && in_array('.', $files) && in_array('..', $files)) { | ||
rmdir($dirPath); | ||
$dirPath = dirname($dirPath); | ||
} else { | ||
break; | ||
} | ||
} | ||
return rmdir($path); | ||
|
||
} else { | ||
return false; | ||
} | ||
|
||
} | ||
|
||
return true; | ||
} | ||
|
||
/** | ||
|