コード例 #1
0
ファイル: BongAppController.php プロジェクト: neel/bong
 public function __construct($model = null)
 {
     parent::__construct();
     $this->data = new stdClass();
     $this->meta = new ControllerMeta();
     /*{ TODO Having an XDO should be optional not all app asks for an XDO*/
     if (!$this instanceof NoXDO) {
         $this->xdo = new ControllerXDO();
         if ($this->xdo->serialized()) {
             $this->xdo->unserialize();
         }
     } else {
         $this->xdo = new DummyXDO();
     }
     /*}*/
     /*{ TODO Save applies here too. not all app need a session Storage some wants to work real Stateless too*/
     if (!$this instanceof NoSession) {
         $this->session = new SessionXDO();
         if ($this->session->serialized()) {
             $this->session->unserialize();
         }
     } else {
         $this->session = new DummyXDO();
     }
     /**/
     $controllerName = get_class($this);
     if (!$this instanceof NoXDO) {
         $desc = new \ROM\BongXDODescriptor(\ROM\BongXDODescriptor::ControllerXDO, $controllerName, $this->xdo->sessionFilePath());
         \ROM\BongCurrentUserData::instance()->addXDO($desc);
     }
     $this->spiritEngine = EngineFactory::produce("SpiritEngine", array(&$this));
     $this->ctor();
 }
コード例 #2
0
ファイル: AppServiceRouter.php プロジェクト: neel/bong
 public function prepareEngine()
 {
     switch ($this->navigation->controllerExtension) {
         case 'json':
             $this->_engine = EngineFactory::produce('AppJSONServiceEngine');
             break;
         case 'xml':
             $this->_engine = EngineFactory::produce('AppXMLServiceEngine');
             break;
         case 'prop':
             $this->_engine = EngineFactory::produce('AppPropertyServiceEngine');
             break;
         case 'res':
             $this->_engine = EngineFactory::produce('AppResponseServiceEngine');
             break;
     }
     parent::prepareEngine();
 }
コード例 #3
0
ファイル: abstractcontentrouter.php プロジェクト: neel/bong
 public function __construct($engineName)
 {
     $this->navigation = new StdClass();
     $this->_engine = EngineFactory::produce($engineName);
 }
コード例 #4
0
ファイル: SpiritServiceRouter.php プロジェクト: neel/bong
 public function prepareEngine()
 {
     switch ($this->navigation->spiritExtension) {
         case 'json':
             $this->_engine = EngineFactory::produce('SpiritJSONServiceEngine');
             break;
         case 'xml':
             $this->_engine = EngineFactory::produce('SpiritXMLServiceEngine');
             break;
         case 'prop':
             $this->_engine = EngineFactory::produce('SpiritPropertyServiceEngine');
             break;
         case 'res':
             $this->_engine = EngineFactory::produce('SpiritResponseServiceEngine');
             break;
     }
     parent::prepareEngine();
 }