public function TAmf($serviceClass) { $this->serviceClass = $serviceClass; // Init server $server = new SabreAMF_CallbackServer(); $server->onInvokeService = array($this, 'amfService'); $server->exec(); }
/** * Main entry point of the Gateway. * * The function automaticly sets the web-debug-toolbar to off * * @return mixed The AMF encoded result of the service. */ public function service() { //sfConfig::set('sf_web_debug', false); ob_start(); require_once "SabreAMF/CallbackServer.php"; $server = new SabreAMF_CallbackServer(); $server->onInvokeService = array($this, 'onDispatch'); $server->exec(); $result = ob_get_contents(); //Don't use ob_end_clean() not ob_get_clean() since this will kill symfony own headers ob_clean(); return $result; }
<?php /* $Id: server.php 1218 2006-03-07 23:07:44Z evert $ */ // Include the server class include 'SabreAMF/CallbackServer.php'; function myCallBack($service, $method, $data) { return 'hello world'; } // Init server $server = new SabreAMF_CallbackServer(); $server->onInvokeService = 'myCallBack'; $server->exec();