コード例 #1
0
 /**
  * Imports the data from the stddb tables.sql file.
  *
  * Example/intended usage:
  *
  * <pre>
  * public function setUp() {
  *   $this->createDatabase();
  *   $db = $this->useTestDatabase();
  *   $this->importStdDB();
  *   $this->importExtensions(array('cms', 'static_info_tables', 'templavoila'));
  * }
  * </pre>
  *
  * @return void
  */
 protected function importStdDb()
 {
     $sqlFilename = t3lib_div::getFileAbsFileName(PATH_t3lib . 'stddb/tables.sql');
     $fileContent = t3lib_div::getUrl($sqlFilename);
     $this->importDatabaseDefinitions($fileContent);
     if (t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version) >= 4006000) {
         // make sure missing caching framework tables do not get into the way
         $cacheTables = t3lib_cache::getDatabaseTableDefinitions();
         $this->importDatabaseDefinitions($cacheTables);
     }
 }
コード例 #2
0
 /**
  * Gets the defined field definitions from the ext_tables.sql files.
  *
  * @return array The accordant definitions
  */
 protected function getDefinedFieldDefinitions()
 {
     $content = '';
     $rawStructureDefinitions = $this->getAllRawStructureDefinitions();
     if (t3lib_div::compat_version('4.6')) {
         // Add caching framework tables if applicable
         $rawStructureDefinitions = array_merge($rawStructureDefinitions, $this->install->getStatementArray(t3lib_cache::getDatabaseTableDefinitions(), 1, '^CREATE TABLE '));
     }
     $rawStructureString = implode(chr(10), $rawStructureDefinitions);
     if (method_exists($this->install, 'getFieldDefinitions_fileContent')) {
         $content = $this->install->getFieldDefinitions_fileContent($rawStructureString);
     } else {
         $content = $this->install->getFieldDefinitions_sqlContent($rawStructureString);
     }
     //echo $content;
     return $content;
 }