Source for file glassemblyline.php
Documentation is available at glassemblyline.php
* GloryLands Assembly Line
* GloryLands, a Web-Based, Massive Multiplayer Online RPG/Strategy Game
* Copyright (C) 2008-09 John Haralampidis <jïhnys2[at]gmail.cïm>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* For any help/suggestions or troubleshooting you can see the
* project community website at <http://www.glorylands.gr>
* @license GNU/GPLv3 GNU General Public License version 3
* @author John Haralampidis <jïhnys2[at]gmail.cïm>
* @copyright Copyright (C) 2007-2009, John Haralampidis
* This flag means that the request is root-type.
* Root-type request means that the PHP-JS objects will be rebuilt
* and the content will be resynced.
* The reply is an HTML document with the desired layout that
* contans the syncronization script.
* This flag means that the request is external.
* An external request is performed when the browser wants to run a module action
* that does not require a DOM structure.
* The reply is an HTML document with the desired layout that
* contans the response data of the executed script.
* This flag means that the request is made from GLOO JS API.
* Theese requests, that are performed by the GL.call() function, do not
* destroy the PHP-side of the DOM. This means that all the classes that
* were instanced (and utilized the JS that made this request) are still availab.e
* The reply format depends on the X-GLOO-API value, and it varies between
* a JSON-Encoded variable dump, an XML document, a url-encoded request or
* an other form, defined and handled by interrupts.
* However, each data reply contains:
* - The elementary stream that contains the response to the call
* - The secondary stram that holds all the queued requests/updates to the interface.
* GloryLands Assembly Line
* The active stream that handles the request
* A Server-independant function to get the request headers
* @return array The headers in key-name - value format
static private function get_headers() {
foreach ($_SERVER as $k => $v) {
if (substr($k, 0, 5) == "HTTP_") {
static private function get_processing_stream() {
foreach (self::$streams as $stream) {
if ($stream->is_valid()) {
* Initialize the assembly line
self::$headers = self::get_headers();
while ($plugin = $exts->next()) {
include_once(GLConfig::$root->file($plugin->file));
$stream = $plugin->class;
$s = new $stream(self::$headers, $_GET,$_POST);
// Fetch and initialize active stream
self::$stream = self::get_processing_stream();
self::$stream->initialize();
self::$stream->post_initialize();
self::$stream->process();
static public function render() {
return self::$stream->render();
self::$stream->finalize();
|