示例#1
0
 public function setUp()
 {
     $this->_server = new Zend_Amf_Server();
     $this->_server->setProduction(false);
     Zend_Amf_Parse_TypeLoader::resetMap();
     $this->_acl = new Zend_Acl();
 }
示例#2
0
文件: AuthTest.php 项目: stunti/zf2
 public function setUp()
 {
     $this->_server = new AMF\Server();
     $this->_server->setProduction(false);
     \Zend\AMF\Parser\TypeLoader::resetMap();
     $this->_acl = new Acl\Acl();
 }
示例#3
0
 public function indexAction()
 {
     $this->_helper->viewRenderer->setNoRender();
     $server = new Zend_Amf_Server();
     $server->addDirectory(APPLICATION_PATH . '/services/');
     $server->setProduction(FALSE);
     echo $server->handle();
 }
示例#4
0
 /**
  * Run the AMF server
  */
 public function run()
 {
     $enable = $this->get_enable();
     if (empty($enable)) {
         die;
     }
     include "Zend/Loader.php";
     Zend_Loader::registerAutoload();
     //retrieve the api name
     $classpath = optional_param('classpath', 'user', PARAM_ALPHA);
     require_once dirname(__FILE__) . '/../../' . $classpath . '/external.php';
     /// run the Zend AMF server
     $server = new Zend_Amf_Server();
     $debugmode = get_config($this->get_protocolid(), 'debug');
     if (!empty($debugmode)) {
         $server->setProduction(false);
     } else {
         $server->setProduction(true);
     }
     $server->setClass($classpath . "_external");
     $response = $server->handle();
     echo $response;
 }
	public function indexAction()
	{			
		$server = new Zend_Amf_Server();
		
		//set amf server session namespace
		$server->setSession(Security_Model_Session_Manager::ADMIN_SESSION_NAME);
		
		$server->setProduction(false);
		
		//set service root directory
		$server->addDirectory(realpath(dirname(__FILE__) . '/../services/amf/'));
		
		//set value object class mapping
		$server->setClassMap('LoginVO', 'Security_Model_Auth_Vo_LoginVO');
		$server->setClassMap('SessionVO', 'Security_Model_Auth_Vo_SessionVO');
		
		echo($server->handle());
	}
	public function indexAction()
	{			
		$acl = new Zend_Acl();
		$acl->addRole(new Zend_Acl_Role('administrator'));
		Zend_Session::regenerateId();
		
		$server = new Zend_Amf_Server();
		
		//set amf server session namespace
		$server->setSession();
		$server->setProduction(false);
		$server->setAcl($acl);
		
		//set service root directory
		$server->addDirectory(realpath(dirname(__FILE__) . '/../services/amf/'));
		
		echo($server->handle());
	}
示例#7
0
 public function setUp()
 {
     $this->_server = new \Zend\Amf\Server();
     $this->_server->setProduction(false);
     Parser\TypeLoader::resetMap();
 }
示例#8
0
require_once "service/Supertoto.php";
require_once "service/Players.php";
require_once "service/Sports.php";
// Error Reporting
error_reporting(E_ALL | E_STRICT);
// Turn to off when released to production
ini_set("display_errors", "on");
//set up your zend 1.7 location
ini_set("include_path", "../../zend/library");
// Zend Framework Includes
require_once "Zend/Loader.php";
require_once 'Zend/Auth.php';
require_once "Zend/Amf/Server.php";
require_once "Zend/dbcontrol/StoredConnections.php";
Zend_Loader::registerAutoload();
Zend_Session::start();
Zend_Session::regenerateId();
$server = new Zend_Amf_Server();
$server->setClass("Bookhouse");
$server->setClass("Bets");
$server->setClass("Sports");
$server->setClass("Groups");
$server->setClass("Teams");
$server->setClass("Prebuild");
$server->setClass("Events");
$server->setClass("Supertoto");
$server->setClass("Players");
$server->setClass("Login");
// Change this to true when released to production
$server->setProduction(false);
echo $server->handle();
示例#9
0
set_include_path(get_include_path() . PATH_SEPARATOR . $zenddir);
// Initialize Zend Framework loader
require_once 'Zend/Loader/Autoloader.php';
// require_once 'services/Pdoconfig.php';
// require_once 'services/UserModel.php';
Zend_Loader_Autoloader::getInstance();
// Load configuration
$default_config = new Zend_Config(array("production" => false), true);
$default_config->merge(new Zend_Config_Ini($configfile, 'zendamf'));
$default_config->setReadOnly();
$amf = $default_config->amf;
// Store configuration in the registry
Zend_Registry::set("amf-config", $amf);
// Initialize AMF Server
$server = new Zend_Amf_Server();
$server->setProduction($amf->production);
if (isset($amf->directories)) {
    $dirs = $amf->directories->toArray();
    foreach ($dirs as $dir) {
        // get the first character of the path.
        // If it does not start with slash then it implies that the path is relative to webroot. Else it will be treated as absolute path
        $length = strlen($dir);
        $firstChar = $dir;
        if ($length >= 1) {
            $firstChar = $dir[0];
        }
        if ($firstChar != "/") {
            // if the directory is ./ path then we add the webroot only.
            if ($dir == "./") {
                $server->addDirectory($webroot);
            } else {
示例#10
0
文件: gateway.php 项目: harz87/Test
<?php

// Define path to application directory
defined('APPLICATION_PATH') || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
// Define application environment
defined('APPLICATION_ENV') || define('APPLICATION_ENV', getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'development');
set_include_path(implode(PATH_SEPARATOR, array(realpath(APPLICATION_PATH . '/../library'), get_include_path())));
/** Zend_Application */
require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
$application->bootstrap();
require_once 'Zend/Amf/Server.php';
$server = new Zend_Amf_Server();
$server->addDirectory(dirname(__FILE__) . '/library/Wfw/Services/');
$server->setProduction(FALSE);
return $server->handle();
示例#11
0
    } else {
        ob_start();
        debug_print_backtrace();
        $back = ob_get_clean();
    }
    echo $mensagem;
}
include_once '.sistema/debug.php';
include_once '.sistema/definicoes.php';
$dir = definirDiretorio('Sistema');
define('diretorioPrioritario', $dir['stDiretorio']);
set_include_path(implode(PATH_SEPARATOR, array(realpath(APPLICATION_PATH . '/../.calixto/externas/'), realpath(dirname(__FILE__)), get_include_path())));
include_once '../.calixto/externas/Zend/Amf/Server.php';
session_start();
$server = new Zend_Amf_Server();
$server->setProduction(definicaoSistema::pegarAmbiente() == definicaoSistema::producao ? true : false);
$arDiretorios = scandir(dirname(__FILE__));
$arDiretoriosNaoEntidades = array('.', '..', '.tmp', '.sistema');
foreach ($arDiretorios as $dirName) {
    if (!in_array($dirName, $arDiretoriosNaoEntidades) && is_dir($dirName) && is_dir(dirname(__FILE__) . '/' . $dirName . '/classes')) {
        $server->addDirectory(dirname(__FILE__) . '/' . $dirName . '/classes');
        $arArquivos = scandir(dirname(__FILE__) . '/' . $dirName . '/classes');
        foreach ($arArquivos as $controle) {
            if (substr($controle, 0, 1) == 'C') {
                require_once dirname(__FILE__) . "/" . $dirName . "/classes/{$controle}";
            } elseif (substr($controle, 0, 1) == 'N') {
                $caminho = realpath(dirname(__FILE__) . "/" . $dirName . "/classes/{$controle}");
                require_once $caminho;
                $classeAs = substr("{$dirName}.classes.{$controle}", 0, strlen("{$dirName}.classes.{$controle}") - 4);
                $classePhp = substr($controle, 0, strlen($controle) - 4);
                $server->setClassMap($classeAs, $classePhp);