예제 #1
0
/**
* Create a non-cached UrlMatcher
*
* @param \src\extension\manager $manager Extension manager
* @param RequestContext $context Symfony RequestContext object
* @return UrlMatcher
*/
function src_create_url_matcher(\src\extension\manager $manager, RequestContext $context, $root_path)
{
    $provider = new \src\controller\provider();
    $provider->find_routing_files($manager->get_finder());
    $routes = $provider->find($root_path)->get_routes();
    return new UrlMatcher($routes, $context);
}
예제 #2
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $migrations = $this->extension_manager->get_finder()->set_extensions(array())->core_path('src/db/migration/data/')->get_classes();
     $tips = $migrations;
     foreach ($migrations as $migration_class) {
         foreach ($migration_class::depends_on() as $dependency) {
             $tips_key = array_search($dependency, $tips);
             if ($tips_key !== false) {
                 unset($tips[$tips_key]);
             }
         }
     }
     $output->writeln("\t\tarray(");
     foreach ($tips as $migration) {
         $output->writeln("\t\t\t'{$migration}',");
     }
     $output->writeln("\t\t);");
 }
예제 #3
0
 /**
  * Constructor
  *
  * @param \src\template\template $template Template object
  * @param \src\user $user User object
  * @param \src\config\config $config Config object
  * @param \src\controller\provider $provider Path provider
  * @param \src\extension\manager $manager Extension manager object
  * @param \src\symfony_request $symfony_request Symfony Request object
  * @param \src\request\request_interface $request src request object
  * @param \src\filesystem $filesystem The filesystem object
  * @param string $src_root_path src root path
  * @param string $php_ext PHP file extension
  */
 public function __construct(\src\template\template $template, \src\user $user, \src\config\config $config, \src\controller\provider $provider, \src\extension\manager $manager, \src\symfony_request $symfony_request, \src\request\request_interface $request, \src\filesystem $filesystem, $src_root_path, $php_ext)
 {
     $this->template = $template;
     $this->user = $user;
     $this->config = $config;
     $this->symfony_request = $symfony_request;
     $this->request = $request;
     $this->filesystem = $filesystem;
     $this->src_root_path = $src_root_path;
     $this->php_ext = $php_ext;
     $provider->find_routing_files($manager->get_finder());
     $this->route_collection = $provider->find($src_root_path)->get_routes();
 }
예제 #4
0
 protected function load_migrations()
 {
     $migrations = $this->extension_manager->get_finder()->core_path('src/db/migration/data/')->extension_directory('/migrations')->get_classes();
     $this->migrator->set_migrations($migrations);
 }
예제 #5
0
 /**
  * Populate migrations for the installation
  *
  * This "installs" all migrations from (root path)/src/db/migrations/data.
  * "installs" means it adds all migrations to the migrations table, but does not
  * perform any of the actions in the migrations.
  *
  * @param \src\extension\manager $extension_manager
  * @param \src\db\migrator $migrator
  */
 function populate_migrations($extension_manager, $migrator)
 {
     $finder = $extension_manager->get_finder();
     $migrations = $finder->core_path('src/db/migration/data/')->get_classes();
     $migrator->populate_migrations($migrations);
 }