public function indexAction() { $this->_helper->layout->setLayout('json'); $this->getHelper('ViewRenderer')->setNoRender(); $server = new Zend_Amf_Server(); $server->addDirectory(dirname(__FILE__) . '/../services/'); echo $server->handle(); }
public function indexAction() { $this->_helper->viewRenderer->setNoRender(); $server = new Zend_Amf_Server(); $server->addDirectory(APPLICATION_PATH . '/services/'); $server->setProduction(FALSE); echo $server->handle(); }
public function indexAction() { $server = new Zend_Amf_Server(); $server->addDirectory(APPLICATION_PATH . '/amf/services'); self::registerVO($server, "vo.Test", "Amf_VO_Test"); self::registerVO($server, "vo.ByteArray", "Amf_VO_ByteArray"); echo $server->handle(); }
public function amfAction() { $server = new Zend_Amf_Server(); require_once APPLICATION_PATH . '/auth/Auth.php'; $server->setAuth(new Auth()); $server->addDirectory(APPLICATION_PATH . '/services/'); $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()); }
/** * @group ZF-6130 */ public function testServerShouldCastObjectArgumentsToAppropriateType() { $server = new Zend_Amf_Server(); $server->addDirectory(dirname(__FILE__) . '/_files/zf-6130/services'); // Create a mock message $message = new Zend_Amf_Value_Messaging_RemotingMessage(); $message->operation = 'createEmployee'; $message->source = 'EmployeeService'; // original raw request used "destination" $message->body = array(array('office' => 322, 'departmentid' => 3, 'street' => 32, 'zipcode' => 32, 'state' => 32, 'lastname' => 4, 'firstname' => 2, 'photofile' => 322, 'city' => 32, 'id' => 1, 'title' => 4, 'officephone' => 233, 'email' => 32, 'cellphone' => 22)); $body = new Zend_Amf_Value_MessageBody(null, "", $message); $request = new Zend_Amf_Request(); $request->addAmfBody($body); $request->setObjectEncoding(0x3); $response = $server->handle($request); $employee = EmployeeService::$employee; $this->assertNotNull($employee); $this->assertNotEquals(1, $employee->id); $this->assertRegexp('/[a-z0-9]{3,}/', $employee->id); }
$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 { $tempPath = $webroot . "/" . $dir; $server->addDirectory($tempPath); } } else { $server->addDirectory($dir); } } } // Initialize introspector for non-production if (!$amf->production) { $server->setClass('Zend_Amf_Adobe_Introspector', '', array("config" => $default_config, "server" => $server)); $server->setClass('Zend_Amf_Adobe_DbInspector', '', array("config" => $default_config, "server" => $server)); } // Handle request
<?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();
$username = $default_config->username; $password = $default_config->password; $dbname = $default_config->dbname; $salt = $default_config->salt; $api_key = $default_config->api_key; // Store configuration in the registry Zend_Registry::set("amf-config", $amf); Zend_Registry::set('dbAdapter', $dbAdapter); Zend_Registry::set('dbname', $dbname); Zend_Registry::set('username', $username); Zend_Registry::set('password', $password); Zend_Registry::set('host', $host); Zend_Registry::set('port', $port); Zend_Registry::set('salt', $salt); Zend_Registry::set('api_key', $api_key); // Initialize AMF Server $server = new Zend_Amf_Server(); $server->setProduction($amf->production); if (isset($amf->directories)) { $dirs = $amf->directories->toArray(); foreach ($dirs as $dir) { $server->addDirectory($dir); } } // Initialize introspector for non-production if (!$amf->production) { $server->setClass('Zend_Amf_Adobe_Introspector', '', array("config" => $default_config, "server" => $server)); $server->setClassMap('UserVO', 'UserVO'); } // Handle request echo $server->handle();
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); } } } } echo $server->handle();
public function indexAction() { $server = new Zend_Amf_Server(); $server->addDirectory(APPLICATION_PATH . '/services'); echo $server->handle(); }