當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。