當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Configuration::getAvailableVersions方法代碼示例

本文整理匯總了PHP中Doctrine\DBAL\Migrations\Configuration\Configuration::getAvailableVersions方法的典型用法代碼示例。如果您正苦於以下問題:PHP Configuration::getAvailableVersions方法的具體用法?PHP Configuration::getAvailableVersions怎麽用?PHP Configuration::getAvailableVersions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Doctrine\DBAL\Migrations\Configuration\Configuration的用法示例。


在下文中一共展示了Configuration::getAvailableVersions方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: markVersionsMigrated

 private function markVersionsMigrated()
 {
     foreach ($this->migrations->getAvailableVersions() as $versionIdentifier) {
         $version = $this->migrations->getVersion($versionIdentifier);
         $version->markMigrated();
     }
 }
開發者ID:Axxon,項目名稱:udb3-silex,代碼行數:7,代碼來源:MigrationsDecoratedDatabaseSchemaInstaller.php

示例2: __construct

 public function __construct(Configuration $configuration)
 {
     $this->configuration = $configuration;
     $this->executedMigrations = $this->configuration->getMigratedVersions();
     $this->availableMigrations = $this->configuration->getAvailableVersions();
     $this->executedUnavailableMigrations = array_diff($this->executedMigrations, $this->availableMigrations);
 }
開發者ID:ppiedaderawnet,項目名稱:concrete5,代碼行數:7,代碼來源:MigrationStatusInfosHelper.php

示例3: check

 /**
  * Perform the actual check and return a ResultInterface
  *
  * @return ResultInterface
  */
 public function check()
 {
     $availableVersions = $this->migrationConfiguration->getAvailableVersions();
     $migratedVersions = $this->migrationConfiguration->getMigratedVersions();
     $notMigratedVersions = array_diff($availableVersions, $migratedVersions);
     if (!empty($notMigratedVersions)) {
         return new Failure('Not all migrations applied', $notMigratedVersions);
     }
     $notAvailableVersion = array_diff($migratedVersions, $availableVersions);
     if (!empty($notAvailableVersion)) {
         return new Failure('Migrations applied which are not available', $notMigratedVersions);
     }
     return new Success();
 }
開發者ID:atulhere,項目名稱:zendPractice,代碼行數:19,代碼來源:DoctrineMigration.php

示例4: markVersions

 private function markVersions(InputInterface $input)
 {
     $affectedVersion = $input->getArgument('version');
     $allOption = $input->getOption('all');
     $rangeFromOption = $input->getOption('range-from');
     $rangeToOption = $input->getOption('range-to');
     if ($allOption && ($rangeFromOption !== null || $rangeToOption !== null)) {
         throw new \InvalidArgumentException('Options --all and --range-to/--range-from both used. You should use only one of them.');
     } elseif ($rangeFromOption !== null ^ $rangeToOption !== null) {
         throw new \InvalidArgumentException('Options --range-to and --range-from should be used together.');
     }
     if ($allOption === true) {
         $availableVersions = $this->configuration->getAvailableVersions();
         foreach ($availableVersions as $version) {
             $this->mark($version, true);
         }
     } elseif ($rangeFromOption !== null && $rangeToOption !== null) {
         $availableVersions = $this->configuration->getAvailableVersions();
         foreach ($availableVersions as $version) {
             if ($version >= $rangeFromOption && $version <= $rangeToOption) {
                 $this->mark($version, true);
             }
         }
     } else {
         $this->mark($affectedVersion);
     }
 }
開發者ID:austinpapp,項目名稱:push-notifications-temp,代碼行數:27,代碼來源:VersionCommand.php

示例5: markAllAvailableVersions

 private function markAllAvailableVersions(InputInterface $input)
 {
     $version = $input->getArgument('version');
     if ($input->getOption('all') === true) {
         $availableVersions = $this->configuration->getAvailableVersions();
         foreach ($availableVersions as $version) {
             $this->mark($version, true);
         }
     } else {
         $this->mark($version);
     }
 }
開發者ID:saberyounis,項目名稱:Sonata-Project,代碼行數:12,代碼來源:VersionCommand.php

示例6: viewAction

 /**
  * @Route("/{connectionName}/")
  */
 public function viewAction($connectionName)
 {
     $connection = $this->getDoctrine()->getConnection($connectionName);
     $outputWriter = new MemoryOutputWriter();
     $configuration = new Configuration($connection);
     $configuration->setName($this->container->getParameter('doctrine_migrations.name'));
     $configuration->setOutputWriter($outputWriter);
     $configuration->setMigrationsTableName($this->container->getParameter('doctrine_migrations.table_name'));
     $configuration->setMigrationsDirectory($this->container->getParameter('doctrine_migrations.dir_name'));
     $configuration->setMigrationsNamespace($this->container->getParameter('doctrine_migrations.namespace'));
     $migration = new Migration($configuration);
     $executedMigrations = $configuration->getMigratedVersions();
     $availableMigrations = $configuration->getAvailableVersions();
     $executedUnavailableMigrations = array_diff($executedMigrations, $availableMigrations);
     foreach ($executedUnavailableMigrations as $i => $executedUnavailableMigration) {
         $executedUnavailableMigrations[$i] = $executedUnavailableMigration . ' (' . $configuration->getDateTime($executedUnavailableMigration) . ')';
     }
     $dryRun = true;
     $migration->setNoMigrationException(true);
     $sql = $migration->migrate(null, $dryRun);
     return $this->render('MarkeiDoctrineMigrationWebBundle:Migrate:view.html.twig', ['connectionName' => $connectionName, 'executedUnavailableMigrations' => $executedUnavailableMigrations, 'to' => $configuration->getLatestVersion(), 'from' => $configuration->getCurrentVersion(), 'migrations' => $sql, 'name' => $this->container->getParameter('doctrine_migrations.name')]);
 }
開發者ID:markei,項目名稱:doctrinemigrationwebbundle,代碼行數:25,代碼來源:MigrateController.php

示例7: getAvailableVersions

 public function getAvailableVersions()
 {
     $this->doRegister();
     return parent::getAvailableVersions();
 }
開發者ID:librette,項目名稱:doctrine-migrations,代碼行數:5,代碼來源:Configuration.php


注:本文中的Doctrine\DBAL\Migrations\Configuration\Configuration::getAvailableVersions方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。