-fixed uninstall errors related to issue http://dev.sourcefabric.org/browse/CC-1794
This commit is contained in:
parent
7bed63e675
commit
95ab0cc148
|
@ -3,8 +3,9 @@ if (!function_exists('pg_connect')) {
|
||||||
trigger_error("PostgreSQL PHP extension required and not found.", E_USER_ERROR);
|
trigger_error("PostgreSQL PHP extension required and not found.", E_USER_ERROR);
|
||||||
exit(2);
|
exit(2);
|
||||||
}
|
}
|
||||||
require_once('DB.php');
|
//require_once('DB.php');
|
||||||
require_once('File/Find.php');
|
require_once(dirname(__FILE__).'/../library/pear/DB.php');
|
||||||
|
//require_once('File/Find.php');
|
||||||
|
|
||||||
function camp_db_table_exists($p_name)
|
function camp_db_table_exists($p_name)
|
||||||
{
|
{
|
||||||
|
|
|
@ -142,7 +142,7 @@ Subjects::AddSubjectToGroup('scheduler', $CC_CONFIG['StationPrefsGr']);
|
||||||
// Install storage directories
|
// Install storage directories
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
echo " *** Directory Setup ***\n";
|
echo " *** Directory Setup ***\n";
|
||||||
foreach (array('baseFilesDir', 'storageDir', /*'bufferDir', 'transDir', 'accessDir',*/ 'cronDir') as $d) {
|
foreach (array('baseFilesDir', 'storageDir') as $d) {
|
||||||
$test = file_exists($CC_CONFIG[$d]);
|
$test = file_exists($CC_CONFIG[$d]);
|
||||||
if ( $test === FALSE ) {
|
if ( $test === FALSE ) {
|
||||||
@mkdir($CC_CONFIG[$d], 02775);
|
@mkdir($CC_CONFIG[$d], 02775);
|
||||||
|
|
|
@ -14,16 +14,22 @@ if (isset($arr["DOCUMENT_ROOT"]) && ($arr["DOCUMENT_ROOT"] != "") ) {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Need to check that we are superuser before running this.
|
||||||
|
if(exec("whoami") != "root"){
|
||||||
|
echo "Must be root user.\n";
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
echo "***************************\n";
|
echo "***************************\n";
|
||||||
echo "* StorageServer Uninstall *\n";
|
echo "* StorageServer Uninstall *\n";
|
||||||
echo "***************************\n";
|
echo "***************************\n";
|
||||||
|
|
||||||
require_once(dirname(__FILE__).'/../conf.php');
|
require_once(dirname(__FILE__).'/../application/configs/conf.php');
|
||||||
require_once(dirname(__FILE__).'/installInit.php');
|
require_once(dirname(__FILE__).'/installInit.php');
|
||||||
require_once(dirname(__FILE__).'/../backend/cron/Cron.php');
|
//require_once(dirname(__FILE__).'/../backend/cron/Cron.php');
|
||||||
|
|
||||||
function camp_uninstall_delete_files($p_path)
|
function airtime_uninstall_delete_files($p_path)
|
||||||
{
|
{
|
||||||
if (!empty($p_path) && (strlen($p_path) > 4)) {
|
if (!empty($p_path) && (strlen($p_path) > 4)) {
|
||||||
if (file_exists($p_path)) {
|
if (file_exists($p_path)) {
|
||||||
|
@ -49,7 +55,6 @@ function camp_uninstall_delete_files($p_path)
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
echo " * Dropping the database '".$CC_CONFIG['dsn']['database']."'...\n";
|
echo " * Dropping the database '".$CC_CONFIG['dsn']['database']."'...\n";
|
||||||
$command = "sudo -u postgres dropdb {$CC_CONFIG['dsn']['database']} 2> /dev/null";
|
$command = "sudo -u postgres dropdb {$CC_CONFIG['dsn']['database']} 2> /dev/null";
|
||||||
//$command = "sudo -u postgres dropdb {$CC_CONFIG['dsn']['database']}";
|
|
||||||
@exec($command, $output, $dbDeleteFailed);
|
@exec($command, $output, $dbDeleteFailed);
|
||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
|
@ -187,6 +192,7 @@ if ($dbDeleteFailed) {
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
// Uninstall Cron job
|
// Uninstall Cron job
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
|
/*
|
||||||
$old_regex = '/transportCron\.php/';
|
$old_regex = '/transportCron\.php/';
|
||||||
echo " * Uninstalling cron job...";
|
echo " * Uninstalling cron job...";
|
||||||
|
|
||||||
|
@ -205,13 +211,11 @@ foreach ($cron->ct->getByType(CRON_CMD) as $id => $line) {
|
||||||
}
|
}
|
||||||
$cron->closeCrontab();
|
$cron->closeCrontab();
|
||||||
echo "done.\n";
|
echo "done.\n";
|
||||||
|
*/
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
// Delete files
|
// Delete files
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
camp_uninstall_delete_files($CC_CONFIG['storageDir']);
|
airtime_uninstall_delete_files($CC_CONFIG['storageDir']);
|
||||||
camp_uninstall_delete_files($CC_CONFIG['transDir']);
|
|
||||||
camp_uninstall_delete_files($CC_CONFIG['accessDir']);
|
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue