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


PHP DatabaseConnection::admin_get_tables方法代码示例

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


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

示例1: tables

 /**
  * @return array
  */
 protected function tables()
 {
     if (!isset($this->_tables)) {
         $this->_tables = array_keys($this->db->admin_get_tables());
     }
     return $this->_tables;
 }
开发者ID:electricretina,项目名称:cicbase,代码行数:10,代码来源:AbstractMigration.php

示例2: forceFlushCoreFileAndDatabaseCaches

 /**
  * Recursively delete cache directory and truncate all DB tables prefixed with 'cf_'
  */
 protected function forceFlushCoreFileAndDatabaseCaches()
 {
     // Delete typo3temp/Cache
     GeneralUtility::rmdir(PATH_site . 'typo3temp/Cache', TRUE);
     // Get all table names starting with 'cf_' and truncate them
     $tables = $this->databaseConnection->admin_get_tables();
     foreach ($tables as $table) {
         $tableName = $table['Name'];
         if (substr($tableName, 0, 3) === 'cf_') {
             $this->databaseConnection->exec_TRUNCATEquery($tableName);
         }
     }
 }
开发者ID:johannessteu,项目名称:typo3_console,代码行数:16,代码来源:CacheService.php

示例3: checkEuLdap

 /**
  * Returns TRUE if upgrade wizard for legacy EXT:eu_ldap records should be run.
  *
  * @return bool
  */
 protected function checkEuLdap()
 {
     $table = 'tx_euldap_server';
     $migrationField = 'tx_igldapssoauth_migrated';
     // We check the database table itself and not whether EXT:eu_ldap is loaded
     // because it may have been deactivated since it is not incompatible
     $existingTables = $this->databaseConnection->admin_get_tables();
     if (!isset($existingTables[$table])) {
         return FALSE;
     }
     // Ensure the column used to flag processed records is present
     $fields = $this->databaseConnection->admin_get_fields($table);
     if (!isset($fields[$migrationField])) {
         $alterTableQuery = 'ALTER TABLE ' . $table . ' ADD ' . $migrationField . ' tinyint(4) NOT NULL default \'0\'';
         // Method admin_query() will parse the query and make it compatible with DBAL, if needed
         $this->databaseConnection->admin_query($alterTableQuery);
     }
     $euLdapConfigurationRecords = $this->databaseConnection->exec_SELECTcountRows('*', $table, $migrationField . '=0');
     return $euLdapConfigurationRecords > 0;
 }
开发者ID:woehrlag,项目名称:Intranet,代码行数:25,代码来源:class.ext_update.php

示例4: getDatabaseList

 /**
  * Returns list of available databases (with access-check based on username/password)
  *
  * @param bool $initialInstallation TRUE if first installation is in progress, FALSE if upgrading or usual access
  * @return array List of available databases
  */
 protected function getDatabaseList($initialInstallation)
 {
     $this->initializeDatabaseConnection();
     $databaseArray = $this->databaseConnection->admin_get_dbs();
     // Remove mysql organizational tables from database list
     $reservedDatabaseNames = array('mysql', 'information_schema', 'performance_schema');
     $allPossibleDatabases = array_diff($databaseArray, $reservedDatabaseNames);
     // If we are upgrading we show *all* databases the user has access to
     if ($initialInstallation === false) {
         return $allPossibleDatabases;
     } else {
         // In first installation we show all databases but disable not empty ones (with tables)
         $databases = array();
         foreach ($allPossibleDatabases as $database) {
             $this->databaseConnection->setDatabaseName($database);
             $this->databaseConnection->sql_select_db();
             $existingTables = $this->databaseConnection->admin_get_tables();
             $databases[] = array('name' => $database, 'tables' => count($existingTables));
         }
         return $databases;
     }
 }
开发者ID:graurus,项目名称:testgit_t37,代码行数:28,代码来源:DatabaseSelect.php

示例5: renameDatabaseTable

 /**
  * Rename a DB  table
  *
  * @param string $oldTableName old table name
  * @param string $newTableName new table name
  * @return boolean
  */
 protected function renameDatabaseTable($oldTableName, $newTableName)
 {
     $title = 'Renaming "' . $oldTableName . '" to "' . $newTableName . '" ';
     $tables = $this->databaseConnection->admin_get_tables();
     if (isset($tables[$newTableName])) {
         $message = 'Table ' . $newTableName . ' already exists';
         $status = FlashMessage::OK;
     } elseif (!isset($tables[$oldTableName])) {
         $message = 'Table ' . $oldTableName . ' does not exist';
         $status = FlashMessage::ERROR;
     } else {
         $sql = 'RENAME TABLE ' . $oldTableName . ' TO ' . $newTableName . ';';
         if ($this->databaseConnection->admin_query($sql) === false) {
             $message = ' SQL ERROR: ' . $this->databaseConnection->sql_error();
             $status = FlashMessage::ERROR;
         } else {
             $message = 'OK!';
             $status = FlashMessage::OK;
         }
     }
     $this->messageArray[] = array($status, $title, $message);
     return $status;
 }
开发者ID:kalypso63,项目名称:news,代码行数:30,代码来源:class.ext_update.php

示例6: tableExists

 /**
  * Tests if a given table exists in current default database
  *
  * @param string $tablename Table name for which to check whether it exists
  * @param array $info Additional info, will be displayed as debug message, if a key "message" exists this will be appended to the error message
  */
 public static function tableExists($tablename, array $info = array())
 {
     self::initializeDbObj();
     $tables = self::$dbObj->admin_get_tables();
     return self::isArrayKey($tablename, $tables, $info);
 }
开发者ID:punktde,项目名称:pt_extbase,代码行数:12,代码来源:Assert.php

示例7: isTableAvailable

 /**
  * check if given table exists in current database
  * we can't check TCA or for installed extensions because dam and dam_ttcontent are not available for TYPO3 6.2
  *
  * @param $table
  * @return bool
  */
 protected function isTableAvailable($table)
 {
     $tables = $this->database->admin_get_tables();
     return array_key_exists($table, $tables);
 }
开发者ID:wernert,项目名称:t3ext-dam_falmigration,代码行数:12,代码来源:AbstractTask.php

示例8: hasOldCacheTables

 protected function hasOldCacheTables()
 {
     $tables = $this->databaseConnection->admin_get_tables();
     return isset($tables['tx_realurl_pathcache']) || isset($tables['tx_realurl_urlcache']);
 }
开发者ID:dmitryd,项目名称:typo3-realurl,代码行数:5,代码来源:class.ext_update.php

示例9: access

 /**
  * Called by the extension manager to determine if the update menu entry
  * should by showed.
  *
  * @return bool
  */
 public function access()
 {
     return array_key_exists($this->transferTable, $this->databaseConnection->admin_get_tables());
 }
开发者ID:S3b0,项目名称:project_registration,代码行数:10,代码来源:class.ext_update.php

示例10: adminGetTablesReturnAllTablesFromDatabase

 /**
  * @test
  *
  * @return void
  */
 public function adminGetTablesReturnAllTablesFromDatabase()
 {
     $result = $this->subject->admin_get_tables();
     $this->assertArrayHasKey('tt_content', $result);
     $this->assertArrayHasKey('pages', $result);
 }
开发者ID:dachcom-digital,项目名称:TYPO3.CMS,代码行数:11,代码来源:DatabaseConnectionTest.php


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