mirror of
https://github.com/magicbug/Cloudlog
synced 2024-11-22 00:07:14 +00:00
Adding file_exists check in install/index.php
This commit is contained in:
parent
a61bf66fe3
commit
4f9249754b
@ -8,13 +8,21 @@ $db_file_path = $db_config_path."database.php";
|
|||||||
function delDir($dir) {
|
function delDir($dir) {
|
||||||
$files = glob( $dir . '*', GLOB_MARK );
|
$files = glob( $dir . '*', GLOB_MARK );
|
||||||
foreach ( $files as $file ) {
|
foreach ( $files as $file ) {
|
||||||
if( substr( $file, -1 ) == '/' )
|
if ( substr( $file, -1 ) == '/' ) {
|
||||||
|
if (file_exists($file)) {
|
||||||
delDir( $file );
|
delDir( $file );
|
||||||
else
|
}
|
||||||
|
} else {
|
||||||
|
if (file_exists($file)) {
|
||||||
unlink( $file );
|
unlink( $file );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// This step may be not needed
|
||||||
|
if (file_exists($dir)) {
|
||||||
rmdir( $dir );
|
rmdir( $dir );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (file_exists($db_file_path)) {
|
if (file_exists($db_file_path)) {
|
||||||
delDir(getcwd());
|
delDir(getcwd());
|
||||||
|
Loading…
Reference in New Issue
Block a user