Location: PHPKode > projects > ChiCoMaS - Chilek CMS > chicomas/install/rm.php
<?
// (on a system with the "whoami" executable in the path)
echo "RM OK...<br>";
echo exec('whoami');
exec('rm -rf ../sections');
exec('rm -rf ../siteimages');
exec('rm -rf ../style.css ../styleedit.css ../.htaccess ../config.php ../config.inc ../config.php.old');

 // ------------ lixlpixel recursive PHP functions -------------
 // recursive_remove_directory( directory to delete, empty )
 // expects path to directory and optional TRUE / FALSE to empty
 // ------------------------------------------------------------
 function recursive_remove_directory($directory, $empty=FALSE)
 {
     if(substr($directory,-1) == '/')
     {
         $directory = substr($directory,0,-1);
     }
     if(!file_exists($directory) || !is_dir($directory))
     {
         return FALSE;
     }elseif(is_readable($directory))
     {
         $handle = opendir($directory);
         while (FALSE !== ($item = readdir($handle)))
         {
             if($item != '.' && $item != '..')
             {
                 $path = $directory.'/'.$item;
                 if(is_dir($path)) 
                 {
                     recursive_remove_directory($path);
                 }else{
                     unlink($path);
                 }
             }
         }
         closedir($handle);
         if($empty == FALSE)
         {
             if(!rmdir($directory))
             {
                 return FALSE;
             }
         }
     }
     return TRUE;
 }
 // ------------------------------------------------------------

//recursive_remove_directory("sections/", false);

//echo "dede";
?>
Return current item: ChiCoMaS - Chilek CMS