예제 #1
0
 /**
  * {@inheritdoc}
  */
 public function __construct(array $values = array())
 {
     parent::__construct($values);
     $this['app_name'] = 'SVN-Buddy';
     $this['app_version'] = '@git-version@';
     $this['working_directory_sub_folder'] = '.svn-buddy';
     $this['config_defaults'] = array('repository-connector.username' => '', 'repository-connector.password' => '');
     $this['process_factory'] = function () {
         return new ProcessFactory();
     };
     $this['merge_source_detector'] = function () {
         $merge_source_detector = new MergeSourceDetectorAggregator(0);
         $merge_source_detector->add(new ClassicMergeSourceDetector(0));
         $merge_source_detector->add(new InPortalMergeSourceDetector(50));
         return $merge_source_detector;
     };
     $this['cache_manager'] = function ($c) {
         return new CacheManager($c['working_directory']);
     };
     $this['revision_log_factory'] = function ($c) {
         return new RevisionLogFactory($c['repository_connector'], $c['cache_manager'], $c['io']);
     };
     $this['revision_list_parser'] = function () {
         return new RevisionListParser();
     };
     $this['repository_connector'] = function ($c) {
         return new Connector($c['config_editor'], $c['process_factory'], $c['io'], $c['cache_manager']);
     };
     $this['date_helper'] = function () {
         return new DateHelper();
     };
     $this['editor'] = function () {
         return new InteractiveEditor();
     };
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 public function __construct(array $values = array())
 {
     parent::__construct($values);
     $this['app_name'] = 'Jira-CLI';
     $this['app_version'] = '@git-version@';
     $this['working_directory_sub_folder'] = '.jira-cli';
     $this['config_defaults'] = array('jira.url' => '', 'jira.username' => '', 'jira.password' => '', 'cache.provider' => '');
     $this['cache'] = function ($c) {
         /** @var ConfigEditor $config_editor */
         $config_editor = $c['config_editor'];
         $cache_provider = $config_editor->get('cache.provider');
         $cache_factory = new CacheFactory('jira_url:' . $config_editor->get('jira.url'));
         return $cache_factory->create('chain', array('array', $cache_provider));
     };
     $this['jira_api'] = function ($c) {
         /** @var ConfigEditor $config_editor */
         $config_editor = $c['config_editor'];
         $authentication = new Basic($config_editor->get('jira.username'), $config_editor->get('jira.password'));
         $api = new JiraApi($config_editor->get('jira.url'), $authentication);
         $api->setCache($c['cache']);
         return $api;
     };
     $this['backportable_issue_cloner'] = function ($c) {
         return new BackportableIssueCloner($c['jira_api']);
     };
     $this['changelog_issue_cloner'] = function ($c) {
         return new ChangeLogIssueCloner($c['jira_api']);
     };
 }
예제 #3
0
 /**
  * {@inheritdoc}
  */
 public function __construct(array $values = array())
 {
     parent::__construct($values);
     $this['app_name'] = '{Example-App}';
     $this['app_version'] = '@git-version@';
     $this['working_directory_sub_folder'] = '.{example-app}';
     $this['config_defaults'] = array();
 }
예제 #4
0
 /**
  * {@inheritdoc}
  */
 public function __construct(array $values = array())
 {
     parent::__construct($values);
     $this['app_name'] = 'Code-Insight';
     $this['app_version'] = '@git-version@';
     $this['working_directory_sub_folder'] = '.code-insight';
     $this['config_defaults'] = array();
     $this['project_root_folder'] = function () {
         return dirname(dirname(__DIR__));
     };
     $this['migration_manager'] = function ($c) {
         $migrations_directory = $c['project_root_folder'] . '/migrations';
         $migration_manager = new MigrationManager($migrations_directory, $c);
         $migration_manager->registerMigrationRunner(new SqlMigrationRunner());
         $migration_manager->registerMigrationRunner(new PhpMigrationRunner());
         return $migration_manager;
     };
     $this['db_manager'] = function ($c) {
         return new DatabaseManager($c['migration_manager']);
     };
     $this['knowledge_base_factory'] = function ($c) {
         return new KnowledgeBaseFactory($c['db_manager']);
     };
 }
예제 #5
0
    /**
     * {@inheritdoc}
     */
    public function __construct(array $values = array())
    {
        parent::__construct($values);
        $this['app_name'] = 'SVN-Buddy';
        $this['app_version'] = '@git-version@';
        $this['working_directory_sub_folder'] = '.svn-buddy';
        $this['config_defaults'] = array('repository-connector.username' => '', 'repository-connector.password' => '', 'repository-connector.last-revision-cache-duration' => '10 minutes', 'update-channel' => 'stable');
        $this->extend('output', function ($output) {
            /** @var OutputInterface $output */
            $output->getFormatter()->setStyle('debug', new OutputFormatterStyle('white', 'magenta'));
            return $output;
        });
        $this['process_factory'] = function () {
            return new ProcessFactory();
        };
        $this['merge_source_detector'] = function () {
            $merge_source_detector = new MergeSourceDetectorAggregator(0);
            $merge_source_detector->add(new ClassicMergeSourceDetector(0));
            $merge_source_detector->add(new InPortalMergeSourceDetector(50));
            return $merge_source_detector;
        };
        $this['repository_url_resolver'] = function ($c) {
            return new UrlResolver($c['repository_connector']);
        };
        $this['cache_manager'] = function ($c) {
            return new CacheManager($c['working_directory'], $c['size_helper'], $c['io']);
        };
        $this['statement_profiler'] = function () {
            $statement_profiler = new StatementProfiler();
            // The "AbstractPlugin::getLastRevision" method.
            $statement_profiler->ignoreDuplicateStatement('SELECT LastRevision FROM PluginData WHERE Name = :name');
            // The "AbstractPlugin::getProject" method.
            $statement_profiler->ignoreDuplicateStatement('SELECT Id FROM Projects WHERE Path = :path');
            // The "AbstractDatabaseCollectorPlugin::getProjects" method.
            $statement_profiler->ignoreDuplicateStatement('SELECT Path, Id AS PathId, RevisionAdded, RevisionDeleted, RevisionLastSeen
				FROM Paths
				WHERE PathHash IN (:path_hashes)');
            // The "ProjectsPlugin::createRepositoryWideProject" method.
            $statement_profiler->ignoreDuplicateStatement('SELECT Id FROM Paths WHERE ProjectPath = :project_path LIMIT 100');
            $statement_profiler->setActive(true);
            $statement_profiler->trackDuplicates(false);
            return $statement_profiler;
        };
        $this['project_root_folder'] = function () {
            return dirname(dirname(__DIR__));
        };
        $this['migration_manager'] = function ($c) {
            $migrations_directory = $c['project_root_folder'] . '/migrations';
            $migration_manager = new MigrationManager($migrations_directory, $c);
            $migration_manager->registerMigrationRunner(new SqlMigrationRunner());
            $migration_manager->registerMigrationRunner(new PhpMigrationRunner());
            return $migration_manager;
        };
        $this['db_manager'] = function ($c) {
            return new DatabaseManager($c['working_directory'], $c['migration_manager'], $c['statement_profiler']);
        };
        $this['revision_log_factory'] = function ($c) {
            return new RevisionLogFactory($c['repository_connector'], $c['db_manager'], $c['log_message_parser_factory']);
        };
        $this['log_message_parser_factory'] = function () {
            return new LogMessageParserFactory();
        };
        $this['revision_list_parser'] = function () {
            return new RevisionListParser();
        };
        $this['revision_printer'] = function ($c) {
            return new RevisionPrinter($c['date_helper'], $c['output_helper']);
        };
        $this['repository_connector'] = function ($c) {
            return new Connector($c['config_editor'], $c['process_factory'], $c['io'], $c['cache_manager'], $c['revision_list_parser']);
        };
        $this['commit_message_builder'] = function ($c) {
            return new CommitMessageBuilder($c['working_copy_conflict_tracker']);
        };
        $this['working_copy_resolver'] = function ($c) {
            return new WorkingCopyResolver($c['repository_connector']);
        };
        $this['working_copy_conflict_tracker'] = function ($c) {
            return new WorkingCopyConflictTracker($c['repository_connector'], $c['command_config']);
        };
        $this['merge_template_factory'] = function ($c) {
            $factory = new MergeTemplateFactory();
            $repository_connector = $c['repository_connector'];
            $revision_log_factory = $c['revision_log_factory'];
            $factory->add(new GroupByRevisionMergeTemplate($repository_connector, $revision_log_factory));
            $factory->add(new SummaryMergeTemplate($repository_connector, $revision_log_factory));
            $factory->add(new EmptyMergeTemplate($repository_connector, $revision_log_factory));
            return $factory;
        };
        $this['command_config'] = function ($c) {
            return new CommandConfig($c['config_editor'], $c['working_copy_resolver']);
        };
        $this['date_helper'] = function () {
            return new DateHelper();
        };
        $this['size_helper'] = function () {
            return new SizeHelper();
        };
        $this['output_helper'] = function () {
            return new OutputHelper();
        };
        $this['editor'] = function () {
            return new InteractiveEditor();
        };
    }