phpDocumentor GloryLands
System
[ class tree: GloryLands ] [ index: GloryLands ] [ all elements ]

Source for file gl.php

Documentation is available at gl.php

  1. <?php
  2. /**
  3.   * Basic system access
  4.   *
  5.   * <pre>
  6.   * GloryLands, a Web-Based, Massive Multiplayer Online RPG/Strategy Game
  7.   * Copyright (C) 2008-09  John Haralampidis <jïhnys2[at]gmail.cïm>
  8.   *
  9.   * This program is free software: you can redistribute it and/or modify
  10.   * it under the terms of the GNU General Public License as published by
  11.   * the Free Software Foundation, either version 3 of the License, or
  12.   * (at your option) any later version.
  13.   *
  14.   * This program is distributed in the hope that it will be useful,
  15.   * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16.   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17.   * GNU General Public License for more details.
  18.   *
  19.   * You should have received a copy of the GNU General Public License
  20.   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  21.   *
  22.   * For any help/suggestions or troubleshooting you can see the
  23.   * project community website at <http://www.glorylands.gr>
  24.   * </pre>
  25.   *
  26.   * @license GNU/GPLv3 GNU General Public License version 3
  27.   * @package GloryLands
  28.   * @subpackage System
  29.   * @author John Haralampidis <jïhnys2[at]gmail.cïm>
  30.   * @copyright Copyright (C) 2007-2009, John Haralampidis
  31.   * @version 1.0
  32.   */
  33.  
  34. /**
  35.   * Glorylands Core Namespace
  36.   *
  37.   * This static class provides the root management functions
  38.   * of the whole glorylands system.
  39.   *
  40.   * In order to run the game you should run:
  41.   *
  42.   *     GL::initialize();
  43.   *     GL::process();
  44.   *     GL::render();
  45.   * and GL::finalize();
  46.   *
  47.   * If you forget to call finalize, it will be called upon
  48.   * shutdown. Also, you don't need to call the initialize() function
  49.   * if you initialized the system with bootstrap.
  50.   *
  51.   * @subpackage System
  52.   * @version 1.0
  53.   */
  54. class GL {    
  55.  
  56.     /**
  57.       * A shortcut to the main project database (Configured by the db.php)
  58.       * @var DBJet 
  59.       */
  60.     static public $db;
  61.     
  62.     /**
  63.       * The response stream data buffer
  64.       * @var GLDataset 
  65.       */
  66.     static public $stream;
  67.  
  68.     /**
  69.       * Initialize glorylands
  70.       */    
  71.     static public function initialize({                    
  72.         
  73.         // Initialize extra modules                
  74.         GLConfig::initialize();
  75.         GLDB::Initialize();
  76.         GLConfig::initialize_dbconf();
  77.         GLCache::initialize();
  78.         GLOptimizer::initialize();        
  79.         GLAssemblyLine::initialize();
  80.         GLModules::initialize();
  81.         
  82.         // Start session
  83.         session_start();
  84.         
  85.         // Post-init of assembly line (After the session restoration)
  86.         GLAssemblyLine::post_initialize();
  87.     }
  88.  
  89.     static public function process({
  90.         GLAssemblyLine::process();
  91.     }
  92.     
  93.     static public function render({        
  94.         echo GLError::render();
  95.         echo GLAssemblyLine::render();
  96.     }
  97.     
  98.     static public function finalize({
  99.     
  100.         // Save PHP - JS link status
  101.         GLOOLink::save();
  102.         
  103.         // Shut down objects
  104.         GLAssemblyLine::finalize();
  105.     
  106.     }
  107.  
  108. }
  109.  
  110. ?>

Documentation generated on Tue, 13 Oct 2009 23:48:56 +0300 by phpDocumentor 1.4.1