b2evolution PHP Cross Reference Blogging Systems

Source: /inc/_init_db.inc.php - 96 lines - 3342 bytes - Text - Print

Description: This file initializes everything BUT the blog! It is useful when you want to do very customized templates! It is also called by more complete initializers.

   1  <?php
   2  // This is separated from init_base inc case we want to do a apage that does not connect to the database at all.
   3  // However, once we connect, we load everything we normally expect to be available from the DB.
   4  /**
   5   * This file initializes everything BUT the blog!
   6   *
   7   * It is useful when you want to do very customized templates!
   8   * It is also called by more complete initializers.
   9   *
  10   * This file is part of the evoCore framework - {@link http://evocore.net/}
  11   * See also {@link http://sourceforge.net/projects/evocms/}.
  12   *
  13   * @copyright (c)2003-2014 by Francois Planque - {@link http://fplanque.com/}
  14   * Parts of this file are copyright (c)2004-2006 by Daniel HAHLER - {@link http://thequod.de/contact}.
  15   * Parts of this file are copyright (c)2005-2006 by PROGIDISTRI - {@link http://progidistri.com/}.
  16   *
  17   * {@internal License choice
  18   * - If you have received this file as part of a package, please find the license.txt file in
  19   *   the same folder or the closest folder above for complete license terms.
  20   * - If you have received this file individually (e-g: from http://evocms.cvs.sourceforge.net/)
  21   *   then you must choose one of the following licenses before using the file:
  22   *   - GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php
  23   *   - Mozilla Public License 1.1 (MPL) - http://www.opensource.org/licenses/mozilla1.1.php
  24   * }}
  25   *
  26   * {@internal Open Source relicensing agreement:
  27   * Daniel HAHLER grants Francois PLANQUE the right to license
  28   * Daniel HAHLER's contributions to this file and the b2evolution project
  29   * under any OSI approved OSS license (http://www.opensource.org/licenses/).
  30   *
  31   * Matt FOLLETT grants Francois PLANQUE the right to license
  32   * Matt FOLLETT's contributions to this file and the b2evolution project
  33   * under any OSI approved OSS license (http://www.opensource.org/licenses/).
  34   * }}
  35   *
  36   * @package evocore
  37   *
  38   * {@internal Below is a list of authors who have contributed to design/coding of this file: }}
  39   * @author fplanque: Francois PLANQUE
  40   * @author blueyed: Daniel HAHLER
  41   * @author mfollett: Matt FOLLETT
  42   * @author mbruneau: Marc BRUNEAU / PROGIDISTRI
  43   *
  44   * @version $Id: _init_db.inc.php 6136 2014-03-08 07:59:48Z manuel $
  45   */
  46  if( !defined('EVO_CONFIG_LOADED') ) die( 'Please, do not access this page directly.' );
  47  
  48  $Timer->resume( '_init_db' );
  49  
  50  /**
  51   * Load DB class
  52   */
  53  require_once dirname(__FILE__).'/_core/model/db/_db.class.php';
  54  
  55  /**
  56   * Database connection (connection opened here)
  57   *
  58   * @global DB $DB
  59   */
  60  $DB = new DB( $db_config );
  61  
  62  
  63  /**
  64   * Load settings class
  65   */
  66  load_class( 'settings/model/_generalsettings.class.php', 'GeneralSettings' );
  67  /**
  68   * Interface to general settings
  69   *
  70   * Keep this below the creation of the {@link $DB DB object}, because it checks for the
  71   * correct db_version and catches "table does not exist" errors, providing a link to the
  72   * install script.
  73   *
  74   * @global GeneralSettings $Settings
  75   */
  76  $Settings = new GeneralSettings();
  77  
  78  
  79  $time_difference = $Settings->get('time_difference');
  80  
  81  /**
  82   * Corrected Unix timestamp to match server timezone
  83   * @global int $localtimenow
  84   */
  85  $localtimenow = $servertimenow + $time_difference;
  86  
  87  
  88  /**
  89   * @global AbstractSettings
  90   */
  91  $global_Cache = new AbstractSettings( 'T_global__cache', array( 'cach_name' ), 'cach_cache', 0 /* load all */ );
  92  
  93  
  94  $Timer->pause( '_init_db' );
  95  
  96  ?>

title

Description

title

Description

title

Description

title

title

Body