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


PHP Connection::getDatabasePlatform方法代码示例

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


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

示例1: updateStatus

 /**
  * Update status
  *
  * @param string $nonce
  * @param string $apiUrls
  *
  * @return int
  */
 public function updateStatus($nonce, $apiUrls)
 {
     // Truncate table
     $this->con->executeQuery($this->con->getDatabasePlatform()->getTruncateTableSQL($this->tables['status']));
     // Insert new row
     return $this->con->insert($this->tables['status'], array('nonce' => $nonce, 'noncets' => time(), 'apiurls' => $apiUrls, 'modified' => new \DateTime()), array(\PDO::PARAM_STR, \PDO::PARAM_INT, \PDO::PARAM_STR, 'datetime'));
 }
开发者ID:albancrommer,项目名称:acmephpc,代码行数:15,代码来源:DoctrineDbal.php

示例2: truncateTable

 protected function truncateTable($tableName)
 {
     if (!in_array($tableName, $this->truncatedTables)) {
         $query = $this->connection->getDatabasePlatform()->getTruncateTableSql($tableName, true);
         $this->connection->executeUpdate($query);
         $this->truncatedTables[] = $tableName;
     }
 }
开发者ID:fvilpoix,项目名称:php-common,代码行数:8,代码来源:DatabaseTools.php

示例3: apply

 /**
  * {@inheritdoc}
  */
 public function apply($fromAlias, $fromIdentifier, $resourcePrefix, array $requesterIdentifiers, $mask, array $orX = [])
 {
     $this->queryBuilder->leftJoin($fromAlias, $this->getAclSchema()->getPermissionsTableName(), 'acl_p', 'acl_p.resource = ' . $this->connection->getDatabasePlatform()->getConcatExpression(':acl_prefix', $fromAlias . '.' . $fromIdentifier));
     $orX[] = 'acl_p.requester IN (:acl_identifiers) AND :acl_mask = (acl_p.mask & :acl_mask)';
     $this->queryBuilder->andWhere(implode(' OR ', $orX));
     $this->queryBuilder->setParameter('acl_prefix', $resourcePrefix, \PDO::PARAM_STR)->setParameter('acl_identifiers', $requesterIdentifiers, Connection::PARAM_STR_ARRAY)->setParameter('acl_mask', $mask, \PDO::PARAM_INT);
     return $this->queryBuilder;
 }
开发者ID:alexdpy,项目名称:acl,代码行数:11,代码来源:DoctrineDbalAclFilter.php

示例4: __construct

 /**
  * Initializes a new instance of a class derived from AbstractCollectionPersister.
  *
  * @param \Doctrine\ORM\EntityManager $em
  */
 public function __construct(EntityManager $em)
 {
     $this->em = $em;
     $this->uow = $em->getUnitOfWork();
     $this->conn = $em->getConnection();
     $this->platform = $this->conn->getDatabasePlatform();
     $this->quoteStrategy = $em->getConfiguration()->getQuoteStrategy();
 }
开发者ID:svobodni,项目名称:web,代码行数:13,代码来源:AbstractCollectionPersister.php

示例5: initialize

 /**
  * Initialization of data required to run current command
  * @param InputInterface $input
  * @param OutputInterface $output
  */
 protected function initialize(InputInterface $input, OutputInterface $output)
 {
     $this->kernelDir = $this->getContainer()->getParameter('kernel.root_dir');
     $this->entityManager = $this->getContainer()->get('doctrine.orm.entity_manager');
     $this->connection = $this->entityManager->getConnection();
     $this->dbPlatform = $this->connection->getDatabasePlatform();
     $this->output = $output;
 }
开发者ID:gitter-badger,项目名称:diamantedesk-application,代码行数:13,代码来源:FixturesPurgeCommand.php

示例6: dropTable

 public function dropTable()
 {
     $schema = $this->getTableSchema();
     $queries = $schema->toDropSql($this->connection->getDatabasePlatform());
     foreach ($queries as $query) {
         $this->connection->prepare($query)->execute();
     }
 }
开发者ID:cyantree,项目名称:grout,代码行数:8,代码来源:DoctrineBucket.php

示例7: getSystemInfo

 /**
  * Returns the system information:
  *  - cpu information
  *  - memory size
  *  - php version
  *  - php accelerator info
  *  - database related info.
  *
  * @return array
  */
 public function getSystemInfo()
 {
     $info = ezcSystemInfo::getInstance();
     $accelerator = false;
     if ($info->phpAccelerator) {
         $accelerator = ['name' => $info->phpAccelerator->name, 'url' => $info->phpAccelerator->url, 'enabled' => $info->phpAccelerator->isEnabled, 'versionString' => $info->phpAccelerator->versionString];
     }
     return ['cpuType' => $info->cpuType, 'cpuSpeed' => $info->cpuSpeed, 'cpuCount' => $info->cpuCount, 'memorySize' => $info->memorySize, 'phpVersion' => phpversion(), 'phpAccelerator' => $accelerator, 'database' => ['type' => $this->connection->getDatabasePlatform()->getName(), 'name' => $this->connection->getDatabase(), 'host' => $this->connection->getHost(), 'username' => $this->connection->getUsername()]];
 }
开发者ID:emodric,项目名称:PlatformUIBundle,代码行数:19,代码来源:SystemInfoHelper.php

示例8: setUpDBALTypes

 /**
  * Configures DBAL types required in tests
  */
 protected function setUpDBALTypes()
 {
     if (Type::hasType('jsonb')) {
         Type::overrideType('jsonb', 'Boldtrn\\JsonbBundle\\Types\\JsonbArrayType');
     } else {
         Type::addType('jsonb', 'Boldtrn\\JsonbBundle\\Types\\JsonbArrayType');
     }
     $this->connection->getDatabasePlatform()->registerDoctrineTypeMapping('JSONB', 'jsonb');
 }
开发者ID:adrienbrault,项目名称:JsonbBundle,代码行数:12,代码来源:BaseTest.php

示例9: __construct

 public function __construct(Version $version)
 {
     $config = $version->getConfiguration();
     $this->version = $version;
     $this->connection = $config->getConnection();
     $this->sm = $this->connection->getSchemaManager();
     $this->platform = $this->connection->getDatabasePlatform();
     $this->outputWriter = $config->getOutputWriter();
 }
开发者ID:saberyounis,项目名称:Sonata-Project,代码行数:9,代码来源:AbstractMigration.php

示例10: setUp

 public function setUp()
 {
     $this->connection = \OC_DB::getConnection();
     if (!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySqlPlatform) {
         $this->markTestSkipped("Test only relevant on MySql");
     }
     $dbPrefix = \OC::$server->getConfig()->getSystemValue("dbtableprefix");
     $this->tableName = uniqid($dbPrefix . "_enum_bit_test");
     $this->connection->exec("CREATE TABLE {$this->tableName}(b BIT,  e ENUM('1','2','3','4'))");
 }
开发者ID:Combustible,项目名称:core,代码行数:10,代码来源:mysqlmigration.php

示例11: setUp

 public function setUp()
 {
     $this->connection = \OC_DB::getConnection();
     if (!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\SqlitePlatform) {
         $this->markTestSkipped("Test only relevant on Sqlite");
     }
     $dbPrefix = \OC::$server->getConfig()->getSystemValue("dbtableprefix");
     $this->tableName = uniqid($dbPrefix . "_enum_bit_test");
     $this->connection->exec("CREATE TABLE {$this->tableName}(t0 tinyint unsigned, t1 tinyint)");
 }
开发者ID:Combustible,项目名称:core,代码行数:10,代码来源:sqlitemigration.php

示例12: generateChangeScript

 /**
  * @param \Doctrine\DBAL\Schema\Schema $targetSchema
  * @return string
  */
 public function generateChangeScript(Schema $targetSchema)
 {
     $schemaDiff = $this->getDiff($targetSchema, $this->connection);
     $script = '';
     $sqls = $schemaDiff->toSql($this->connection->getDatabasePlatform());
     foreach ($sqls as $sql) {
         $script .= $this->convertStatementToScript($sql);
     }
     return $script;
 }
开发者ID:Romua1d,项目名称:core,代码行数:14,代码来源:migrator.php

示例13: shouldBeRun

 /**
  * {@inheritdoc}
  */
 public function shouldBeRun()
 {
     $schemaManager = $this->connection->getSchemaManager();
     if (!$schemaManager->tablesExist('tl_member')) {
         return false;
     }
     $sql = $this->connection->getDatabasePlatform()->getListTableIndexesSQL('tl_member', $this->connection->getDatabase());
     $index = $this->connection->fetchAssoc($sql . " AND INDEX_NAME = 'username'");
     return '0' !== $index['Non_Unique'];
 }
开发者ID:aschempp,项目名称:contao-installation-bundle,代码行数:13,代码来源:Version350Update.php

示例14: processRow

 /**
  * @param array $row
  */
 private function processRow(array $row)
 {
     $fields = Type::getType(Type::TARRAY)->convertToPHPValue($row['data'], $this->connection->getDatabasePlatform());
     foreach ($fields as $field => $values) {
         $fieldType = $this->getFieldType($row['entity_id'], $field);
         $dataType = $this->normalizeDataTypeName($fieldType);
         $data = ['audit_id' => $row['id'], 'data_type' => $dataType, 'field' => $field, sprintf('old_%s', $dataType) => $this->parseValue($values['old']), sprintf('new_%s', $dataType) => $this->parseValue($values['new'])];
         $types = ['integer', 'string', 'string', $dataType, $dataType];
         $this->connection->insert('oro_audit_field', $data, $types);
     }
 }
开发者ID:nmallare,项目名称:platform,代码行数:14,代码来源:MigrateAuditFieldQuery.php

示例15: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->config = \OC::$server->getConfig();
     $this->connection = \OC::$server->getDatabaseConnection();
     if ($this->connection->getDatabasePlatform() instanceof OraclePlatform) {
         $this->markTestSkipped('DB migration tests are not supported on OCI');
     }
     $this->manager = new \OC\DB\MDB2SchemaManager($this->connection);
     $this->tableName = strtolower($this->getUniqueID($this->config->getSystemValue('dbtableprefix', 'oc_') . 'test_'));
 }
开发者ID:kenwi,项目名称:core,代码行数:11,代码来源:migrator.php


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