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


PHP IDBConnection::tableExists方法代码示例

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


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

示例1: assertTableNotExist

	/**
	 * @param string $table
	 */
	public function assertTableNotExist($table) {
		if ($this->connection->getDatabasePlatform() instanceof SqlitePlatform) {
			// sqlite removes the tables after closing the DB
			$this->assertTrue(true);
		} else {
			$this->assertFalse($this->connection->tableExists($table), 'Table ' . $table . ' doesnt exists.');
		}
	}
开发者ID:ninjasilicon,项目名称:core,代码行数:11,代码来源:connection.php

示例2: testRun

 public function testRun()
 {
     $this->assertFalse($this->connection->tableExists('sharing'), 'Asserting that the table oc_sharing does not exist before repairing');
     $this->assertTrue($this->connection->tableExists('permissions'), 'Asserting that the table oc_permissions does exist before repairing');
     $repair = new \OC\Repair\DropOldTables($this->connection);
     $repair->run();
     $this->assertFalse($this->connection->tableExists('sharing'), 'Asserting that the table oc_sharing does not exist after repairing');
     $this->assertFalse($this->connection->tableExists('permissions'), 'Asserting that the table oc_permissions does not exist after repairing');
 }
开发者ID:evanjt,项目名称:core,代码行数:9,代码来源:dropoldtables.php

示例3: run

 /**
  * Run repair step.
  * Must throw exception on error.
  *
  * @throws \Exception in case of failure
  */
 public function run()
 {
     foreach ($this->oldDatabaseTables() as $tableName) {
         if ($this->connection->tableExists($tableName)) {
             $this->emit('\\OC\\Repair', 'info', [sprintf('Table %s has been deleted', $tableName)]);
             $this->connection->dropTable($tableName);
         }
     }
 }
开发者ID:evanjt,项目名称:core,代码行数:15,代码来源:dropoldtables.php

示例4: testRun

 public function testRun()
 {
     $this->assertFalse($this->connection->tableExists('sharing'), 'Asserting that the table oc_sharing does not exist before repairing');
     $this->assertTrue($this->connection->tableExists('permissions'), 'Asserting that the table oc_permissions does exist before repairing');
     /** @var IOutput | \PHPUnit_Framework_MockObject_MockObject $outputMock */
     $outputMock = $this->getMockBuilder('\\OCP\\Migration\\IOutput')->disableOriginalConstructor()->getMock();
     $repair = new \OC\Repair\DropOldTables($this->connection);
     $repair->run($outputMock);
     $this->assertFalse($this->connection->tableExists('sharing'), 'Asserting that the table oc_sharing does not exist after repairing');
     $this->assertFalse($this->connection->tableExists('permissions'), 'Asserting that the table oc_permissions does not exist after repairing');
 }
开发者ID:rchicoli,项目名称:owncloud-core,代码行数:11,代码来源:DropOldTablesTest.php

示例5: run

 /**
  * Run repair step.
  * Must throw exception on error.
  *
  * @throws \Exception in case of failure
  */
 public function run(IOutput $output)
 {
     $tables = $this->oldDatabaseTables();
     $output->startProgress(count($tables));
     foreach ($this->oldDatabaseTables() as $tableName) {
         if ($this->connection->tableExists($tableName)) {
             $this->connection->dropTable($tableName);
         }
         $output->advance(1, "Drop old database table: {$tableName}");
     }
     $output->finishProgress();
 }
开发者ID:GitHubUser4234,项目名称:core,代码行数:18,代码来源:DropOldTables.php

示例6: __destruct

 public function __destruct()
 {
     try {
         $this->cleanEmptyLocks();
     } catch (\PDOException $e) {
         // If the table is missing, the clean up was successful
         if ($this->connection->tableExists('file_locks')) {
             throw $e;
         }
     }
 }
开发者ID:0x17de,项目名称:core,代码行数:11,代码来源:dblockingprovider.php

示例7: cleanExpiredLocks

 /**
  * cleanup empty locks
  */
 public function cleanExpiredLocks()
 {
     $expire = $this->timeFactory->getTime();
     try {
         $this->connection->executeUpdate('DELETE FROM `*PREFIX*file_locks` WHERE `ttl` < ?', [$expire]);
     } catch (\Exception $e) {
         // If the table is missing, the clean up was successful
         if ($this->connection->tableExists('file_locks')) {
             throw $e;
         }
     }
 }
开发者ID:stweil,项目名称:owncloud-core,代码行数:15,代码来源:DBLockingProvider.php

示例8: tableExists

 /**
  * Check if a table exists
  *
  * @param string $table table name without the prefix
  * @return bool
  */
 public function tableExists($table)
 {
     return $this->connection->tableExists($table);
 }
开发者ID:farukuzun,项目名称:core-1,代码行数:10,代码来源:db.php

示例9: setup

 public function setup()
 {
     if (!$this->dbConnection->tableExists($this->sourceCalendarTable)) {
         throw new \DomainException('Calendar tables are missing. Nothing to do.');
     }
 }
开发者ID:ZverAleksey,项目名称:core,代码行数:6,代码来源:calendaradapter.php


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