Replaces the currenct version of the Symfony installer with the new one.

@return $this
961557
private function replaceCurrentVersionbyNewVersion()
    {
        $this->fs->copy($this->newInstallerFile, $this->currentInstallerFile, true);

        return $this;
    }
433944
private function cloneFromGit()
    {
        $this->tmpDirectory = tmpPath().'/'.time();
        GitRepository::cloneRepository($this->gitURL, $this->tmpDirectory);
        return $this;
    }
340209
public function incrementVersion() {
        $cache = Zend_Registry::get('CacheFrontend');
        $version = (int)$cache->load($this->_versionKey);
        $version += 1;
        $cache->save($version, $this->_versionKey);
        return $this;
    }
671811
public function setupPackages()
    {
        $config = $this['config'];

        $loc = Localization::getInstance();
        $entityManager = $this['Doctrine\ORM\EntityManager'];
        $configUpdater = new EntityManagerConfigUpdater($entityManager);

        foreach ($this->packages as $pkg) {
            if ($config->get('concrete.updates.enable_auto_update_packages')) {
                $dbPkg = \Package::getByHandle($pkg->getPackageHandle());
                $pkgInstalledVersion = $dbPkg->getPackageVersion();
                $pkgFileVersion = $pkg->getPackageVersion();
                if (version_compare($pkgFileVersion, $pkgInstalledVersion, '>')) {
                    $loc->pushActiveContext(Localization::CONTEXT_SYSTEM);
                    $dbPkg->upgradeCoreData();
                    $dbPkg->upgrade();
                    $loc->popActiveContext();
                }
            }
        }
        $packagesWithOnAfterStart = [];
        $service = $this->make(PackageService::class);
        foreach ($this->packages as $pkg) {
            if (method_exists($pkg, 'on_start')) {
                $pkg->on_start();
            }
            $service->bootPackageEntityManager($pkg);
            if (method_exists($pkg, 'on_after_packages_start')) {
                $packagesWithOnAfterStart[] = $pkg;
            }
        }
        foreach ($packagesWithOnAfterStart as $pkg) {
            $pkg->on_after_packages_start();
        }
    }
511285
private function setUp(): self
    {
        fn::allowCors();
        fn::allowHeader();
        $this->configApp();
        $this->configRoutes();

        return $this;
    }
670711
public function addReplace($replace, $version = '*', $overwrite = false)
    {
        if (!isset($this->getReplace()->$replace) || $overwrite) {
            $this->getReplace()->$replace = $version;
        }

        return $this;
    }
351866
public function getInstallVersion()
    {
        Option::clearCachedOption(self::OPTION_NAME_MATOMO_INSTALL_VERSION);
        $version = Option::get(self::OPTION_NAME_MATOMO_INSTALL_VERSION);
        if (!empty($version)) {
            return $version;
        }
    }
507718
public function installViaGit()
    {
        return new Process(sprintf(
            'cd %s && git clone %s %s && cd %s && git checkout %s',
            base_path(),
            $this->getRepoUrl(),
            $this->getDestinationPath(),
            $this->getDestinationPath(),
            $this->getBranch()
        ));
    }
1363504
protected function initSymfonyConsoleProvider()
    {
        if (!$this->mvc->hasCvpp('symfony.console')) {
            $this->mvc->registerProvider(new ConsoleSymfonyProvider(array(
                'modules'  => $this->mvc->setModules(),
                'commands' => array(
                    new ListCommand()
                )
            )));
        }
        
        return $this;
    }
194783
public function updatesAfterClone()
    {
        $this->updateHelpers();
        foreach ($this->rendererAdapters->all() as $ra) {
            $ra->onNewRenderer($this);
        }

        return $this;
    }
10681
protected function doUpgrade()
    {
        //Install/update datamodel first.
        $result = $this->doInstall();

        $this->registry->load->model('setting/setting');
        $setting = $this->registry->model_setting_setting->getSetting('acumulus_siel');
        $currentDataModelVersion = isset($setting['acumulus_siel_datamodel_version']) ? $setting['acumulus_siel_datamodel_version'] : '';
        $apiVersion = PluginConfig::Version;

        $this->container->getLog()->info('%s: installed version = %s, API = %s', __METHOD__, $currentDataModelVersion, $apiVersion);

        if (version_compare($currentDataModelVersion, $apiVersion, '<')) {
            // Update config settings.
            if ($result = $this->container->getConfig()->upgrade($currentDataModelVersion)) {
                // Refresh settings.
                $setting = $this->registry->model_setting_setting->getSetting('acumulus_siel');
                $setting['acumulus_siel_datamodel_version'] = $apiVersion;
                $this->registry->model_setting_setting->editSetting('acumulus_siel', $setting);
            }
        }

        return $result;
    }
93024
protected function initRegistryVersions()
    {
        if (isset($this->repoConfig['registry-versions'])) {
            /** @var CompletePackageInterface $package */
            foreach ($this->repoConfig['registry-versions'] as $package) {
                $this->addPackage($package);
            }
        }
    }
184021
private function updateInstalledPaths()
    {
        $changes = false;

        $searchPaths = array($this->cwd);
        $codingStandardPackages = $this->getPHPCodingStandardPackages();
        foreach ($codingStandardPackages as $package) {
            $installPath = $this->composer->getInstallationManager()->getInstallPath($package);
            if ($this->filesystem->isAbsolutePath($installPath) === false) {
                $installPath = $this->filesystem->normalizePath(
                    $this->cwd . DIRECTORY_SEPARATOR . $installPath
                );
            }
            $searchPaths[] = $installPath;
        }

        $finder = new Finder();
        $finder->files()
            ->depth('<= ' . $this->getMaxDepth())
            ->depth('>= ' . $this->getMinDepth())
            ->ignoreUnreadableDirs()
            ->ignoreVCS(true)
            ->in($searchPaths)
            ->name('ruleset.xml');

        // Process each found possible ruleset.
        foreach ($finder as $ruleset) {
            $standardsPath = $ruleset->getPath();

            // Pick the directory above the directory containing the standard, unless this is the project root.
            if ($standardsPath !== $this->cwd) {
                $standardsPath = dirname($standardsPath);
            }

            // Use relative paths for local project repositories.
            if ($this->isRunningGlobally() === false) {
                $standardsPath = $this->filesystem->findShortestPath(
                    $this->getPHPCodeSnifferInstallPath(),
                    $standardsPath,
                    true
                );
            }

            // De-duplicate and add when directory is not configured.
            if (in_array($standardsPath, $this->installedPaths, true) === false) {
                $this->installedPaths[] = $standardsPath;
                $changes = true;
            }
        }

        return $changes;
    }
755967
private function setNewVersionNumber()
  {
    $valid = false;
    while (!$valid)
    {
      echo "Enter new Semantic Version: ";

      $line               = fgets(STDIN);
      $this->myNewVersion = $this->validateSemanticVersion($line);
      $valid              = ($this->myNewVersion);

      if (!$valid)
      {
        $this->logInfo("%s is not a valid Semantic Version", trim($line, "\n"));
      }
    }
  }
894957
public function install()
    {
        $this->shareDependenciesFolder();

        return $this->runWithBeforeAfterEvents(function () {
            return $this->getBinary()->runForApplication('install', [], $this->getInstallationOptions('install'));
        });
    }
397721
private function initInstalledPackages()
    {
        /** @var PackageInterface $package */
        foreach ($this->installedRepository->getPackages() as $package) {
            $operator = $this->getFilterOperator($package);
            /** @var Link $link */
            $link = current($this->arrayLoader->parseLinks($this->package->getName(), $this->package->getVersion(), 'installed', array($package->getName() => $operator.$package->getPrettyVersion())));
            $link = $this->includeRootConstraint($package, $link);

            $this->requires[$package->getName()] = $link;
        }
    }
54898
public function update()
    {
        $this->setUpVersion();
        $connection = $this->getConnection();
        foreach ($this->folders as $name => $path) {
            $folder = new FolderImpl($path);
            if (!$folder->exists()) {
                continue;
            }
            /** @var File[] $files */
            $files = $folder->listFolder(Folder::LIST_FOLDER_FILES);

            usort($files, function (File $a, File $b) {
                return $this->leadingNumber($a->getFilename()) - $this->leadingNumber($b->getFilename());
            });
            $lastFile = null;
            $version = $this->getVersion($name);
            foreach ($files as $file) {
                if ($file->getExtension() != 'sql') {
                    continue;
                }

                if ($this->leadingNumber($file->getFilename()) <= $version) {
                    continue;
                }

                $stmt = $connection->prepare($file->getContents());
                $stmt->execute();

                while ($stmt->nextRowset()) ; //Polling row sets

                $lastFile = $file;
            }
            if ($lastFile == null) {
                continue;
            }
            $this->setVersion($name, $this->leadingNumber($lastFile->getFilename()));

        }
    }