本文整理汇总了PHP中OC_DB::dropTable方法的典型用法代码示例。如果您正苦于以下问题:PHP OC_DB::dropTable方法的具体用法?PHP OC_DB::dropTable怎么用?PHP OC_DB::dropTable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OC_DB
的用法示例。
在下文中一共展示了OC_DB::dropTable方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
public function setUp()
{
if (OC_DB::tableExists('encryption_test')) {
OC_DB::dropTable('encryption_test');
}
$this->assertTableNotExist('encryption_test');
}
示例2: tearDown
protected function tearDown()
{
// do not drop the table for Oracle as it will create a bogus transaction
// that will break the following test suites requiring transactions
if (\OC::$server->getConfig()->getSystemValue('dbtype', 'sqlite') !== 'oci') {
\OC_DB::dropTable('table');
}
parent::tearDown();
}
示例3: setUp
public function setUp()
{
$this->loginHelper(self::TEST_ENCRYPTION_MIGRATION_USER1);
$this->view = new \OC\Files\View();
$this->public_share_key_id = \OCA\Files_Encryption\Helper::getPublicShareKeyId();
$this->recovery_key_id = \OCA\Files_Encryption\Helper::getRecoveryKeyId();
if (\OC_DB::tableExists('encryption_test')) {
\OC_DB::dropTable('encryption_test');
}
$this->assertTableNotExist('encryption_test');
}
示例4: dropTableEncryption
public function dropTableEncryption()
{
$tableName = $this->tableName;
if (!\OC_DB::tableExists($tableName)) {
return;
}
$sql = "select `uid`, max(`recovery_enabled`) as `recovery_enabled`, min(`migration_status`) as `migration_status` from `*PREFIX*{$tableName}` group by `uid`";
$query = \OCP\DB::prepare($sql);
$result = $query->execute(array())->fetchAll();
foreach ($result as $row) {
\OC_Preferences::setValue($row['uid'], 'files_encryption', 'recovery_enabled', $row['recovery_enabled']);
\OC_Preferences::setValue($row['uid'], 'files_encryption', 'migration_status', $row['migration_status']);
}
\OC_DB::dropTable($tableName);
}
示例5:
<?php
/**
* @author Björn Schießle <schiessle@owncloud.com>
* @author Christopher Schäpers <kondou@ts.unde.re>
* @author Morris Jobke <hey@morrisjobke.de>
* @author Thomas Müller <thomas.mueller@tmit.eu>
*
* @copyright Copyright (c) 2015, ownCloud, Inc.
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
$installedVersion = OCP\Config::getAppValue('files_trashbin', 'installed_version');
if (version_compare($installedVersion, '0.6', '<')) {
//size of the trash bin could be incorrect, remove it for all users to
//enforce a recalculation during next usage.
\OC_DB::dropTable('files_trashsize');
}
示例6:
<?php
/**
* @author Björn Schießle <schiessle@owncloud.com>
* @author Thomas Müller <thomas.mueller@tmit.eu>
* @author Victor Dubiniuk <dubiniuk@owncloud.com>
*
* @copyright Copyright (c) 2015, ownCloud, Inc.
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
$installedVersion = OCP\Config::getAppValue('files_versions', 'installed_version');
// move versions to new directory
if (version_compare($installedVersion, '1.0.4', '<')) {
\OC_DB::dropTable("files_versions");
}
// Cron job for deleting expired trash items
\OC::$server->getJobList()->add('OCA\\Files_Versions\\BackgroundJob\\ExpireVersions');
示例7: dropTestTable
protected static function dropTestTable()
{
if (\OC::$server->getConfig()->getSystemValue('dbtype', 'sqlite') !== 'oci') {
\OC_DB::dropTable('table');
}
}
示例8: tearDown
public function tearDown()
{
\OC_DB::dropTable('table');
}