Beispiel #1
0
 /**
  * If a routes.php file returns an array, try to set up the application and
  * register the routes for the app. The application class will be chosen by
  * camelcasing the appname, e.g.: my_app will be turned into
  * \OCA\MyApp\AppInfo\Application. If that class does not exist, a default
  * App will be intialized. This makes it optional to ship an
  * appinfo/application.php by using the built in query resolver
  *
  * @param array $routes the application routes
  * @param string $appName the name of the app.
  */
 private function setupRoutes($routes, $appName)
 {
     if (is_array($routes)) {
         $appNameSpace = App::buildAppNamespace($appName);
         $applicationClassName = $appNameSpace . '\\AppInfo\\Application';
         if (class_exists($applicationClassName)) {
             $application = new $applicationClassName();
         } else {
             $application = new App($appName);
         }
         $application->registerRoutes($this, $routes);
     }
 }