Example #1
0
 function _update()
 {
     $version = freemed::module_version($this->MODULE_NAME);
     // Version 0.2
     //
     //	Migrated to separate table
     //
     if (!version_check($version, '0.2')) {
         // Create table
         $GLOBALS['sql']->query($GLOBALS['sql']->create_table_query($this->table_name, $this->table_definition, array('id')));
         // Migrate old entries
         $q = $GLOBALS['sql']->queryAll('SELECT ptproblems,id FROM patient WHERE LENGTH(ptproblems) > 3');
         foreach ($q as $r) {
             $e = sql_expand($r['ptproblems']);
             if (!is_array($e)) {
                 $e = array($e);
             }
             foreach ($e as $a) {
                 $GLOBALS['sql']->query($GLOBALS['sql']->insert_query($this->table_name, array('ppatient' => $r['id'], 'problem' => $a)));
                 // end query
             }
             // end foreach $e
         }
         // end while
     }
 }
Example #2
0
 private function _cron()
 {
     $this->benchmark->mark('cron_start');
     // If it hasn't ran since yesterday
     if ($this->settings->get_setting('script_last_cron') < strtotime("-1 day")) {
         if (!defined('NO_VERSION_CHECK')) {
             $this->load->helper('version');
             $this->settings->edit_setting('script_latest', version_check());
         }
         // Call any events that use cron
         $this->events->trigger('cron');
         // Set the last_cron to now.
         $this->settings->edit_setting('script_last_cron', time());
     }
     $this->benchmark->mark('cron_end');
 }
Example #3
0
 function _update()
 {
     $version = freemed::module_version($this->MODULE_NAME);
     // Version 0.7.1
     //
     //	Add ability to track events by payment record (clpayrec)
     //
     if (!version_check($version, '0.7.1')) {
         $GLOBALS['sql']->query('ALTER TABLE ' . $this->table_name . ' ' . 'ADD COLUMN clpayrec INT UNSIGNED AFTER clprocedure');
         // Set to 0 by default (not associated with any payrec)
         $GLOBALS['sql']->query('UPDATE ' . $this->table_name . ' ' . 'SET clpayrec=\'0\'');
     }
     // Version 0.7.2
     //
     //	Force table creation, due to messed up older version
     //
     if (!version_check($version, '0.8.2')) {
         $this->create_table();
     }
 }
Example #4
0
     if (api_is_global_platform_admin() && $url_id == 1) {
         if (isset($_GET['id']) && !empty($_GET['id'])) {
             $params = array('variable = ? ' => array($_GET['id']));
             $data = api_get_settings_params($params);
             if (!empty($data)) {
                 foreach ($data as $item) {
                     $params = array('id' => $item['id'], 'access_url_changeable' => $_GET['changeable']);
                     api_set_setting_simple($params);
                 }
             }
             echo '1';
         }
     }
     break;
 case 'version':
     echo version_check();
     break;
 case 'get_extra_content':
     $blockName = isset($_POST['block']) ? Security::remove_XSS($_POST['block']) : null;
     if (empty($blockName)) {
         die;
     }
     if (api_is_multiple_url_enabled()) {
         $accessUrlId = api_get_current_access_url_id();
         if ($accessUrlId == -1) {
             die;
         }
         $urlInfo = api_get_access_url($accessUrlId);
         $url = api_remove_trailing_slash(preg_replace('/https?:\\/\\//i', '', $urlInfo['url']));
         $cleanUrl = str_replace('/', '-', $url);
         $newUrlDir = api_get_path(SYS_APP_PATH) . "home/{$cleanUrl}/admin/";
 function _update()
 {
     $version = freemed::module_version($this->MODULE_NAME);
     // Version 0.1.1
     //
     //	Add colors
     //
     if (!version_check($version, '0.1.1')) {
         $GLOBALS['sql']->query('ALTER TABLE ' . $this->table_name . ' ' . 'ADD COLUMN atcolor CHAR(7) AFTER atequipment');
         $GLOBALS['sql']->query('UPDATE ' . $this->table_name . ' ' . 'SET atcolor=\'\' WHERE id>0');
     }
     // end version 0.1.1
 }
Example #6
0
<?php

function version_check($vercheck)
{
    $minver = str_replace(".", "", $vercheck);
    $curver = str_replace(".", "", phpversion());
    if ($curver >= $minver) {
        return true;
    } else {
        die("PHP version " . $vercheck . " or greater is required to run aMember. Your PHP-Version is : " . phpversion() . "<br>Please upgrade or ask your hosting to upgrade. PHP before {$vercheck} was buggy and vunerable.");
    }
}
version_check('4.1.0');
// if version not ok the script stopped and displays an errormsg
if (!function_exists('mysql_connect')) {
    die("PHP on your webhosting has been compiled without MySQL support.<br>\n        so aMember cannot be installed to your hosting, please contact your<br>\n        hosting support to fix this problem.");
}
error_reporting(E_ALL ^ E_NOTICE);
ini_set("magic_quotes_runtime", 0);
// set_magic_quotes_runtime(0);
ini_set('display_errors', 1);
/***************************************************************************
*     Author: Alex Scott
*      Email: alex@cgi-central.net
*        Web: http://www.cgi-central.net
*    Details: The installation file
*    FileName $RCSfile$
*    Release: 3.2.3PRO ($Revision: 5392 $)
*
* Please direct bug reports,suggestions or feedback to the cgi-central forums.
* http://www.cgi-central.net/forum/
// There are NO database structure or data updates for version 1.3.2.0
// USE THIS FUNCTION ONLY IF THERE ARE *NOT* ANY DB TABLE OR DATA UPDATES
// OTHERWISE, DEFINE/UPDATE THE VERSION VIA THE UPDATE PROCEDURE
include INCLUDES . 'version.inc.php';
function version_check($version)
{
    require CONFIG . 'config.php';
    mysql_select_db($database, $brewing);
    if ($version != $current_version) {
        $updateSQL = sprintf("UPDATE %s SET version='%s', version_date='%s' WHERE id='%s'", $prefix . "system", "1.3.2.0", "2015-10-31", "1");
        mysql_select_db($database, $brewing);
        $result1 = mysql_query($updateSQL, $brewing) or die(mysql_error());
    }
}
if (!HOSTED && strpos($section, 'step') === FALSE) {
    version_check($version);
}
// ---------------------------------------------------
function in_string($haystack, $needle)
{
    if (strpos($haystack, $needle) !== false) {
        return TRUE;
    }
}
function designations($judge_array, $display)
{
    $return = "";
    $rank1 = explode(",", $judge_array);
    foreach ($rank1 as $rank2) {
        if ($rank2 != $display) {
            $return .= "<br />" . $rank2 . "";
Example #8
0
function parse_options()
{
    global $html_out, $config_values;
    $filler = "<br>";
    array_keys($_GET);
    $commands = array_keys($_GET);
    if (empty($commands)) {
        return FALSE;
    }
    if (preg_match("/^\\//", $commands[0])) {
        $commands[0] = preg_replace("/^\\//", '', $commands[0]);
    }
    switch ($commands[0]) {
        case 'getClientData':
            if ($_REQUEST['recent']) {
                $response = getClientData(1);
            } else {
                $response = getClientData(0);
            }
            echo $response;
            exit;
        case 'delTorrent':
            $response = delTorrent($_REQUEST['delTorrent'], $_REQUEST['trash'], $_REQUEST['batch']);
            echo "{$response}";
            exit;
        case 'stopTorrent':
            $response = stopTorrent($_REQUEST['stopTorrent'], $_REQUEST['batch']);
            echo "{$response}";
            exit;
        case 'startTorrent':
            $response = startTorrent($_REQUEST['startTorrent'], $_REQUEST['batch']);
            echo "{$response}";
            exit;
        case 'moveTo':
            $response = moveTorrent($_REQUEST['moveTo'], $_REQUEST['torHash'], $_REQUEST['batch']);
            echo "{$response}";
            exit;
        case 'updateFavorite':
            $response = update_favorite();
            if (preg_match("/^Error:", $response)) {
                echo "<div id=\"fav_error\" class=\"dialog_window\" style=\"display: block\">{$response}</div>";
            }
            break;
        case 'updateFeed':
            update_feed();
            break;
        case 'clearCache':
            clear_cache();
            break;
        case 'setGlobals':
            update_global_config();
            write_config_file();
            break;
        case 'matchTitle':
            $feedLink = $_GET['rss'];
            foreach ($config_values['Feeds'] as $key => $feed) {
                if ($feed['Link'] == "{$feedLink}") {
                    $idx = $key;
                }
            }
            if ($config_values['Feeds'][$idx]['seedRatio']) {
                $seedRatio = $config_values['Feeds'][$idx]['seedRatio'];
            } else {
                $seedRatio = $config_values['Settings']['Default Seed Ratio'];
            }
            if (!$seedRatio) {
                $seedRatio = -1;
            }
            if ($tmp = guess_match(html_entity_decode($_GET['title']), TRUE)) {
                $_GET['name'] = trim(strtr($tmp['key'], "._", "  "));
                if ($config_values['Settings']['MatchStyle'] == "glob") {
                    $_GET['filter'] = trim(strtr($tmp['key'], " ._", "???"));
                    $_GET['filter'] .= '*';
                } else {
                    $_GET['filter'] = trim($tmp['key']);
                }
                $_GET['quality'] = $tmp['data'];
                $_GET['feed'] = $_GET['rss'];
                $_GET['button'] = 'Add';
                $_GET['savein'] = 'Default';
                $_GET['seedratio'] = $seedRatio;
            } else {
                $_GET['name'] = $_GET['title'];
                $_GET['filter'] = $_GET['title'];
                $_GET['quality'] = 'All';
                $_GET['feed'] = $_GET['rss'];
                $_GET['button'] = 'Add';
                $_GET['savein'] = 'Default';
                $_GET['seedratio'] = $seedRatio;
            }
            if ($config_values['Settings']['Default Feed All'] && preg_match('/^(\\d+)x(\\d+)p?$|^(\\d{8})$/i', $tmp['episode'])) {
                $_GET['feed'] = 'All';
            }
            $response = update_favorite();
            if ($response) {
                echo "{$response}";
            }
            //break;
            exit;
        case 'hide':
            $response = add_hidden(ucwords($_GET['hide']));
            if ($response) {
                echo "ERROR:{$response}";
            } else {
                $guess = guess_match(html_entity_decode($_GET['hide']), TRUE);
                echo $guess['key'];
            }
            exit;
        case 'delHidden':
            del_hidden($_GET['unhide']);
            break;
        case 'dlTorrent':
            // Loaded via ajax
            foreach ($config_values['Favorites'] as $fav) {
                $guess = guess_match(html_entity_decode($_GET['title']));
                $name = trim(strtr($guess['key'], "._", "  "));
                if ($name == $fav['Name']) {
                    $downloadDir = $fav['Save In'];
                }
            }
            if ((!isset($downloadDir) || $downloadDir == "Default") && isset($config_values['Settings']['Download Dir'])) {
                $downloadDir = $config_values['Settings']['Download Dir'];
            }
            $r = client_add_torrent(preg_replace('/ /', '%20', trim($_GET['link'])), $downloadDir, $_GET['title'], $_GET['feed']);
            if ($r == "Success") {
                $torHash = get_torHash(add_cache($_GET['title']));
            }
            if (isset($torHash)) {
                echo $torHash;
            } else {
                echo $r;
            }
            exit(0);
            break;
        case 'clearHistory':
            // Loaded via ajax
            if (file_exists($config_values['Settings']['History'])) {
                unlink($config_values['Settings']['History']);
            }
            display_history();
            close_html();
            exit(0);
            break;
        case 'get_client':
            global $config_values;
            echo $config_values['Settings']['Client'];
            exit;
        case 'version_check':
            echo version_check();
            exit;
        case 'post_bug':
            global $tw_version;
            $response = post_bug($_POST['Summary'], $_POST['Name'], $_POST['Email'], $_POST['Priority'], $_POST['Description']);
            echo $response;
            exit;
        case 'get_dialog_data':
            switch ($_GET['get_dialog_data']) {
                case '#favorites':
                    display_favorites();
                    exit;
                case '#configuration':
                    display_global_config();
                    exit;
                case '#hidelist':
                    display_hidelist();
                    exit;
                case '#feeds':
                    display_feeds();
                    exit;
                case '#history':
                    display_history();
                    exit;
                case '#show_legend':
                    display_legend();
                    exit;
                case '#report_bug':
                    report_bug();
                    exit;
                case '#clear_cache':
                    display_clearCache();
                    exit;
                case '#show_transmission':
                    display_transmission();
                    exit;
                case '#show_info':
                    show_info(urldecode($_GET['episode_name']));
                    exit;
                default:
                    exit;
            }
        default:
            $output = "<script type='text/javascript'>alert('Bad Paramaters passed to " . $_SERVER['PHP_SELF'] . ":  " . $_SERVER['REQUEST_URI'] . "');</script>";
    }
    if (isset($exec)) {
        exec($exec, $output);
    }
    if (isset($output)) {
        if (is_array($output)) {
            $output = implode($filler, $output);
        }
        $html_out .= str_replace("\n", "<br>", "<div class='execoutput'>{$output}</div>");
        echo $html_out;
        $html_out = "";
    }
    return;
}
Example #9
0
     if (!version_check($oper, $zencart_version, $require_zencart_version)) {
         $error_message .= sprintf(ERROR_VERSION, $filename, $modules[$find]['require_zen_cart_version'], $modules[$find]['require_addon_modules_version']);
     }
 }
 // addonコアのバージョンチェック
 if ($error_message == "") {
     $addon_version = $GLOBALS['addon_modules']->version;
     if ($addon_version == "") {
         $addon_version = "1.0.0.0";
     }
     preg_match("/^([0-9.]+).*\$/", $addon_version, $adoon_version);
     preg_match("/^(.*?)([0-9.]+).*\$/", $modules[$find]['require_addon_modules_version'], $require_adoon_version);
     $oper = trim($require_adoon_version[1]);
     $adoon_version = explode(".", $adoon_version[1]);
     $require_adoon_version = explode(".", $require_adoon_version[2]);
     if (!version_check($oper, $adoon_version, $require_adoon_version)) {
         $error_message .= sprintf(ERROR_VERSION, $filename, $modules[$find]['require_zen_cart_version'], $modules[$find]['require_addon_modules_version']);
     }
 }
 // エラーが無い場合のみダウンロード処理を行う
 if ($error_message == "") {
     // 一時ファイルに保存
     $archive = @file_get_contents($distribute . "/" . $filename . ".tar");
     if ($archive === false) {
         $error_message .= sprintf(ERROR_CANNOT_DOWNLOAD, $filename);
     }
 }
 if ($error_message == "") {
     $tempfile = tempnam("/tmp", "download_");
     $temp = fopen($tempfile, "w");
     fwrite($temp, $archive);
Example #10
0
 function _update()
 {
     global $sql;
     $version = freemed::module_version($this->MODULE_NAME);
     // Version 0.3
     //
     //	Added medicaid resubmission and reference codes
     //	Added outside lab charges
     //
     if (!version_check($version, '0.3')) {
         $sql->query('ALTER TABLE ' . $this->table_name . ' ' . 'ADD COLUMN procmedicaidref VARCHAR(20) AFTER procclmtp');
         $sql->query('ALTER TABLE ' . $this->table_name . ' ' . 'ADD COLUMN procmedicaidresub VARCHAR(20) AFTER procmedicaidref');
         $sql->query('ALTER TABLE ' . $this->table_name . ' ' . 'ADD COLUMN proclabcharges REAL AFTER procmedicaidresub');
     }
     // Version 0.4
     //
     //	Added procedure status (procstatus)
     //
     if (!version_check($version, '0.4')) {
         $sql->query('ALTER TABLE ' . $this->table_name . ' ' . 'ADD COLUMN procstatus INT UNSIGNED AFTER proclabcharges');
     }
     // Version 0.4.1
     //
     //	procstatus is now a varchar(50)
     //
     if (!version_check($version, '0.4.1')) {
         $sql->query('ALTER TABLE ' . $this->table_name . ' ' . 'CHANGE COLUMN procstatus ' . 'procstatus VARCHAR(50)');
     }
     // Version 0.4.2
     //
     //	add procslidingscale
     //
     if (!version_check($version, '0.4.2')) {
         $sql->query('ALTER TABLE ' . $this->table_name . ' ADD COLUMN procslidingscale CHAR(1)');
         $sql->query('UPDATE ' . $this->table_name . ' SET procslidingscale=\'\' WHERE id>0');
     }
     // Version 0.4.3
     //
     //	add proctosoverride
     //
     if (!version_check($version, '0.4.3')) {
         $sql->query('ALTER TABLE ' . $this->table_name . ' ADD COLUMN proctosoverride INT UNSIGNED AFTER procslidingscale');
         $sql->query('UPDATE ' . $this->table_name . ' SET proctosoverride=0 WHERE id>0');
     }
     // Version 0.5.0
     //
     //	add proccptmod{2,3}
     //
     if (!version_check($version, '0.5.0')) {
         $sql->query('ALTER TABLE ' . $this->table_name . ' ADD COLUMN proccptmod2 INT UNSIGNED AFTER proccptmod');
         $sql->query('ALTER TABLE ' . $this->table_name . ' ADD COLUMN proccptmod3 INT UNSIGNED AFTER proccptmod2');
         $sql->query('UPDATE ' . $this->table_name . ' SET proccptmod2=0,proccptmod3=0 WHERE id>0');
     }
 }
 function _update()
 {
     $version = freemed::module_version($this->MODULE_NAME);
     // Version 0.3
     //
     //	Move phyidmap to be mapped in insco table (inscoidmap)
     //
     if (!version_check($version, '0.3')) {
         $GLOBALS['sql']->query('ALTER TABLE ' . $this->table_name . ' ' . 'ADD COLUMN inscoidmap TEXT AFTER inscomod');
     }
     // Version 0.3.1
     //
     //	Add inscodefformat and inscodeftarget mappings
     //
     if (!version_check($version, '0.3.4.1')) {
         $GLOBALS['sql']->query('ALTER TABLE ' . $this->table_name . ' ' . 'ADD COLUMN inscodefformat VARCHAR(50) AFTER inscoidmap');
         $GLOBALS['sql']->query('ALTER TABLE ' . $this->table_name . ' ' . 'ADD COLUMN inscodeftarget VARCHAR(50) AFTER inscodefformat');
         $GLOBALS['sql']->query('ALTER TABLE ' . $this->table_name . ' ' . 'ADD COLUMN inscodefformate VARCHAR(50) AFTER inscodeftarget');
         $GLOBALS['sql']->query('ALTER TABLE ' . $this->table_name . ' ' . 'ADD COLUMN inscodeftargete VARCHAR(50) AFTER inscodefformatE');
     }
     // Version 0.3.3 (Actual update from old module name - HACK)
     //
     //	Add inscodef{format,target}e for electronic mappings
     //
     if ($GLOBALS['sql']->results($GLOBALS['sql']->query("SELECT * FROM module WHERE module_name='Insurance Company Maintenance'"))) {
         // Remove stale entry
         $GLOBALS['sql']->query('DELETE FROM module WHERE ' . 'module_name=\'Insurance Company Maintenance\'');
         // Make changes
         $GLOBALS['sql']->query('ALTER TABLE ' . $this->table_name . ' ' . 'ADD COLUMN inscodefformat VARCHAR(50) AFTER inscoidmap');
         $GLOBALS['sql']->query('ALTER TABLE ' . $this->table_name . ' ' . 'ADD COLUMN inscodeftarget VARCHAR(50) AFTER inscodefformat');
         $GLOBALS['sql']->query('ALTER TABLE ' . $this->table_name . ' ' . 'ADD COLUMN inscodefformate VARCHAR(50) AFTER inscodeftarget');
         $GLOBALS['sql']->query('ALTER TABLE ' . $this->table_name . ' ' . 'ADD COLUMN inscodeftargete VARCHAR(50) AFTER inscodefformate');
     }
     // Version 0.4
     //
     //	Add inscox12id for 837p/remitt
     //
     if (!version_check($version, '0.4')) {
         $GLOBALS['sql']->query('ALTER TABLE ' . $this->table_name . ' ' . 'ADD COLUMN inscox12id VARCHAR(32) AFTER inscoidmap');
         $GLOBALS['sql']->query('UPDATE ' . $this->table_name . ' SET inscox12id=\'\' WHERE id>0');
     }
     // Version 0.4.1
     //
     //	Add inscodefoutput for remitt
     //
     if (!version_check($version, '0.4.1')) {
         $GLOBALS['sql']->query('ALTER TABLE ' . $this->table_name . ' ' . 'ADD COLUMN inscodefoutput ENUM(\'electronic\', \'paper\') AFTER inscox12id');
         $GLOBALS['sql']->query('UPDATE ' . $this->table_name . ' SET inscodefoutput=\'electronic\' WHERE id>0');
     }
 }
Example #12
0
             $newname_arr = $_GET['newname'][0];
             $neworder_arr = $_GET['neworder'][0];
             $pick_setarr = $_GET['pick_setarr'];
             foreach ((array) $pick_setarr as $k => $v) {
                 DB::update('strayer_picker', array('displayorder' => $v['displayorder']), array('pid' => $k));
             }
             foreach ((array) $cate_setarr as $k => $v) {
                 DB::update('strayer_category', $v, array('cid' => $k));
             }
             foreach ((array) $neworder_arr as $k => $v) {
                 DB::insert('strayer_category', array('name' => $newname_arr[$k], 'displayorder' => $v), TRUE);
             }
         }
         cpmsg(milu_lang('op_success'), PICK_GO . "picker_manage", 'succeed');
     }
     $info['tips'] = version_check();
     include template('milu_pick:picker_list');
     break;
 case 'edit_pick':
     include_once libfile('function/portalcp');
     require_once libfile('function/forumlist');
     pload('F:rules');
     $info = get_pick_info();
     //2.5版本
     $step = $_GET['step'];
     if (!$step) {
         $step = 1;
     }
     $info = show_pick_format($info);
     if (!$info['manyou_max_level']) {
         $info['manyou_max_level'] = 2;
Example #13
0
<?php

// $Id: functions.php,v 1.5 2002/02/15 23:31:43 waldb Exp $
include "global.inc";
define('PACKAGE_NAME', "WebVCR");
define('REQUIRE_WEBTOOLS', "0.2.3");
if (!defined("WEBTOOLS_VERSION") or !version_check(WEBTOOLS_VERSION, REQUIRE_WEBTOOLS)) {
    die(PACKAGE_NAME . " requires phpwebtools >= " . REQUIRE_WEBTOOLS);
}
include_once "lib/module.php";
include_once "lib/module_collector.php";
###############################################################################
# Change this!!!
###############################################################################
$sql = new sql(SQL_MYSQL, $sql_host, $sql_user, $sql_pass, $sql_db);
############### DO NOT CHANGE BELOW THIS ######################################
function addCollector($name, $mainurl, $baseurl)
{
    global $sql;
    $result = $sql->query("SELECT collectorid FROM collector " . "WHERE name='" . addslashes($name) . "'");
    if (!$sql->results($result)) {
        $result = $sql->query($sql->insert_query("collector", array("name" => $name, "mainurl" => $mainurl, "baseurl" => $baseurl)));
    }
    // end checking if we already have an entry
    return true;
}
// end function getcollectorid
function getstation($number)
{
    global $sql;
    $result = $sql->query("SELECT * FROM station " . "WHERE sid='" . addslashes($number) . "'");
// If are NO database structure or data updates for the current version,
// USE THIS FUNCTION ONLY IF THERE ARE *NOT* ANY DB TABLE OR DATA UPDATES
// OTHERWISE, DEFINE/UPDATE THE VERSION VIA THE UPDATE PROCEDURE
include INCLUDES . 'version.inc.php';
function version_check($version, $current_version)
{
    require CONFIG . 'config.php';
    mysql_select_db($database, $brewing);
    if ($version != $current_version) {
        $updateSQL = sprintf("UPDATE %s SET version='%s', version_date='%s' WHERE id='%s'", $prefix . "system", "2.0.1.0", "2016-02-15", "1");
        mysql_select_db($database, $brewing);
        $result1 = mysql_query($updateSQL, $brewing) or die(mysql_error());
    }
}
if (!HOSTED && strpos($section, 'step') === FALSE) {
    version_check($version, $current_version);
}
// ---------------------------------------------------
function in_string($haystack, $needle)
{
    if (strpos($haystack, $needle) !== false) {
        return TRUE;
    }
}
function designations($judge_array, $display)
{
    $return = "";
    $rank1 = explode(",", $judge_array);
    foreach ($rank1 as $rank2) {
        if ($rank2 != $display) {
            $return .= "<br />" . $rank2 . "";
Example #15
0
                if (is_null($error)) {
                    print "ok\n";
                } else {
                    print "failed: {$error}\n";
                }
            }
        }
    }
    closedir($dir);
}
// ===========================================================================
// set up and purify the environment
define("DEBUG", true);
define("VERSION", 'trunk');
require_once "core/util.inc.php";
version_check();
sanitise_environment();
check_cli();
// load base files
$files = array_merge(glob("core/*.php"), glob("ext/*/main.php"));
foreach ($files as $filename) {
    require_once $filename;
}
// connect to database
$database = new Database();
$database->db->fnExecute = '_count_execs';
$config = new Config($database);
// load the theme parts
$_theme = $config->get_string("theme", "default");
if (!file_exists("themes/{$_theme}")) {
    $_theme = "default";