From 616b85ddef83247e7d9dff7a9c66d4bfb97c0f90 Mon Sep 17 00:00:00 2001 From: mkonecny Date: Thu, 20 Jan 2011 11:37:39 -0500 Subject: [PATCH] -fixed uninstall script --- .../{uninstall.php => propel-uninstall.php} | 28 ++++++------------- 1 file changed, 9 insertions(+), 19 deletions(-) rename install/{uninstall.php => propel-uninstall.php} (93%) diff --git a/install/uninstall.php b/install/propel-uninstall.php similarity index 93% rename from install/uninstall.php rename to install/propel-uninstall.php index 89da9bfed..7f7af6784 100644 --- a/install/uninstall.php +++ b/install/propel-uninstall.php @@ -27,24 +27,11 @@ echo "***************************\n"; require_once(dirname(__FILE__).'/../application/configs/conf.php'); require_once(dirname(__FILE__).'/installInit.php'); -//require_once(dirname(__FILE__).'/../backend/cron/Cron.php'); function airtime_uninstall_delete_files($p_path) { - if (!empty($p_path) && (strlen($p_path) > 4)) { - if (file_exists($p_path)) { - $dir = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($p_path), RecursiveIteratorIterator::CHILD_FIRST); - - for ($dir->rewind(); $dir->valid(); $dir->next()) { - if ($dir->isDir()) { - rmdir($dir->getPathname()); - } else { - unlink($dir->getPathname()); - } - } - rmdir($p_path); - } - } + $command = "rm -rf $p_path"; + exec($command); } //------------------------------------------------------------------------ @@ -212,10 +199,6 @@ foreach ($cron->ct->getByType(CRON_CMD) as $id => $line) { $cron->closeCrontab(); echo "done.\n"; */ -//------------------------------------------------------------------------ -// Delete files -//------------------------------------------------------------------------ -airtime_uninstall_delete_files($CC_CONFIG['storageDir']); //------------------------------------------------------------------------ @@ -236,6 +219,13 @@ if ($results == 0) { echo " * Nothing to delete..\n"; } + +//------------------------------------------------------------------------ +// Delete files +//------------------------------------------------------------------------ +airtime_uninstall_delete_files($CC_CONFIG['storageDir']); + + echo "************************************\n"; echo "* StorageServer Uninstall Complete *\n"; echo "************************************\n";