예제 #1
0
 public function execute()
 {
     http::freeze();
     //a Spirit Cannot send any HTTP Header unless It is used as ResponseService
     $this->engine->executeLogic();
     http::release();
     http::contentType('application/json');
     return json_encode($this->engine->xdo());
 }
예제 #2
0
 public function execute()
 {
     http::freeze();
     //a Spirit Cannot send any HTTP Header unless It is used as ResponseService
     $this->engine->run();
     http::release();
     http::contentType('text/xml');
     return $this->engine->xdo()->toXML()->saveXML();
 }
예제 #3
0
파일: SpiritAdapter.php 프로젝트: neel/bong
 /**
  * \virtual
  * @param string $methodName
  * @param array $args
  */
 public function call($methodName, $args = array())
 {
     $this->spiritEngine->setActiveInstance($this->_activeInstanceId);
     http::freeze();
     //a Spirit Cannot send any HTTP Header unless It is used as ResponseService. as the spirit output is embedded in the app output. so its the app that sends the header. not the spirit
     $this->spiritEngine->run($this->spiritName, $methodName, $args);
     http::release();
     //Engine Automatically Clear's the Active Instance Id So no need to call clear Explecitely
     return $this->spiritEngine->response();
 }
예제 #4
0
 public function execute()
 {
     http::freeze();
     //a Spirit Cannot send any HTTP Header unless It is used as ResponseService
     $this->engine->run();
     http::release();
     $xdo = $this->engine->xdo();
     $navigation = $this->engine->getNavigation();
     if (isset($xdo->{$navigation->propertyName})) {
         $value = $xdo->{$navigation->propertyName};
         if (is_array($value) || is_object($value)) {
             http::contentType('application/json');
             return json_encode($value);
         } else {
             http::contentType('text/plain');
             return $value;
         }
     }
     return null;
 }