public function update($intFrom, $intTo) { if ($intFrom <= 0) { die("Invalid version, couldn't upgrade."); } if ($intTo <= 0) { die("Invalid version, couldn't upgrade."); } if ($intFrom > $intTo) { die("Database version newer than code version. Upgrade the code."); } for ($i = $intFrom; $i < $intTo; $i++) { if (isset($this->arrChanges[$i])) { foreach ($this->arrChanges[$i] as $strQuery) { clsDB::insertQuery($strQuery); } } clsSetting::set_by_name('DB_BUILD', $i + 1); } }
require_once 'include/constants.php'; require_once 'include/functions.php'; require_once 'include/messages.php'; require_once 'cls/clsAlbum.php'; require_once 'cls/clsBreadcrumbs.php'; require_once 'cls/clsDB.php'; require_once 'cls/clsMiniMenu.php'; require_once 'cls/clsPicture.php'; require_once 'cls/clsSetting.php'; require_once 'cls/clsTemplate.php'; require_once 'cls/clsUser.php'; ini_set('memory_limit', '256M'); ini_set('max_execution_time', '600'); session_start(); clsSetting::load_settings(); try { /* Update the DB if we need to. */ require_once 'include/upgrade.php'; $strAction = isset($_REQUEST['action']) ? $_REQUEST['action'] : ''; $strSubAction = isset($_REQUEST['subaction']) ? $_REQUEST['subaction'] : ''; $objBreadcrumbs = new clsBreadcrumbs(); $objBreadcrumbs->add('Home', 'index.php'); $objMiniMenu = new clsMiniMenu(); if (!isset($_SESSION['objUser'])) { $objUser = clsUser::getCookie(); } else { $objUser = $_SESSION['objUser']; } /* This re-loads the user object in case it's changed. */ if ($objUser) {