LOAD_TEMPLATE("redirect_url", false, str_replace("&", "&", $URL));
LOAD_INC("inc/footer.php");
}
- exit;
+ shutdown();
}
// Wrapper for LOAD_URL but URL comes from a configuration entry
$request = "GET /" . trim($script) . " HTTP/1.1\r\n";
$request .= "Host: " . $host . "\r\n";
$request .= "Referer: " . constant('URL') . "/admin.php\r\n";
- $request .= "User-Agent: " . constant('TITLE') . "/" . constant('FULL_VERSION') . "\r\n";
+ if (defined('FULL_VERSION')) {
+ $request .= "User-Agent: " . constant('TITLE') . "/" . constant('FULL_VERSION') . "\r\n";
+ } else {
+ $request .= "User-Agent: " . constant('TITLE') . "/?.?.?\r\n";
+ }
$request .= "Content-Type: text/plain\r\n";
$request .= "Cache-Control: no-cache\r\n";
$request .= "Connection: Close\r\n\r\n";
LOAD_INC_ONCE("inc/footer.php");
// Exit explicitly
- exit;
+ shutdown();
}
// Display parsing time and number of SQL queries in footer
}
// Function to search for the last modifikated file
-function searchDirsRecoursive($dir, &$last_changed) {
+function searchDirsRecoursive ($dir, &$last_changed) {
$ds = scandir($dir); // Needs adjustment for PHP < 5.0.0!!
foreach ($ds as $d) {
$f_name = $dir.'/'.$d; // makes a proper Filename
}
}
}
-function getSearchFor()
-{
+
+function getSearchFor () {
$searchFor[] = 'Revision';
$searchFor[] = 'Date';
$searchFor[] = 'Tag';
$searchFor[] = 'Author';
return $searchFor;
-
}
-
-function getAkt_vers()
-{
+function getAkt_vers () {
$next_dir = '.';
$last_changed['path_name'] = '';
$last_changed['time'] = 0;
// Check wether we are installing
function isInstalling () {
- return (isset($GLOBALS['mxchange_installing']));
+ $installing = ((isset($GLOBALS['mxchange_installing'])) || (REQUEST_ISSET_GET('installing')));
+ //* DEBUG: */ var_dump($installing);
+ return $installing;
}
// Check wether this script is installed
return ((isset($GLOBALS['cache_instance'])) && (is_object($GLOBALS['cache_instance'])));
}
+// Our shutdown-function
+function shutdown () {
+ // Call the filter chain 'shutdown'
+ runFilterChain('shutdown', null, false);
+
+ if (SQL_IS_LINK_UP()) {
+ // Close link
+ SQL_CLOSE(__FILE__, __LINE__);
+ } elseif (!isInstalling()) {
+ // No database link
+ addFatalMessage(__FILE__, __LINE__, getMessage('NO_DB_LINK_SHUTDOWN'));
+ }
+
+ // Stop executing here
+ exit;
+}
+
//////////////////////////////////////////////////
// AUTOMATICALLY RE-GENERATED MISSING FUNCTIONS //
//////////////////////////////////////////////////