More install cleanup - moved twitter installation files from /htmlUI/install
to /install. On uninstall, if the database doesnt delete (because there are users connected to it), then just delete every table just like it used to. Deleted conf_only.php.template - no longer needed.
This commit is contained in:
parent
0f6b98ce14
commit
2bc21da4b9
4 changed files with 131 additions and 223 deletions
37
install/uninstall_twitter_plugin.php
Normal file
37
install/uninstall_twitter_plugin.php
Normal file
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
// Do not allow remote execution
|
||||
$arr = array_diff_assoc($_SERVER, $_ENV);
|
||||
if (isset($arr["DOCUMENT_ROOT"]) && ($arr["DOCUMENT_ROOT"] != "") ) {
|
||||
header("HTTP/1.1 400");
|
||||
header("Content-type: text/plain; charset=UTF-8");
|
||||
echo "400 Not executable\r\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Uninstall twitter Cron job
|
||||
//------------------------------------------------------------------------
|
||||
<?php
|
||||
require_once(dirname(__FILE__).'/../../../storageServer/var/cron/Cron.php');
|
||||
$old_regex = '/ui_twitterCron\.php/';
|
||||
|
||||
$cron = new Cron();
|
||||
$access = $cron->openCrontab('write');
|
||||
if ($access != 'write') {
|
||||
do {
|
||||
$r = $cron->forceWriteable();
|
||||
} while ($r);
|
||||
}
|
||||
|
||||
foreach ($cron->ct->getByType(CRON_CMD) as $id => $line) {
|
||||
if (preg_match($old_regex, $line['command'])) {
|
||||
echo " removing cron entry\n";
|
||||
$cron->ct->delEntry($id);
|
||||
}
|
||||
}
|
||||
|
||||
$cron->closeCrontab();
|
||||
echo "Done.\n";
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue