query($sql)->fetchAll(); } catch (Exception $e) { $rows = array(); } foreach ($rows as $row) { $tablename = $row["tablename"]; echo " * Removing database table $tablename..."; if (AirtimeInstall::DbTableExists($tablename)) { $sql = "DROP TABLE $tablename CASCADE"; AirtimeInstall::InstallQuery($sql, false); AirtimeInstall::DropSequence($tablename."_id"); } echo "done.".PHP_EOL; } } } //------------------------------------------------------------------------ // Delete the user //------------------------------------------------------------------------ echo " * Deleting database user '{$CC_CONFIG['dsn']['username']}'...".PHP_EOL; $command = "echo \"DROP USER IF EXISTS {$CC_CONFIG['dsn']['username']}\" | su postgres -c psql >/dev/null 2>&1"; @exec($command, $output, $results); if ($results == 0) { echo " * User '{$CC_CONFIG['dsn']['username']}' deleted.".PHP_EOL; } else { echo " * Nothing to delete.".PHP_EOL; } //AirtimeInstall::RemoveSymlinks(); //AirtimeInstall::UninstallBinaries(); //AirtimeInstall::RemoveLogDirectories(); //AirtimeInstall::removeVirtualEnvDistributeFile(); //AirtimeIni::RemoveMonitFile(); //@unlink('/etc/cron.d/airtime-crons'); /* FINISHED AIRTIME PHP UNINSTALLER */