예제 #1
0
 /**
  * Returns the framework manager for the given class name
  * 
  * @param string $className
  * @return object
  * 
  * @throws \Zepi\Turbo\Exception Cannot find framework manager "{className}".
  */
 protected function getFrameworkManager($className)
 {
     switch ($className) {
         case 'Zepi\\Turbo\\Manager\\DataSourceManager':
             return $this->framework->getDataSourceManager();
             break;
         case 'Zepi\\Turbo\\Manager\\DependencyInjectionManager':
             return $this->framework->getDependencyInjectionManager();
             break;
         case 'Zepi\\Turbo\\Manager\\ModuleManager':
             return $this->framework->getModuleManager();
             break;
         case 'Zepi\\Turbo\\Manager\\RequestManager':
             return $this->framework->getRequestManager();
             break;
         case 'Zepi\\Turbo\\Manager\\RouteManager':
             return $this->framework->getRouteManager();
             break;
         case 'Zepi\\Turbo\\Manager\\RuntimeManager':
             return $this->framework->getRuntimeManager();
             break;
         default:
             throw new Exception('Cannot find framework manager "' . $className . '".');
             break;
     }
 }
예제 #2
0
 /**
  * Execute the installation of Turbo
  * 
  * @access public
  * @param \Zepi\Turbo\Framework $framework
  * @param \Zepi\Turbo\Request\CliRequest $request
  * @param \Zepi\Turbo\Response\Response $response
  */
 public function execute(Framework $framework, CliRequest $request, Response $response)
 {
     // Configure turbo
     $this->configure();
     // Save the settings
     $this->configurationManager->saveConfigurationFile();
     // Execute the DataSource setups
     $dataSourceManager = $framework->getDataSourceManager();
     foreach ($dataSourceManager->getDataSourceTypeClasses() as $type) {
         $dataSource = $dataSourceManager->getDataSource($type);
         $dataSource->setup();
     }
 }