Ejemplo n.º 1
0
function sscall($args)
{
    $_GET = $args;
    $_REQUEST = $args;
    $_POST = $args;
    try {
        $server = Base_Server::singleton('server.ini', 'working/server.ini');
        $server->main();
    } catch (Exception $e) {
        echo 'Error: ' . $e->getMessage();
    }
}
Ejemplo n.º 2
0
function sscall($args)
{
    $_GET = $args;
    $_REQUEST = $args;
    $_POST = $args;
    ob_start();
    $server = Base_Server::singleton('server.ini', 'working/server.ini');
    $server->main();
    $result = ob_get_contents();
    ob_end_clean();
    return $result;
}
Ejemplo n.º 3
0
 public static function singleton($filename, $workingFilename)
 {
     $name = substr(basename($filename), 0, -4);
     $config = new Ini_Object($filename);
     if (!empty($config->server) && !empty($config->server['class'])) {
         $class = $config->server['class'];
     } else {
         $class = 'Server';
     }
     if (!isset(self::$instance)) {
         try {
             define('BASE_SERVER', strtolower($name));
             self::$instance = new $class($filename, $workingFilename);
         } catch (Exception $e) {
             $class = 'Server';
             self::$instance = new $class($filename, $workingFilename);
         }
     }
     return self::$instance;
 }
Ejemplo n.º 4
0
<?php

$dir = dirname(__FILE__);
require_once "{$dir}/library/base.php";
try {
    $server = Base_Server::singleton('server.ini', 'working/server.ini');
    $server->main();
} catch (Exception $e) {
    echo 'Error: ' . $e->getMessage();
}
// testing