Exemplo n.º 1
0
if (isset($_GET['direct'])) {

    // Set direct request mode
    Zend_Registry::set("DirectRequest", true);

    // Bootstrap and execute Ext.Direct stack dispatcher
    $application->bootstrap();
    
    $session = Zend_Registry::get('Session');

    require_once BASE_PATH . '/thirdparty/ExtDirect/API.php';
    require_once BASE_PATH . '/thirdparty/ExtDirect/Router.php';
    require_once BASE_PATH . '/thirdparty/ExtDirect/CacheProvider.php';
    require_once 'Extzf/ExtDirect/Router.php';

    $api = new ExtDirect_API();

    if (isset($session->extDirectState)) {
        $api->setState($session->extDirectState);
    }

    // Initialize translation etc. module based
    // This would normally happen in Bootstrap,
    // but since bootstrap has already been executed
    // and we know the requested module after $router
    // has been instanciated, this goes here.
    $rawPostData = file_get_contents("php://input");
    if (sizeof($rawPostData) > 0) {

        // Custom implemented high-performance call stack
        $request = json_decode($rawPostData);
Exemplo n.º 2
0
<?php

@session_start();
require_once 'includes/config.php';
require_once 'includes/ExtDirect/API.php';
require_once 'includes/ExtDirect/CacheProvider.php';
$cache = new ExtDirect_CacheProvider('cache/api_cache.txt');
$api = new ExtDirect_API();
$api->setRouterUrl('router.php');
// default
$api->setCacheProvider($cache);
$api->setNamespace('Ext.ss');
$api->setDescriptor('Ext.ss.APIDesc');
$api->setDefaults(array('autoInclude' => true, 'basePath' => 'includes/classes'));
$api->add(array('Projects', 'Files', 'Presets', 'Scan', 'ScanHistory', 'ScanTokens', 'ScanItems', 'ScanResults', 'Vulnerabilities', 'Tokens', 'ScanTokensTpl', 'Home', 'Installer'));
$api->output();
$_SESSION['ext-direct-state'] = $api->getState();
Exemplo n.º 3
0
<?php

@session_start();
require_once 'includes/config.php';
require_once 'includes/ExtDirect/API.php';
require_once 'includes/ExtDirect/Router.php';
require_once 'includes/DbSimple/Generic.php';
if (get_magic_quotes_gpc()) {
    $_POST = array_map('stripslashes', $_POST);
    $_COOKIE = array_map('stripslashes', $_COOKIE);
}
if (INSTALLED) {
    $db = DbSimple_Generic::connect(SYS_DSN);
}
// this should alwasy be set but if its not, then execute api.php without outputting it
if (!isset($_SESSION['ext-direct-state'])) {
    ob_start();
    include 'api.php';
    ob_end_clean();
}
$api = new ExtDirect_API();
$api->setState($_SESSION['ext-direct-state']);
$router = new ExtDirect_Router($api);
$router->dispatch();
$router->getResponse(true);
// true to print the response instantly
Exemplo n.º 4
0
<?php

require_once "config.php";
session_start();
// Include ExtDirect PHP Helpers
require_once 'ExtDirect/API.php';
require_once 'ExtDirect/CacheProvider.php';
// disable caching for development, enable for production
//$cache = new ExtDirect_CacheProvider('cache/api_cache.txt');
$api = new ExtDirect_API();
$api->setRouterUrl('router.php');
// default
// disable caching for development, enable for production
//$api->setCacheProvider($cache);
$api->setNamespace('Anopier');
$api->setDescriptor('Anopier.API');
$api->setDefaults(array('autoInclude' => true, 'basePath' => 'Anopier\\Controller'));
$api->add(array('User', 'PluginManager'));
$api->output();
$_SESSION['ext-direct-state'] = $api->getState();
// eof