当前位置: 首页>>代码示例>>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;未经允许,请勿转载。