Skip to content

Commit

Permalink
Merge branch 'typo3-12-reactjs' into sort-local-extensionlist
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidBruchmann authored Apr 3, 2024
2 parents 5bae8c9 + db6794d commit 0ddc058
Show file tree
Hide file tree
Showing 11 changed files with 228 additions and 244 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# Runs a single command using the runners shell
- name: "Run a one-line script"
Expand All @@ -35,7 +35,7 @@ jobs:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: "Checkout code"
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: "Setup Node"
uses: actions/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: "Checkout"
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: "Publish new version to TER"
uses: tomasnorre/typo3-upload-ter@v2
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [8.1, 8.2]
php: [8.1, 8.2, 8.3]
typo3: [^12.2]

name: P${{ matrix.php }} - T${{ matrix.typo3 }}

steps:
- name: "Checkout code"
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: "Cache dependencies"
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: ~/.composer/cache/files
key: dependencies-typo3-${{ matrix.typo3 }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ sass-lint.html
.devbox/.ddev/providers/
.devbox/.ddev/xhprof/
.devbox/.ddev/composer.lock
.phpunit.cache
coverage
.phpunit.result.cache
64 changes: 0 additions & 64 deletions Classes/Utility/ExtensionInstallationStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,72 +85,8 @@ public function getStatusMessage(): string
return $statusMessage;
}

/*public function checkForDbUpdate(string $extensionKey): void
{
$this->dbUpdateNeeded = false;
if (ExtensionManagementUtility::isLoaded($extensionKey)) {
$sqlFile = ExtensionManagementUtility::extPath($extensionKey) . 'ext_tables.sql';
if (@file_exists($sqlFile)) {
$sqlHandler = GeneralUtility::makeInstance(SqlSchemaMigrationService::class);
$sqlContent = GeneralUtility::getUrl($sqlFile);
$fieldDefinitionsFromFile = $sqlHandler->getFieldDefinitions_fileContent($sqlContent);
if (count($fieldDefinitionsFromFile)) {
$fieldDefinitionsFromCurrentDatabase = $sqlHandler->getFieldDefinitions_database();
$updateTableDefinition = $sqlHandler->getDatabaseExtra(
$fieldDefinitionsFromFile,
$fieldDefinitionsFromCurrentDatabase
);
$this->updateStatements = $sqlHandler->getUpdateSuggestions($updateTableDefinition);
if (!empty($updateTableDefinition['extra']) || !empty($updateTableDefinition['diff']) || !empty($updateTableDefinition['diff_currentValues'])) {
$this->dbUpdateNeeded = true;
}
}
}
}
}
public function performDbUpdates(array $params): array
{
$hasErrors = false;
if (!empty($params['updateStatements']) && !empty($params['extensionKey'])) {
$this->checkForDbUpdate($params['extensionKey']);
if ($this->dbUpdateNeeded) {
foreach ($this->updateStatements as $type => $statements) {
foreach ($statements as $key => $statement) {
if (in_array($type, ['change', 'add', 'create_table'])
&& in_array($key, $params['updateStatements'])
) {
$res = $this->getDatabaseConnection()->admin_query($statement);
if ($res === false) {
$hasErrors = true;
} elseif (is_resource($res) || is_a($res, mysqli_result::class)) {
$this->getDatabaseConnection()->sql_free_result($res);
}
}
}
}
}
}
if ($hasErrors) {
return ['error' => 'Database could not be updated. Please check it in the update wizzard of the install tool'];
}
return ['success' => 'Database was successfully updated'];
}*/

public function isDbUpdateNeeded(): bool
{
return $this->dbUpdateNeeded;
}

/*public function getUpdateStatements(): array
{
return $this->updateStatements;
}
protected function getDatabaseConnection()
{
return $GLOBALS['TYPO3_DB'];
}*/
}
2 changes: 1 addition & 1 deletion Tests/BaseFunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,6 @@ protected function removeInitialModelClassFile(string $modelName): void
if (@file_exists($file)) {
unlink($file);
}
self::assertFileNotExists($file, 'Dummy file could not be removed:' . $file);
self::assertFileDoesNotExist($file, 'Dummy file could not be removed:' . $file);
}
}
17 changes: 17 additions & 0 deletions Tests/Bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

declare(strict_types=1);

/*
* This file is part of the "extension_builder" extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*/

require __DIR__ . '/../.Build/vendor/autoload.php';

// Needed for some tests
defined('LF') ?: define('LF', chr(10));
defined('CR') ?: define('CR', chr(13));
defined('CRLF') ?: define('CRLF', CR . LF);
Loading

0 comments on commit 0ddc058

Please sign in to comment.