Ignore:
Timestamp:
Feb 27, 2013, 10:12:48 PM (12 years ago)
Author:
chronos
Message:
  • Přidáno: Kontrola instalace z hlavního globálního skriptu.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Common/Global.php

    r491 r492  
    33$Revision =
    44
    5 $ConfigFileName = dirname(__FILE__).'/../config.php';
    65/* @var $System System */
    76$System = NULL;
     
    98$Database = NULL;
    109     
     10$ConfigFileName = dirname(__FILE__).'/../config.php';
    1111if(file_exists($ConfigFileName)) include_once($ConfigFileName);
    12   else die('Nenalezen konfigurační soubor '.$ConfigFileName.'!');
    1312include_once(dirname(__FILE__).'/Version.php');
     13include_once(dirname(__FILE__).'/Update.php');
    1414include_once(dirname(__FILE__).'/Module.php');
    1515include_once(dirname(__FILE__).'/AppModule.php');
     
    267267function GlobalInit()
    268268{
    269   global $Config, $Database, $System, $ScriptTimeStart, $ConfigFileName, $Mail, $Type;
     269  global $Config, $Database, $System, $ScriptTimeStart, $ConfigFileName, $Mail, $Type,
     270    $DatabaseRevision;
    270271 
    271272  date_default_timezone_set('Europe/Prague');
    272273  $ScriptTimeStart = GetMicrotime();
     274 
     275  if(!isset($Config)) die('Systém není nainstalován. Pokračujte v instalaci <a href="admin/install.php">zde</a>.');
     276 
     277   
    273278  // SQL injection hack protection
    274279  foreach($_POST as $Index => $Item) $_POST[$Index] = addslashes($Item);
     
    282287  $Database->ShowSQLError = $Config['Web']['ShowSQLError'];
    283288  $Database->ShowSQLQuery = $Config['Web']['ShowSQLQuery'];
     289 
     290  // Check database persistence structure
     291  $UpdateManager = new UpdateManager();
     292  $UpdateManager->Database = &$Database;
     293  $UpdateManager->Revision = $DatabaseRevision;
     294  if(!$UpdateManager->IsInstalled()) die('Systém vyžaduje instalaci databáze.');
     295  if(!$UpdateManager->IsUpToDate()) die('Systém vyžaduje aktualizaci databáze.');
    284296 
    285297  $System = new System();
Note: See TracChangeset for help on using the changeset viewer.