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

Source for file glmodules.php

Documentation is available at glmodules.php

  1. <?php
  2. /**
  3.   * GloryLands Extendions System
  4.   * Basic module management functions
  5.   *
  6.   * <pre>
  7.   * GloryLands, a Web-Based, Massive Multiplayer Online RPG/Strategy Game
  8.   * Copyright (C) 2008-09  John Haralampidis <jïhnys2[at]gmail.cïm>
  9.   *
  10.   * This program is free software: you can redistribute it and/or modify
  11.   * it under the terms of the GNU General Public License as published by
  12.   * the Free Software Foundation, either version 3 of the License, or
  13.   * (at your option) any later version.
  14.   *
  15.   * This program is distributed in the hope that it will be useful,
  16.   * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17.   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18.   * GNU General Public License for more details.
  19.   *
  20.   * You should have received a copy of the GNU General Public License
  21.   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  22.   *
  23.   * For any help/suggestions or troubleshooting you can see the
  24.   * project community website at <http://www.glorylands.gr>
  25.   * </pre>
  26.   *
  27.   * @license GNU/GPLv3 GNU General Public License version 3
  28.   * @package GloryLands
  29.   * @subpackage Extensions
  30.   * @author John Haralampidis <jïhnys2[at]gmail.cïm>
  31.   * @copyright Copyright (C) 2007-2009, John Haralampidis
  32.   * @version 1.0
  33.   */
  34.  
  35. /**
  36.   * GloryLands extensions management clas
  37.   *
  38.   * This class provides access to basic module actions.
  39.   * Such as installation, registration etc.
  40.   *
  41.   * @subpackage Extensions
  42.   * @version 1.0
  43.   */
  44. class GLModules {
  45.  
  46.     static public $cache;
  47.     
  48.     static public function install($module{
  49.  
  50.     }
  51.  
  52.     static public function uninstall($module{
  53.  
  54.     }
  55.  
  56.     static public function register($module{
  57.         if (!self::$cacheself::$cache=array();
  58.         if (isset(self::$cache[$module])) {
  59.             return self::$cache[$module];
  60.         else {
  61.             return new GLModule($module);
  62.         }
  63.     }
  64.  
  65.     static public function get_module_for($class{
  66.         // Get the class name
  67.         $name get_class($class);
  68.         
  69.         // Detect the GLModule from stack
  70.         foreach (self::$cache as $module{
  71.             foreach ($module['classes'as $class{
  72.                 if ($class == $namereturn $module['object'];
  73.             }
  74.         }
  75.         
  76.         // Return false if not returned by now
  77.         return false;
  78.     }    
  79.  
  80.     static public function initialize({
  81.         $exts new GLDBOrderedConfig('extensions');
  82.         while ($plugin $exts->next()) {
  83.             GLModules::register($plugin->name);
  84.         }
  85.     }
  86.  
  87. }
  88.  
  89. ?>

Documentation generated on Tue, 13 Oct 2009 23:49:05 +0300 by phpDocumentor 1.4.1