protected function getDocsConfig($module)
 {
     $moduleConfigPath = $this->moduleUtils->getModuleConfigPath($module);
     $docConfigPath = dirname($moduleConfigPath) . '/documentation.config.php';
     if (!file_exists($docConfigPath)) {
         return null;
     }
     $documentation = (include $docConfigPath);
     return $this->configFactory->createConfigResource($documentation, $docConfigPath);
 }
 /**
  * @param  string $module
  * @return AuthorizationModel
  */
 public function factory($module)
 {
     if (isset($this->models[$module])) {
         return $this->models[$module];
     }
     $moduleName = $this->modules->normalizeModuleName($module);
     $moduleEntity = $this->moduleModel->getModule($moduleName);
     $config = $this->configFactory->factory($module);
     $this->models[$module] = new AuthorizationModel($moduleEntity, $this->modules, $config);
     return $this->models[$module];
 }
 /**
  * @param  string $module
  * @return RpcServiceModel
  */
 public function factory($module)
 {
     if (isset($this->models[$module])) {
         // @codeCoverageIgnoreStart
         return $this->models[$module];
     }
     // @codeCoverageIgnoreEnd
     $moduleName = $this->normalizeModuleName($module);
     $moduleEntity = $this->moduleModel->getModule($moduleName);
     $config = $this->configFactory->factory($module);
     $this->models[$module] = new DoctrineRpcServiceModel($moduleEntity, $this->modules, $config);
     return $this->models[$module];
 }
Пример #4
0
 /**
  * @param $module
  * @return \ZF\Configuration\ConfigResource
  */
 protected function getDocumentationConfigResource($module)
 {
     $moduleConfigPath = $this->moduleUtils->getModuleConfigPath($module);
     $docConfigPath = dirname($moduleConfigPath) . '/documentation.config.php';
     $docArray = (file_exists($docConfigPath)) ? include $docConfigPath : array();
     return $this->configFactory->createConfigResource($docArray, $docConfigPath);
 }
 /**
  * Check if a module and controller exists
  *
  * @param  string $module
  * @param  string $controller
  * @return boolean
  */
 public function controllerExists($module, $controller)
 {
     try {
         $configModule = $this->configFactory->factory($module);
     } catch (InvalidArgumentConfiguration $e) {
         return false;
     }
     $config = $configModule->fetch(true);
     if (isset($config['zf-rest']) && array_key_exists($controller, $config['zf-rest'])) {
         return true;
     }
     if (isset($config['zf-rpc']) && array_key_exists($controller, $config['zf-rpc'])) {
         return true;
     }
     return false;
 }