Esempio n. 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());
 }
Esempio n. 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();
 }
Esempio n. 3
0
 /**
  * \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();
 }
Esempio n. 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;
 }