protected function _addServiceCall($request, $class = 'Zend_Amf_Auth_testclass', $method = 'hello') { $data[] = "12345"; $this->_server->setClass($class); $newBody = new Zend_Amf_Value_MessageBody("{$class}.{$method}", "/1", $data); $request->addAmfBody($newBody); }
public function index() { // Require Zend_Amf_Server require_once 'Zend/Amf/Server.php'; // *ZAMFBROWSER IMPLEMENTATION* // Require the ZendAmfServiceBrowser class, required to retrieve the list of methods on the ZendAMF server. require_once Kohana::find_file('vendor/ZamfBrowser', 'ZendAmfServiceBrowser'); // Start Server $server = new Zend_Amf_Server(); // $server->addDirectory( SHAREDPATH.Kohana::config('zendamf.services_path') ); $services_path = APPPATH . Kohana::config('zendamf.services_path'); $files = Kohana::list_files($services_path, FALSE); foreach ($files as $file) { $class = pathinfo($file, PATHINFO_FILENAME); $server->setClass($class); } // // do class mapping $vo_path = APPPATH . Kohana::config('zendamf.vo_path'); $files = Kohana::list_files($vo_path, FALSE); foreach ($files as $file) { $class = pathinfo($file, PATHINFO_FILENAME); $server->setClassMap($class, $class); } // *ZAMFBROWSER IMPLEMENTATION* // Add the ZendAmfServiceBrowser class to the list of available classes. $server->setClass("ZendAmfServiceBrowser"); // *ZAMFBROWSER IMPLEMENTATION* // Set this reference the class requires to the server object. // ZendAmfServiceBrowser::setAmfServer( $server ); ZendAmfServiceBrowser::$ZEND_AMF_SERVER = $server; // Handle the AMF request echo $server->handle(); }
protected function _addServiceCall($request, $class = 'ZendTest\\AMF\\TestAsset\\Authentication\\testclass', $method = 'hello') { $data[] = "12345"; $this->_server->setClass($class); $newBody = new Value\MessageBody("{$class}.{$method}", "/1", $data); $request->addAmfBody($newBody); }
public function indexAction() { // action body $server = new Zend_Amf_Server(); $server->setClass('Default_Model_Account'); $server->setClass('Default_Model_Transaction'); $server->setClass('Default_Model_HelloWorld'); $server->setClassMap('AccountVO', 'Default_Model_Vo_Account'); $server->setClassMap('TransactionVO', 'Default_Model_Vo_Transaction'); echo $server->handle(); }
protected function _callService($method, $class = 'Zend_Amf_Resource_testclass') { $request = new Zend_Amf_Request(); $request->setObjectEncoding(0x3); $this->_server->setClass($class); $newBody = new Zend_Amf_Value_MessageBody("{$class}.{$method}", "/1", array("test")); $request->addAmfBody($newBody); $this->_server->handle($request); $response = $this->_server->getResponse(); return $response; }
protected function _callService($method, $class = 'ZendTest\\AMF\\TestAsset\\testclass') { $request = new \Zend\AMF\Request\StreamRequest(); $request->setObjectEncoding(0x3); $this->_server->setClass($class); $newBody = new \Zend\AMF\Value\MessageBody("{$class}.{$method}", "/1", array("test")); $request->addAmfBody($newBody); $this->_server->handle($request); $response = $this->_server->getResponse(); return $response; }
/** +---------------------------------------------------------- * 应用程序初始化 +---------------------------------------------------------- * @access public +---------------------------------------------------------- * @return void +---------------------------------------------------------- */ public static function run() { // 设定错误和异常处理 set_error_handler(array('App', "appError")); set_exception_handler(array('App', "appException")); //[RUNTIME] // 检查项目是否编译过 // 在部署模式下会自动在第一次执行的时候编译项目 if (defined('RUNTIME_MODEL')) { // 运行模式无需载入项目编译缓存 } elseif (is_file(RUNTIME_PATH . '~app.php') && (!is_file(CONFIG_PATH . 'config.php') || filemtime(RUNTIME_PATH . '~app.php') > filemtime(CONFIG_PATH . 'config.php'))) { // 直接读取编译后的项目文件 C(include RUNTIME_PATH . '~app.php'); } else { // 预编译项目 App::build(); } //[/RUNTIME] //导入类库 Vendor('Zend.Amf.Server'); //实例化AMF $server = new Zend_Amf_Server(); $actions = explode(',', C('APP_AMF_ACTIONS')); foreach ($actions as $action) { $server->setClass($action . 'Action'); } echo $server->handle(); // 保存日志记录 if (C('LOG_RECORD')) { Log::save(); } return; }
/** * PHPRpc控制器架构函数 * @access public */ public function __construct() { //导入类库 think\loader::import('vendor.zend.amf.server'); //实例化AMF $server = new \Zend_Amf_Server(); $server->setClass($this); echo $server->handle(); return; }
public function load() { $folder = 'AmfServices'; defined('APPLICATION_PATH') || define('APPLICATION_PATH', realpath(dirname(__FILE__))); require_once dirname(__FILE__) . '/../lib/amf/browser/ZendAmfServiceBrowser.php'; set_include_path(dirname(__FILE__) . '/../lib/amf/library' . PATH_SEPARATOR . get_include_path()); require_once dirname(__FILE__) . '/../lib/amf/library/Zend/Amf/Server.php'; $server = new \Zend_Amf_Server(); set_include_path(implode(PATH_SEPARATOR, array(realpath(APPLICATION_PATH . '/' . $folder . '/'), get_include_path()))); $service_path = $this->container->getParameter('service_path'); if (empty($service_path)) { $folder = APPLICATION_PATH . '/' . $folder . '/'; } else { $folder = getcwd() . '/../src/' . $service_path . '/Services/AmfServices/'; $folderPath = '/src/' . $service_path . '/Services/AmfServices/'; } if (!is_dir($folder)) { echo 'path is undefined <br /> create: ' . $folderPath; die; } if (count(glob($folder . '*.php')) < 1) { echo 'no services defined'; die; } foreach (glob($folder . '*.php') as $filename) { $service = basename($filename, ".php"); $filerawname = basename($filename); if (file_exists($folder . $filerawname)) { include_once $folder . $filerawname; $server->setClass($service); } } $server->setClass("ZendAmfServiceBrowser"); \ZendAmfServiceBrowser::$ZEND_AMF_SERVER = $server; return $server->handle(); }
/** +---------------------------------------------------------- * 应用程序初始化 +---------------------------------------------------------- * @access public +---------------------------------------------------------- * @return void +---------------------------------------------------------- */ public static function run() { //导入类库 Vendor('Zend.Amf.Server'); //实例化AMF $server = new Zend_Amf_Server(); $actions = explode(',', C('APP_AMF_ACTIONS')); foreach ($actions as $action) { $server->setClass($action . 'Action'); } echo $server->handle(); // 保存日志记录 if (C('LOG_RECORD')) { Log::save(); } return; }
/** * 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; }
<?php require_once 'Zend/Amf/Server.php'; $server = new Zend_Amf_Server(); $server->addFunction('sayHello'); $server->setClass("World"); echo $server->handle(); function sayHello($name, $age) { return 'Hello ' . $name . ",your age is " . $age; } class World { public function hello() { return 'Hello World'; } }
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();
<?php error_reporting(E_ALL); require_once 'Zend/Amf/Server.php'; require_once 'QosPortalService.php'; require_once 'QosDataService.php'; require_once 'QosUserService.php'; require_once 'QosReportsService.php'; require_once 'QosCommentService.php'; require_once 'QosDbCheck.php'; require_once 'QosImportErrorService.php'; require_once 'QosExportService.php'; $server = new Zend_Amf_Server(); $server->setClass("QosPortalService"); $server->setClass("QosDataService"); $server->setClass("QosUserService"); $server->setClass("QosReportsService"); $server->setClass("QosCommentService"); $server->setClass("QosDbCheck"); $server->setClass("QosImportErrorService"); $server->setClass("QosExportService"); $server->setProduction(false); $server->setClassMap("VOUser", "VOUser"); $server->setClassMap("VOReport", "VOReport"); $server->setClassMap("VOCartesianChartReport", "VOCartesianChartReport"); $server->setClassMap("VOTableReport", "VOTableReport"); $server->setClassMap("VOMultiviewReport", "VOMultiviewReport"); $server->setClassMap("VOCategory", "VOCategory"); $server->setClassMap("VOReportType", "VOReportType"); $server->setClassMap("VOKpi", "VOKpi"); $server->setClassMap("VOKpiType", "VOKpiType");
<?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') : 'production'); // Ensure library/ is on include_path set_include_path(implode(PATH_SEPARATOR, array(realpath(APPLICATION_PATH . '/../library'), get_include_path()))); /** Zend_Amf_Server */ require_once "Zend/Amf/Server.php"; require "../application/services/com/mconnects/employee/Employee.php"; $server = new Zend_Amf_Server(); $server->setClass("Contacts"); echo $server->handle();
include 'app/Erros.php'; include_once 'library/Zend/Amf/Server.php'; include 'app/servicos/ServicosCliente.php'; include 'app/servicos/ServicosPreVenda.php'; include 'app/servicos/ServicosProduto.php'; include 'app/servicos/ServicosFormadePagto.php'; include 'app/servicos/ServicosFornecedor.php'; include 'app/servicos/ServicosUnidade.php'; include 'app/servicos/ServicosGrupoProduto.php'; include 'app/servicos/ServicosLocalProduto.php'; include 'app/servicos/ServicosUsuario.php'; include 'app/servicos/ServicosVenda.php'; include_once 'app/vo/ClienteVO.php'; require_once 'Zend/Amf/Server/Exception.php'; $server = new Zend_Amf_Server(); $server->setClass('ServicosPreVenda'); $server->setClass('ServicosFornecedor'); $server->setClass('ServicosCliente'); $server->setClass('ServicosProduto'); $server->setClass('ServicosUnidade'); $server->setClass('ServicosFormadePagto'); $server->setClass('ServicosGrupoProduto'); $server->setClass('ServicosLocalProduto'); $server->setClass('ServicosUsuario'); $server->setClass('ServicosVenda'); $server->setClassMap('UnidadeVO', 'UnidadeVO'); $server->setClassMap('ClienteVO', 'ClienteVO'); $server->setProduction(false); echo $server->handle(); //$s = new Servicos(); //$s->getUnidades();
<?php error_reporting(E_ALL | E_STRICT); ini_set("display_errors", "on"); // Modify include_path to include the Zend library // this is because they assume that their folder is in the path ini_set("include_path", ini_get("include_path") . PATH_SEPARATOR . "../zend_framework/library"); date_default_timezone_set('America/Boise'); require_once "Zend/Amf/Server.php"; require_once 'Zend/Amf/Value/ByteArray.php'; $server = new Zend_Amf_Server(); class Tester { public function Gimme() { $ret = "howdy"; // do a bunch of mcrypt calls on $ret here return new Zend_Amf_Value_ByteArray($ret); } } //adding our class to Zend AMF Server $server->setClass("Tester"); // Change this to true when released to production $server->setProduction(false); echo $server->handle();
<?php set_include_path(get_include_path() . PATH_SEPARATOR . 'C:\\svn\\zend\\ZendFramework-1.10.2-minimal\\library'); require_once 'Zend/Amf/Server.php'; class XCRpcProtocol_AMF { public function getConfiguration($whatever) { } public function beginSession($configuration_blob = null, $login_method = null, $login_blob = null) { $ret = new stdClass(); $ret->session_info = new stdClass(); $ret->session_info->code = "123"; return $ret; } public function login($session_info, $login_method, $login_blob) { $ret = new stdClass(); $ret->session_info = $session_info; $ret->login_method = $login_method; $ret->login_blob = $login_blob; return $ret; } } $server = new Zend_Amf_Server(); $server->setProduction(false); $server->setClass("XCRpcProtocol_AMF"); $response = $server->handle(); echo $response;
require_once 'services/TimeTableService.php'; require_once 'services/ContentCategoryService.php'; require_once 'services/ContentDomainService.php'; require_once 'services/ContentURLService.php'; require_once 'services/ContentRegexService.php'; require_once 'services/MimeTypeService.php'; require_once 'services/MimeTypeGroupService.php'; require_once 'services/MimeCrossService.php'; require_once 'services/ACLRuleService.php'; require_once 'services/ACLFilterParamService.php'; require_once 'services/BackupService.php'; require_once 'services/LiveLogService.php'; require_once 'services/BTKTimelineService.php'; require_once 'services/BTKDbUpdateService.php'; require_once 'services/BTKTimestampHistoryService.php'; require_once 'services/BTKUserInfoService.php'; require_once 'services/BTKGeneralInfoService.php'; $server = new Zend_Amf_Server(); //adding our class to Zend AMF Server $server->setClass("UserService")->setClass("IPTableService")->setClass("TimeTableService")->setClass("ContentCategoryService")->setClass("ContentDomainService")->setClass("ContentURLService")->setClass("ContentRegexService")->setClass("MimeTypeService")->setClass("MimeTypeGroupService")->setClass("MimeCrossService")->setClass("ACLRuleService")->setClass("ACLFilterParamService")->setClass("BackupService")->setClass("LiveLogService")->setClass("BTKTimelineService")->setClass("BTKDbUpdateService")->setClass("BTKTimestampHistoryService")->setClass("BTKUserInfoService")->setClass("BTKGeneralInfoService"); //Mapping the ActionScript VO to the PHP VO //you don't have to add the package name $server->setClassMap("VOUser", "VOUser"); $server->setClassMap("VOIPTable", "VOIPTable"); $server->setClassMap("VOTimeTable", "VOTimeTable"); $server->setClassMap("VOContentCategory", "VOContentCategory"); $server->setClassMap("VOContentDomain", "VOContentDomain"); $server->setClassMap("VOContentURL", "VOContentURL"); $server->setClassMap("VOContentRegex", "VOContentRegex"); $server->setClassMap("VOACLRule", "VOACLRule"); echo $server->handle();
<?php require_once 'Zend/Amf/Server.php'; require_once 'TestService.php'; $server = new Zend_Amf_Server(); $server->setProduction(false); $server->setClass("TestService"); $server->setClassMap("ComplexBARequest", "ComplexBARequest"); echo $server->handle();
$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 echo $server->handle();
<?php require_once "Zend/Amf/Server.php"; require_once "AppMockDAO.php"; $server = new Zend_Amf_Server(); // Adding our class to Zend AMF Server $server->setClass("AppMockDAO"); // Mapping the ActionScript VO to the PHP VO $server->setClassMap("flex.messaging.io.ArrayCollection", "com.masuland.loginexample.data.dto.ArrayCollection"); $server->setClassMap("com.masuland.loginexample.data.vo.SettingsVO", "com.masuland.loginexample.data.dto.SettingsDTO"); $server->setClassMap("com.masuland.loginexample.data.vo.LayoutVO", "com.masuland.loginexample.data.dto.LayoutDTO"); $server->setClassMap("com.masuland.loginexample.data.vo.LocaleVO", "com.masuland.loginexample.data.dto.LocaleDTO"); $server->setClassMap("com.masuland.loginexample.data.vo.StyleVO", "com.masuland.loginexample.data.dto.StyleDTO"); $server->setClassMap("com.masuland.loginexample.data.vo.AuthenticationVO", "com.masuland.loginexample.data.dto.AuthenticationDTO"); $server->setClassMap("com.masuland.loginexample.data.vo.UserVO", "com.masuland.loginexample.data.dto.UserDTO"); echo $server->handle();
// pour debugger un film... if (isset($_GET['film'])) { require_once "FilmAnalyser.php"; $fa = new FilmAnalyser($_GET['film']); Zend_Debug::dump($fa); exit; } /* le log de debug */ $writer = new Zend_Log_Writer_Stream('php-errors.log'); //$writer = new Zend_Log_Writer_Stream('php://stdout'); $logger = new Zend_Log($writer); /* la base de données */ if (!file_exists('db')) { // on cree le rep de la base de données si il n'existe pas mkdir('db'); } $db = Zend_Db::factory('Pdo_Sqlite', array('dbname' => 'db/mmc.db')); Zend_Db_Table::setDefaultAdapter($db); //print_r($db); $server = new Zend_Amf_Server(); $server->setClassMap('FilmVO', 'Film'); $server->setClassMap('SettingVO', 'Setting'); $server->setClassMap('SettingsVO', 'Settings'); $server->setProduction(false); $server->setClass('FilmMapper', 'films'); $server->setClass('SettingsMapper', 'settings'); $response = $server->handle(); echo $response; } catch (Exception $e) { error_log($e->getMessage()); }
<?php error_reporting(E_ALL | E_STRICT); ini_set("display_errors", "on"); require_once 'Zend/Amf/Server.php'; require_once 'Tutorials.php'; $server = new Zend_Amf_Server(); $server->setClass("Tutorials"); echo $server->handle();
<?php define('FANWE_ROOT', str_replace('services/fanwe.php', '', str_replace('\\', '/', __FILE__))); require FANWE_ROOT . 'core/fanwe.php'; @set_include_path(FANWE_ROOT . 'services/'); require "Zend/Amf/Server.php"; require "fanwe.service.php"; $fanwe =& FanweService::instance(); $fanwe->initialize(); $server = new Zend_Amf_Server(); $server->setClass('FanweAmfService'); echo $server->handle();
Zend_Loader::registerAutoload(); $server = new Zend_Amf_Server(); require_once 'controller/HundController.php'; require_once 'controller/LoggInnController.php'; require_once 'controller/ACLController.php'; require_once 'controller/JaktproveController.php'; require_once 'controller/UtstillingController.php'; require_once 'controller/RolleRettighetController.php'; require_once 'controller/BackupController.php'; require_once 'controller/RolleBrukerController.php'; require_once 'controller/PersonController.php'; require_once 'controller/DatOpplastningsController.php'; require_once 'controller/CupController.php'; require_once 'controller/ArrangementController.php'; require_once 'controller/NyhetController.php'; $server->setClass("HundController"); $server->setClass("JaktproveController"); $server->setClass("UtstillingController"); $server->setClass("LoggInnController"); $server->setClass("ACLController"); $server->setClass("RolleRettighetController"); $server->setClass("BackupController"); $server->setClass("RolleBrukerController"); $server->setClass("PersonController"); $server->setClass("DatOpplastningsController"); $server->setClass("CupController"); $server->setClass("ArrangementController"); $server->setClass("NyhetController"); $server->setClassMap("AmfRettigheter", "AmfRettigheter"); $server->setClassMap("AmfHund", "AmfHund"); $server->setClassMap("AmfAvkom", "AmfAvkom");