Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #388

Merged
merged 6 commits into from
Dec 13, 2024
Merged

Fixes #388

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .php-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.4
8.0
1 change: 1 addition & 0 deletions app/config/doctrine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ doctrine:
default:
connection: default
auto_mapping: true
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
mappings:
common:
type: annotation
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"homepage": "https://www.fork-cms.com/",
"license": "MIT",
"require": {
"php": "^7.4||^8.0",
"php": "^8.0",
"ext-json": "*",
"ext-zip": "*",
"ext-gd": "*",
Expand Down Expand Up @@ -57,8 +57,8 @@
"symfony/var-dumper": "^4.0",
"squizlabs/php_codesniffer": "^3.5",
"symfony/phpunit-bridge": "^4.3",
"phpstan/phpstan": "^0.12.52",
"phpstan/phpstan-symfony": "^0.12.7",
"phpstan/phpstan": "^2.0",
"phpstan/phpstan-symfony": "^2.0",
"deployer/deployer": "^7.0",
"deployer/recipes": "^6.2",
"tijsverkoyen/deployer-sumo": "^3.1"
Expand Down
12 changes: 6 additions & 6 deletions deploy.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@
/**
* URL to download cachetool from if it is not available
*
* Fork is currently still on PHP 7.4, so version 7.1.0 of cachetool is required.
* Fork is currently still on PHP 8.0, so version 8.6.1 of cachetool is required.
* Deployer has already moved on to 8+, so we're locking our version of cachetool for now.
*
* TODO: either upgrade this URL to the next version or remove it in the future when a new version of Fork is released.
*/
set('cachetool_url', 'https://github.com/gordalina/cachetool/releases/download/7.1.0/cachetool.phar');
set('cachetool_url', 'https://github.com/gordalina/cachetool/releases/download/8.6.1/cachetool.phar');

// Define staging
host('dev03.sumocoders.eu')
Expand All @@ -56,9 +56,9 @@
->set('stage', 'staging')
->set('deploy_path', '~/apps/{{client}}/{{project}}')
->set('branch', 'staging')
->set('bin/php', 'php7.4')
->set('cachetool', '/var/run/php_74_fpm_sites.sock')
->set('document_root', '~/php74/{{client}}/{{project}}')
->set('bin/php', 'php8.0')
->set('cachetool', '/var/run/php_80_fpm_sites.sock')
->set('document_root', '~/php80/{{client}}/{{project}}')
->set('keep_releases', 3);

// Define production
Expand All @@ -72,7 +72,7 @@
// ->set('deploy_path', '~/wwwroot')
// ->set('branch', 'master')
// ->set('bin/php', '$phpBinary')
// ->set('bin/cachetool', '/data/vhosts/{{user}}/wwwroot/shared/cachetool-7.1.0.phar')
// ->set('bin/cachetool', '/data/vhosts/{{user}}/wwwroot/shared/cachetool-8.6.1.phar')
// ->set('cachetool', '/data/vhosts/{{user}}/.sock/$sockFile --tmp-dir=/data/vhosts/{{user}}/.temp')
// ->set('document_root', '~/wwwroot/www')
// ->set('keep_releases', 3);
Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ parameters:
- vendor/spoon/library/spoon/form/form.php
bootstrapFiles:
- autoload.php
excludes_analyse:
excludePaths:
- src/Backend/Core/Js/ckfinder/core/connector/php/CKSource/CKFinder/
- src/*/Tests/*
- src/Common/WebTestCase.php
Expand Down
2 changes: 1 addition & 1 deletion src/Backend/Core/Engine/Header.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public function addJS(

$this->jsFiles->add(
new Asset(
$overwritePath ? $file : $this->buildPathForModule($file, $module ?? $this->url->getModule(), 'Js'),
$overwritePath ? $file : $this->buildPathForModule($file, $module, 'Js'),
$addTimestamp,
$priority ?? ($overwritePath ? Priority::standard() : Priority::forModule($module))
),
Expand Down
14 changes: 11 additions & 3 deletions src/Backend/Modules/Extensions/Actions/InstallModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
use Backend\Core\Engine\Base\ActionIndex as BackendBaseActionIndex;
use Backend\Core\Engine\Model as BackendModel;
use Backend\Modules\Extensions\Engine\Model as BackendExtensionsModel;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArrayInput;

/**
* This is the module install-action.
Expand Down Expand Up @@ -39,8 +40,15 @@ public function execute(): void
BackendExtensionsModel::installModule($this->currentModule);

// remove our container cache after this request
$filesystem = new Filesystem();
$filesystem->remove($this->getContainer()->getParameter('kernel.cache_dir'));
$kernel = $this->getKernel();
$application = new Application($kernel);
$application->setAutoExit(false);
$input = new ArrayInput(
[
'command' => 'forkcms:cache:clear',
]
);
$application->run($input);

// redirect to index with a success message
$this->redirect(BackendModel::createUrlForAction('Modules') . '&report=module-installed&var=' . $this->currentModule . '&highlight=row-module_' . $this->currentModule);
Expand Down
2 changes: 1 addition & 1 deletion src/Backend/Modules/FormBuilder/Ajax/SaveField.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ public function execute(): void
$field = [];
$field['form_id'] = $formId;
$field['type'] = $type;
$field['settings'] = (!empty($settings) ? serialize($settings) : null);
$field['settings'] = serialize($settings);

// existing field
if ($fieldId !== 0) {
Expand Down
1 change: 1 addition & 0 deletions src/Backend/Modules/Pages/Engine/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -1552,6 +1552,7 @@ public static function getEncodedRedirectUrl(string $redirectUrl): string
{
preg_match('!(http[s]?)://(.*)!i', $redirectUrl, $matches);
$urlChunks = explode('/', $matches[2]);
/** @phpstan-ignore-next-line */
if (!empty($urlChunks)) {
// skip domain name
$domain = array_shift($urlChunks);
Expand Down
2 changes: 1 addition & 1 deletion src/Common/Core/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ public function addRadiobutton($name, array $values, $checked = null, $class = n
*
* @param string $name The name of the element.
* @param string $value The value inside the element.
* @param int $maxLength The maximum length for the value.
* @param int|null $maxLength The maximum length for the value.
* @param string $class Class(es) that will be applied on the element.
* @param string $classError Class(es) that will be applied on the element when an error occurs.
* @param bool $HTML Will this element contain HTML?
Expand Down
Loading