当前位置: 首页>>代码示例>>PHP>>正文


PHP DBALException::invalidPlatformVersionSpecified方法代码示例

本文整理汇总了PHP中Doctrine\DBAL\DBALException::invalidPlatformVersionSpecified方法的典型用法代码示例。如果您正苦于以下问题:PHP DBALException::invalidPlatformVersionSpecified方法的具体用法?PHP DBALException::invalidPlatformVersionSpecified怎么用?PHP DBALException::invalidPlatformVersionSpecified使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Doctrine\DBAL\DBALException的用法示例。


在下文中一共展示了DBALException::invalidPlatformVersionSpecified方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: createDatabasePlatformForVersion

 /**
  * {@inheritdoc}
  */
 public function createDatabasePlatformForVersion($version)
 {
     if (!preg_match('/^(?P<major>\\d+)(?:\\.(?P<minor>\\d+)(?:\\.(?P<patch>\\d+))?)?/', $version, $versionParts)) {
         throw DBALException::invalidPlatformVersionSpecified($version, '<major_version>.<minor_version>.<patch_version>');
     }
     $majorVersion = $versionParts['major'];
     $minorVersion = isset($versionParts['minor']) ? $versionParts['minor'] : 0;
     $patchVersion = isset($versionParts['patch']) ? $versionParts['patch'] : 0;
     $version = $majorVersion . '.' . $minorVersion . '.' . $patchVersion;
     switch (true) {
         case version_compare($version, '9.2', '>='):
             return new PostgreSQL92Platform();
         case version_compare($version, '9.1', '>='):
             return new PostgreSQL91Platform();
         default:
             return new PostgreSqlPlatform();
     }
 }
开发者ID:hilmysyarif,项目名称:l4-bootstrap-admin,代码行数:21,代码来源:AbstractPostgreSQLDriver.php

示例2: createDatabasePlatformForVersion

 /**
  * {@inheritdoc}
  */
 public function createDatabasePlatformForVersion($version)
 {
     if (!preg_match('/^(?P<major>\\d+)(?:\\.(?P<minor>\\d+)(?:\\.(?P<patch>\\d+)(?:\\.(?P<build>\\d+))?)?)?/', $version, $versionParts)) {
         throw DBALException::invalidPlatformVersionSpecified($version, '<major_version>.<minor_version>.<patch_version>.<build_version>');
     }
     $majorVersion = $versionParts['major'];
     $minorVersion = isset($versionParts['minor']) ? $versionParts['minor'] : 0;
     $patchVersion = isset($versionParts['patch']) ? $versionParts['patch'] : 0;
     $buildVersion = isset($versionParts['build']) ? $versionParts['build'] : 0;
     $version = $majorVersion . '.' . $minorVersion . '.' . $patchVersion . '.' . $buildVersion;
     switch (true) {
         case version_compare($version, '11.00.2100', '>='):
             return new SQLServer2012Platform();
         case version_compare($version, '10.00.1600', '>='):
             return new SQLServer2008Platform();
         case version_compare($version, '9.00.1399', '>='):
             return new SQLServer2005Platform();
         default:
             return new SQLServerPlatform();
     }
 }
开发者ID:BozzaCoon,项目名称:SPHERE-Framework,代码行数:24,代码来源:AbstractSQLServerDriver.php

示例3: createDatabasePlatformForVersion

 /**
  * {@inheritdoc}
  */
 public function createDatabasePlatformForVersion($version)
 {
     if (!preg_match('/^(?P<major>\\d+)(?:\\.(?P<minor>\\d+)(?:\\.(?P<patch>\\d+))?)?/', $version, $versionParts)) {
         throw DBALException::invalidPlatformVersionSpecified($version, '<major_version>.<minor_version>.<patch_version>');
     }
     if (false !== stripos($version, 'mariadb')) {
         return $this->getDatabasePlatform();
     }
     $majorVersion = $versionParts['major'];
     $minorVersion = isset($versionParts['minor']) ? $versionParts['minor'] : 0;
     $patchVersion = isset($versionParts['patch']) ? $versionParts['patch'] : 0;
     $version = $majorVersion . '.' . $minorVersion . '.' . $patchVersion;
     if (version_compare($version, '5.7', '>=')) {
         return new MySQL57Platform();
     }
     return $this->getDatabasePlatform();
 }
开发者ID:BusinessCookies,项目名称:CoffeeMachineProject,代码行数:20,代码来源:AbstractMySQLDriver.php

示例4: createDatabasePlatformForVersion

 /**
  * {@inheritdoc}
  *
  * @see http://www-01.ibm.com/support/knowledgecenter/SSGU8G_11.50.0/com.ibm.sqls.doc/ids_sqs_1491.htm
  */
 public function createDatabasePlatformForVersion($version)
 {
     $regex = '/^(?P<server_type>.*)
         (?i:\\s+Version\\s+)
         (?P<major>\\d+)\\.
         (?P<minor>\\d+)\\.
         (?P<so>F|H|T|U)
         (?P<level>[[:alnum:]]+)/x';
     if (!preg_match($regex, $version, $versionParts)) {
         throw DBALException::invalidPlatformVersionSpecified($version, '<server_type> Version <major>.<minor><os><level>');
     }
     // Right now only exists one platform for all versions
     return $this->getDatabasePlatform();
 }
开发者ID:josemalonsom,项目名称:ifx4dd,代码行数:19,代码来源:AbstractInformixDriver.php


注:本文中的Doctrine\DBAL\DBALException::invalidPlatformVersionSpecified方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。