Beispiel #1
0
 /**
  * @param Oxygen_Http_Request     $request
  * @param Oxygen_Util_RequestData $requestData
  *
  * @return Oxygen_Util_HookedClosure|Oxygen_Http_Response
  * @throws Oxygen_Exception
  */
 public function handle(Oxygen_Http_Request $request, $requestData)
 {
     $actionDefinition = $this->actionRegistry->getDefinition($requestData->actionName);
     $hookName = $actionDefinition->getOption('hook_name');
     if ($hookName === null) {
         return $this->handleRaw($request, $requestData, $actionDefinition->getClass(), $actionDefinition->getMethod(), $requestData->actionParameters);
     }
     $actionClosure = new Oxygen_Util_Closure(array($this, 'handleRaw'), $request, $requestData, $actionDefinition->getClass(), $actionDefinition->getMethod(), $requestData->actionParameters);
     return new Oxygen_Util_HookedClosure($hookName, $actionClosure->getCallable());
 }
Beispiel #2
0
 /**
  * {@inheritdoc}
  */
 protected function createActionRegistry()
 {
     $registry = new Oxygen_Action_Registry();
     $registry->setDefinition('site.ping', new Oxygen_Action_Definition('Oxygen_Action_SitePingAction', 'execute', array('hook_name' => 'init')));
     $registry->setDefinition('module.disable', new Oxygen_Action_Definition('Oxygen_Action_ModuleDisableAction', 'execute', array('hook_name' => 'init')));
     $registry->setDefinition('module.enable', new Oxygen_Action_Definition('Oxygen_Action_ModuleEnableAction', 'execute', array('hook_name' => 'init')));
     $registry->setDefinition('extension.downloadFromUrl', new Oxygen_Action_Definition('Oxygen_Action_ExtensionDownloadFromUrlAction', 'execute', array('hook_name' => 'init')));
     $registry->setDefinition('extension.downloadUpdateFromUrl', new Oxygen_Action_Definition('Oxygen_Action_ExtensionDownloadUpdateFromUrlAction', 'execute', array('hook_name' => 'init')));
     $registry->setDefinition('extension.update', new Oxygen_Action_Definition('Oxygen_Action_ExtensionUpdateAction', 'execute', array('hook_name' => 'init')));
     $registry->setDefinition('module.uninstall', new Oxygen_Action_Definition('Oxygen_Action_ModuleUninstallAction', 'execute', array('hook_name' => 'init')));
     $registry->setDefinition('database.listMigrations', new Oxygen_Action_Definition('Oxygen_Action_DatabaseMigrateAction', 'listMigrations', array('hook_name' => 'init')));
     $registry->setDefinition('database.runMigration', new Oxygen_Action_Definition('Oxygen_Action_DatabaseMigrateAction', 'runMigration', array('hook_name' => 'init')));
     $registry->setDefinition('site.logout', new Oxygen_Action_Definition('Oxygen_Action_SiteLogoutAction', 'execute'));
     return $registry;
 }