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

Source for file glstreamdef.php

Documentation is available at glstreamdef.php

  1. <?php
  2. /**
  3.   * Glorylands Stream Definitions
  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.   * Root Stream Structure
  36.   *
  37.   * In Glorylands, "streams" are core structures that provide
  38.   * the run-time environment for an action. This involves initialization
  39.   * of the environment, execution and rendering.
  40.   *
  41.   * In detail, each stream works in the following way:
  42.   * <ol>
  43.   *   <li>It initializes the data carrier that will hold all the response information till the render (Stored in GL::$stream).</li>
  44.   *   <li>It performs all the initializations that have to be done before the action is processed.</li>
  45.   *   <li>It runs the action.</li>
  46.   *   <li>It renders the result.</li>
  47.   *   <li>And finally, it finalizes the scripts before shutdown.</li>
  48.   * </ol>
  49.   *
  50.   * @subpackage System
  51.   * @version 1.0
  52.   */
  53. class GLStream {
  54.     
  55.     protected $headers;
  56.     protected $parameters;
  57.     protected $variables;
  58.  
  59.     /**
  60.       * Check if this stream is valid for handling this action
  61.       */
  62.     public function is_valid({
  63.         return false;
  64.     }
  65.  
  66.     /**
  67.       * Initialize the stream, passing the already initialized headers
  68.       */    
  69.     public function __construct(&$headers,$parameters,$variables{
  70.         $this->headers = $headers;
  71.         $this->parameters = $parameters;
  72.         $this->variables = $variables;
  73.     }
  74.  
  75.     /**
  76.       * Called right before the main initialization.
  77.       */    
  78.     public function pre_initialize({
  79.     }
  80.  
  81.     /**
  82.       * Called when the request is ready to be
  83.       * processed.
  84.       */    
  85.     public function initialize({    
  86.     }
  87.     
  88.     /**
  89.       * Called after the main initialization.
  90.       */    
  91.     public function post_initialize({
  92.     }
  93.     
  94.     /**
  95.       * Do the actual processing
  96.       */    
  97.     public function process({
  98.     }
  99.     
  100.     /**
  101.       * Render the result
  102.       */    
  103.     public function render({
  104.         return '';
  105.     }
  106.  
  107.     /**
  108.       * Finalize the stream
  109.       */    
  110.     public function finalize({
  111.     }
  112.  
  113. }
  114.  
  115. ?>

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