diff --git a/api.php b/api.php
index 63179a99..affdc206 100644
--- a/api.php
+++ b/api.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -23,10 +23,12 @@
*/
use SP\Core\Bootstrap\BootstrapApi;
+use SP\Domain\Core\Bootstrap\BootstrapInterface;
+use SP\Domain\Core\Bootstrap\ModuleInterface;
const APP_ROOT = __DIR__;
const APP_MODULE = 'api';
-$dic = require APP_ROOT.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'Base.php';
+$dic = require APP_ROOT . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'Base.php';
-BootstrapApi::run($dic);
+BootstrapApi::run($dic->get(BootstrapInterface::class), $dic->get(ModuleInterface::class));
diff --git a/app/modules/api/Init.php b/app/modules/api/Init.php
index 1070ade0..043e0694 100644
--- a/app/modules/api/Init.php
+++ b/app/modules/api/Init.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -42,6 +42,8 @@ use SP\Infrastructure\Database\DatabaseUtil;
use SP\Infrastructure\File\FileException;
use SP\Util\HttpUtil;
+use function SP\logger;
+
/**
* Class Init
*/
@@ -51,12 +53,12 @@ final class Init extends HttpModuleBase
private DatabaseUtil $databaseUtil;
public function __construct(
- Application $application,
- ProvidersHelper $providersHelper,
+ Application $application,
+ ProvidersHelper $providersHelper,
RequestInterface $request,
- Klein $router,
+ Klein $router,
LanguageInterface $language,
- DatabaseUtil $databaseUtil
+ DatabaseUtil $databaseUtil
) {
parent::__construct(
$application,
diff --git a/app/modules/web/Init.php b/app/modules/web/Init.php
index c2e50312..dada2d20 100644
--- a/app/modules/web/Init.php
+++ b/app/modules/web/Init.php
@@ -24,7 +24,6 @@
namespace SP\Modules\Web;
-use Defuse\Crypto\Exception\CryptoException;
use Defuse\Crypto\Exception\EnvironmentIsBrokenException;
use Exception;
use JsonException;
@@ -43,13 +42,13 @@ use SP\DataModel\ItemPreset\SessionTimeout;
use SP\Domain\Core\Bootstrap\UriContextInterface;
use SP\Domain\Core\Crypt\CsrfInterface;
use SP\Domain\Core\Exceptions\ConstraintException;
+use SP\Domain\Core\Exceptions\CryptException;
use SP\Domain\Core\Exceptions\InitializationException;
use SP\Domain\Core\Exceptions\InvalidArgumentException;
use SP\Domain\Core\Exceptions\NoSuchPropertyException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
use SP\Domain\Core\LanguageInterface;
-use SP\Domain\Core\UI\ThemeInterface;
use SP\Domain\Crypt\Ports\SecureSessionServiceInterface;
use SP\Domain\Crypt\Services\SecureSessionService;
use SP\Domain\ItemPreset\Ports\ItemPresetInterface;
@@ -137,8 +136,7 @@ final class Init extends HttpModuleBase
public const ROUTE_UPGRADE = 'upgrade';
- private Csrf $csrf;
- private ThemeInterface $theme;
+ private Csrf $csrf;
private Language $language;
private SecureSessionService $secureSessionService;
private PluginManager $pluginManager;
@@ -153,7 +151,6 @@ final class Init extends HttpModuleBase
RequestInterface $request,
Klein $router,
CsrfInterface $csrf,
- ThemeInterface $theme,
LanguageInterface $language,
SecureSessionServiceInterface $secureSessionService,
PluginManager $pluginManager,
@@ -170,7 +167,6 @@ final class Init extends HttpModuleBase
);
$this->csrf = $csrf;
- $this->theme = $theme;
$this->language = $language;
$this->secureSessionService = $secureSessionService;
$this->pluginManager = $pluginManager;
@@ -392,7 +388,7 @@ final class Init extends HttpModuleBase
) {
try {
CryptSession::reKey($this->context);
- } catch (CryptoException $e) {
+ } catch (CryptException $e) {
logger($e->getMessage());
SessionContext::restart();
diff --git a/cli.php b/cli.php
index 68891d34..bfbb3226 100644
--- a/cli.php
+++ b/cli.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -22,15 +22,17 @@
* along with sysPass. If not, see .
*/
-use SP\Modules\Cli\Init as InitCli;
+use SP\Domain\Core\Bootstrap\ModuleInterface;
+
+use function SP\logger;
const APP_ROOT = __DIR__;
const APP_MODULE = 'cli';
-$dic = require APP_ROOT.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'Base.php';
+$dic = require APP_ROOT . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'Base.php';
logger('------------');
logger('Boostrap:cli');
-$cli = $dic->get(InitCli::class);
-$cli->initialize('');
\ No newline at end of file
+$cli = $dic->get(ModuleInterface::class);
+$cli->initialize('');
diff --git a/composer.lock b/composer.lock
index 0a31449b..5d1ac125 100644
--- a/composer.lock
+++ b/composer.lock
@@ -1454,16 +1454,16 @@
},
{
"name": "laravel/serializable-closure",
- "version": "v1.3.2",
+ "version": "v1.3.3",
"source": {
"type": "git",
"url": "https://github.com/laravel/serializable-closure.git",
- "reference": "076fe2cf128bd54b4341cdc6d49b95b34e101e4c"
+ "reference": "3dbf8a8e914634c48d389c1234552666b3d43754"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/076fe2cf128bd54b4341cdc6d49b95b34e101e4c",
- "reference": "076fe2cf128bd54b4341cdc6d49b95b34e101e4c",
+ "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/3dbf8a8e914634c48d389c1234552666b3d43754",
+ "reference": "3dbf8a8e914634c48d389c1234552666b3d43754",
"shasum": ""
},
"require": {
@@ -1510,7 +1510,7 @@
"issues": "https://github.com/laravel/serializable-closure/issues",
"source": "https://github.com/laravel/serializable-closure"
},
- "time": "2023-10-17T13:38:16+00:00"
+ "time": "2023-11-08T14:08:06+00:00"
},
{
"name": "league/fractal",
@@ -1775,16 +1775,16 @@
},
{
"name": "php-di/php-di",
- "version": "7.0.5",
+ "version": "7.0.6",
"source": {
"type": "git",
"url": "https://github.com/PHP-DI/PHP-DI.git",
- "reference": "9ea40a5a6970bf1ca5cbe148bc16cbad6ca3db6c"
+ "reference": "8097948a89f6ec782839b3e958432f427cac37fd"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/PHP-DI/PHP-DI/zipball/9ea40a5a6970bf1ca5cbe148bc16cbad6ca3db6c",
- "reference": "9ea40a5a6970bf1ca5cbe148bc16cbad6ca3db6c",
+ "url": "https://api.github.com/repos/PHP-DI/PHP-DI/zipball/8097948a89f6ec782839b3e958432f427cac37fd",
+ "reference": "8097948a89f6ec782839b3e958432f427cac37fd",
"shasum": ""
},
"require": {
@@ -1832,7 +1832,7 @@
],
"support": {
"issues": "https://github.com/PHP-DI/PHP-DI/issues",
- "source": "https://github.com/PHP-DI/PHP-DI/tree/7.0.5"
+ "source": "https://github.com/PHP-DI/PHP-DI/tree/7.0.6"
},
"funding": [
{
@@ -1844,20 +1844,20 @@
"type": "tidelift"
}
],
- "time": "2023-08-10T14:57:56+00:00"
+ "time": "2023-11-02T10:04:50+00:00"
},
{
"name": "phpmailer/phpmailer",
- "version": "v6.8.1",
+ "version": "v6.9.1",
"source": {
"type": "git",
"url": "https://github.com/PHPMailer/PHPMailer.git",
- "reference": "e88da8d679acc3824ff231fdc553565b802ac016"
+ "reference": "039de174cd9c17a8389754d3b877a2ed22743e18"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/e88da8d679acc3824ff231fdc553565b802ac016",
- "reference": "e88da8d679acc3824ff231fdc553565b802ac016",
+ "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/039de174cd9c17a8389754d3b877a2ed22743e18",
+ "reference": "039de174cd9c17a8389754d3b877a2ed22743e18",
"shasum": ""
},
"require": {
@@ -1877,6 +1877,7 @@
"yoast/phpunit-polyfills": "^1.0.4"
},
"suggest": {
+ "decomplexity/SendOauth2": "Adapter for using XOAUTH2 authentication",
"ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses",
"ext-openssl": "Needed for secure SMTP sending and DKIM signing",
"greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication",
@@ -1916,7 +1917,7 @@
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
"support": {
"issues": "https://github.com/PHPMailer/PHPMailer/issues",
- "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.8.1"
+ "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.9.1"
},
"funding": [
{
@@ -1924,20 +1925,20 @@
"type": "github"
}
],
- "time": "2023-08-29T08:26:30+00:00"
+ "time": "2023-11-25T22:23:28+00:00"
},
{
"name": "phpoption/phpoption",
- "version": "1.9.1",
+ "version": "1.9.2",
"source": {
"type": "git",
"url": "https://github.com/schmittjoh/php-option.git",
- "reference": "dd3a383e599f49777d8b628dadbb90cae435b87e"
+ "reference": "80735db690fe4fc5c76dfa7f9b770634285fa820"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/dd3a383e599f49777d8b628dadbb90cae435b87e",
- "reference": "dd3a383e599f49777d8b628dadbb90cae435b87e",
+ "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/80735db690fe4fc5c76dfa7f9b770634285fa820",
+ "reference": "80735db690fe4fc5c76dfa7f9b770634285fa820",
"shasum": ""
},
"require": {
@@ -1945,7 +1946,7 @@
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8.2",
- "phpunit/phpunit": "^8.5.32 || ^9.6.3 || ^10.0.12"
+ "phpunit/phpunit": "^8.5.34 || ^9.6.13 || ^10.4.2"
},
"type": "library",
"extra": {
@@ -1987,7 +1988,7 @@
],
"support": {
"issues": "https://github.com/schmittjoh/php-option/issues",
- "source": "https://github.com/schmittjoh/php-option/tree/1.9.1"
+ "source": "https://github.com/schmittjoh/php-option/tree/1.9.2"
},
"funding": [
{
@@ -1999,7 +2000,7 @@
"type": "tidelift"
}
],
- "time": "2023-02-25T19:38:58+00:00"
+ "time": "2023-11-12T21:59:55+00:00"
},
{
"name": "phpseclib/phpseclib",
@@ -2362,16 +2363,16 @@
},
{
"name": "symfony/console",
- "version": "v5.4.28",
+ "version": "v5.4.31",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
- "reference": "f4f71842f24c2023b91237c72a365306f3c58827"
+ "reference": "11ac5f154e0e5c4c77af83ad11ead9165280b92a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/f4f71842f24c2023b91237c72a365306f3c58827",
- "reference": "f4f71842f24c2023b91237c72a365306f3c58827",
+ "url": "https://api.github.com/repos/symfony/console/zipball/11ac5f154e0e5c4c77af83ad11ead9165280b92a",
+ "reference": "11ac5f154e0e5c4c77af83ad11ead9165280b92a",
"shasum": ""
},
"require": {
@@ -2441,7 +2442,7 @@
"terminal"
],
"support": {
- "source": "https://github.com/symfony/console/tree/v5.4.28"
+ "source": "https://github.com/symfony/console/tree/v5.4.31"
},
"funding": [
{
@@ -2457,11 +2458,11 @@
"type": "tidelift"
}
],
- "time": "2023-08-07T06:12:30+00:00"
+ "time": "2023-10-31T07:58:33+00:00"
},
{
"name": "symfony/deprecation-contracts",
- "version": "v3.3.0",
+ "version": "v3.4.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/deprecation-contracts.git",
@@ -2508,7 +2509,7 @@
"description": "A generic function and convention to trigger deprecation notices",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/deprecation-contracts/tree/v3.3.0"
+ "source": "https://github.com/symfony/deprecation-contracts/tree/v3.4.0"
},
"funding": [
{
@@ -2528,16 +2529,16 @@
},
{
"name": "symfony/lock",
- "version": "v5.4.30",
+ "version": "v5.4.31",
"source": {
"type": "git",
"url": "https://github.com/symfony/lock.git",
- "reference": "759554c1831c8ef11ce36c9cebc32ad977ca518c"
+ "reference": "23146b4eeeff63121066590e95a22ce223d19cf9"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/lock/zipball/759554c1831c8ef11ce36c9cebc32ad977ca518c",
- "reference": "759554c1831c8ef11ce36c9cebc32ad977ca518c",
+ "url": "https://api.github.com/repos/symfony/lock/zipball/23146b4eeeff63121066590e95a22ce223d19cf9",
+ "reference": "23146b4eeeff63121066590e95a22ce223d19cf9",
"shasum": ""
},
"require": {
@@ -2587,7 +2588,7 @@
"semaphore"
],
"support": {
- "source": "https://github.com/symfony/lock/tree/v5.4.30"
+ "source": "https://github.com/symfony/lock/tree/v5.4.31"
},
"funding": [
{
@@ -2603,7 +2604,7 @@
"type": "tidelift"
}
],
- "time": "2023-10-28T23:35:12+00:00"
+ "time": "2023-11-06T17:37:45+00:00"
},
{
"name": "symfony/polyfill-ctype",
@@ -3262,16 +3263,16 @@
},
{
"name": "symfony/service-contracts",
- "version": "v3.3.0",
+ "version": "v3.4.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/service-contracts.git",
- "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4"
+ "reference": "b3313c2dbffaf71c8de2934e2ea56ed2291a3838"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/service-contracts/zipball/40da9cc13ec349d9e4966ce18b5fbcd724ab10a4",
- "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4",
+ "url": "https://api.github.com/repos/symfony/service-contracts/zipball/b3313c2dbffaf71c8de2934e2ea56ed2291a3838",
+ "reference": "b3313c2dbffaf71c8de2934e2ea56ed2291a3838",
"shasum": ""
},
"require": {
@@ -3324,7 +3325,7 @@
"standards"
],
"support": {
- "source": "https://github.com/symfony/service-contracts/tree/v3.3.0"
+ "source": "https://github.com/symfony/service-contracts/tree/v3.4.0"
},
"funding": [
{
@@ -3340,20 +3341,20 @@
"type": "tidelift"
}
],
- "time": "2023-05-23T14:45:45+00:00"
+ "time": "2023-07-30T20:28:31+00:00"
},
{
"name": "symfony/string",
- "version": "v6.3.5",
+ "version": "v6.3.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/string.git",
- "reference": "13d76d0fb049051ed12a04bef4f9de8715bea339"
+ "reference": "13880a87790c76ef994c91e87efb96134522577a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/string/zipball/13d76d0fb049051ed12a04bef4f9de8715bea339",
- "reference": "13d76d0fb049051ed12a04bef4f9de8715bea339",
+ "url": "https://api.github.com/repos/symfony/string/zipball/13880a87790c76ef994c91e87efb96134522577a",
+ "reference": "13880a87790c76ef994c91e87efb96134522577a",
"shasum": ""
},
"require": {
@@ -3410,7 +3411,7 @@
"utf8"
],
"support": {
- "source": "https://github.com/symfony/string/tree/v6.3.5"
+ "source": "https://github.com/symfony/string/tree/v6.3.8"
},
"funding": [
{
@@ -3426,7 +3427,7 @@
"type": "tidelift"
}
],
- "time": "2023-09-18T10:38:32+00:00"
+ "time": "2023-11-09T08:28:21+00:00"
},
{
"name": "vlucas/phpdotenv",
@@ -3868,16 +3869,16 @@
},
{
"name": "phpstan/phpstan",
- "version": "1.10.40",
+ "version": "1.10.44",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
- "reference": "93c84b5bf7669920d823631e39904d69b9c7dc5d"
+ "reference": "bf84367c53a23f759513985c54ffe0d0c249825b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpstan/phpstan/zipball/93c84b5bf7669920d823631e39904d69b9c7dc5d",
- "reference": "93c84b5bf7669920d823631e39904d69b9c7dc5d",
+ "url": "https://api.github.com/repos/phpstan/phpstan/zipball/bf84367c53a23f759513985c54ffe0d0c249825b",
+ "reference": "bf84367c53a23f759513985c54ffe0d0c249825b",
"shasum": ""
},
"require": {
@@ -3926,20 +3927,20 @@
"type": "tidelift"
}
],
- "time": "2023-10-30T14:48:31+00:00"
+ "time": "2023-11-21T16:30:46+00:00"
},
{
"name": "phpunit/php-code-coverage",
- "version": "10.1.7",
+ "version": "10.1.9",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
- "reference": "355324ca4980b8916c18b9db29f3ef484078f26e"
+ "reference": "a56a9ab2f680246adcf3db43f38ddf1765774735"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/355324ca4980b8916c18b9db29f3ef484078f26e",
- "reference": "355324ca4980b8916c18b9db29f3ef484078f26e",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/a56a9ab2f680246adcf3db43f38ddf1765774735",
+ "reference": "a56a9ab2f680246adcf3db43f38ddf1765774735",
"shasum": ""
},
"require": {
@@ -3996,7 +3997,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
"security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy",
- "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.7"
+ "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.9"
},
"funding": [
{
@@ -4004,7 +4005,7 @@
"type": "github"
}
],
- "time": "2023-10-04T15:34:17+00:00"
+ "time": "2023-11-23T12:23:20+00:00"
},
{
"name": "phpunit/php-file-iterator",
@@ -4356,20 +4357,21 @@
"source": {
"type": "git",
"url": "https://github.com/Roave/SecurityAdvisories.git",
- "reference": "607208645cb8a9a42766313a1cb4bcf916d1abad"
+ "reference": "2b23329e299c9a6cd98a82f5137ab4909c8e506d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/607208645cb8a9a42766313a1cb4bcf916d1abad",
- "reference": "607208645cb8a9a42766313a1cb4bcf916d1abad",
+ "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/2b23329e299c9a6cd98a82f5137ab4909c8e506d",
+ "reference": "2b23329e299c9a6cd98a82f5137ab4909c8e506d",
"shasum": ""
},
"conflict": {
"3f/pygmentize": "<1.2",
- "admidio/admidio": "<4.2.11",
+ "admidio/admidio": "<4.2.13",
"adodb/adodb-php": "<=5.20.20|>=5.21,<=5.21.3",
"aheinze/cockpit": "<2.2",
"aimeos/aimeos-typo3": "<19.10.12|>=20,<20.10.5",
+ "airesvsg/acf-to-rest-api": "<=3.1",
"akaunting/akaunting": "<2.1.13",
"akeneo/pim-community-dev": "<5.0.119|>=6,<6.0.53",
"alextselegidis/easyappointments": "<1.5",
@@ -4438,10 +4440,10 @@
"codeception/codeception": "<3.1.3|>=4,<4.1.22",
"codeigniter/framework": "<3.1.9",
"codeigniter4/framework": "<=4.4.2",
- "codeigniter4/shield": "<1.0.0.0-beta4",
+ "codeigniter4/shield": "<1.0.0.0-beta8",
"codiad/codiad": "<=2.8.4",
"composer/composer": "<1.10.27|>=2,<2.2.22|>=2.3,<2.6.4",
- "concrete5/concrete5": "<=9.2.1",
+ "concrete5/concrete5": "<9.2.2",
"concrete5/core": "<8.5.8|>=9,<9.1",
"contao-components/mediaelement": ">=2.14.2,<2.21.1",
"contao/contao": ">=4,<4.4.56|>=4.5,<4.9.40|>=4.10,<4.11.7|>=4.13,<4.13.21|>=5.1,<5.1.4",
@@ -4473,10 +4475,12 @@
"doctrine/mongodb-odm": "<1.0.2",
"doctrine/mongodb-odm-bundle": "<3.0.1",
"doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1|>=2.8.3,<2.8.4",
- "dolibarr/dolibarr": "<18",
+ "dolibarr/dolibarr": "<18.0.2",
"dompdf/dompdf": "<2.0.2|==2.0.2",
+ "doublethreedigital/guest-entries": "<3.1.2",
"drupal/core": "<9.4.14|>=9.5,<9.5.8|>=10,<10.0.8",
"drupal/drupal": ">=6,<6.38|>=7,<7.80|>=8,<8.9.16|>=9,<9.1.12|>=9.2,<9.2.4",
+ "duncanmcclean/guest-entries": "<3.1.2",
"dweeves/magmi": "<=0.7.24",
"ecodev/newsletter": "<=4",
"ectouch/ectouch": "<=2.7.2",
@@ -4498,12 +4502,13 @@
"ezsystems/ezplatform-admin-ui": ">=1.3,<1.3.5|>=1.4,<1.4.6|>=1.5,<1.5.29|>=2.3,<2.3.26",
"ezsystems/ezplatform-admin-ui-assets": ">=4,<4.2.1|>=5,<5.0.1|>=5.1,<5.1.1",
"ezsystems/ezplatform-graphql": ">=1.0.0.0-RC1-dev,<1.0.13|>=2.0.0.0-beta1,<2.3.12",
- "ezsystems/ezplatform-kernel": "<1.2.5.1-dev|>=1.3,<1.3.26",
+ "ezsystems/ezplatform-kernel": "<1.2.5.1-dev|>=1.3,<1.3.34",
"ezsystems/ezplatform-rest": ">=1.2,<=1.2.2|>=1.3,<1.3.8",
"ezsystems/ezplatform-richtext": ">=2.3,<2.3.7.1-dev",
+ "ezsystems/ezplatform-solr-search-engine": ">=1.7,<1.7.12|>=2,<2.0.2|>=3.3,<3.3.15",
"ezsystems/ezplatform-user": ">=1,<1.0.1",
- "ezsystems/ezpublish-kernel": "<6.13.8.2-dev|>=7,<7.5.30",
- "ezsystems/ezpublish-legacy": "<=2017.12.7.3|>=2018.06,<=2019.03.5.1",
+ "ezsystems/ezpublish-kernel": "<6.13.8.2-dev|>=7,<7.5.31",
+ "ezsystems/ezpublish-legacy": "<=2017.12.7.3|>=2018.6,<=2019.03.5.1",
"ezsystems/platform-ui-assets-bundle": ">=4.2,<4.2.3",
"ezsystems/repository-forms": ">=2.3,<2.3.2.1-dev|>=2.5,<2.5.15",
"ezyang/htmlpurifier": "<4.1.1",
@@ -4521,9 +4526,11 @@
"flarum/mentions": "<1.6.3",
"flarum/sticky": ">=0.1.0.0-beta14,<=0.1.0.0-beta15",
"flarum/tags": "<=0.1.0.0-beta13",
+ "floriangaerber/magnesium": "<0.3.1",
"fluidtypo3/vhs": "<5.1.1",
"fof/byobu": ">=0.3.0.0-beta2,<1.1.7",
"fof/upload": "<1.2.3",
+ "foodcoopshop/foodcoopshop": ">=3.2,<3.6.1",
"fooman/tcpdf": "<6.2.22",
"forkcms/forkcms": "<5.11.1",
"fossar/tcpdf-parser": "<6.2.22",
@@ -4535,7 +4542,7 @@
"friendsoftypo3/mediace": ">=7.6.2,<7.6.5",
"friendsoftypo3/openid": ">=4.5,<4.5.31|>=4.7,<4.7.16|>=6,<6.0.11|>=6.1,<6.1.6",
"froala/wysiwyg-editor": "<3.2.7|>=4.0.1,<=4.1.1",
- "froxlor/froxlor": "<2.1",
+ "froxlor/froxlor": "<2.1.0.0-beta1",
"fuel/core": "<1.8.1",
"funadmin/funadmin": "<=3.2|>=3.3.2,<=3.3.3",
"gaoming13/wechat-php-sdk": "<=1.10.2",
@@ -4568,9 +4575,10 @@
"httpsoft/http-message": "<1.0.12",
"hyn/multi-tenant": ">=5.6,<5.7.2",
"ibexa/admin-ui": ">=4.2,<4.2.3",
- "ibexa/core": ">=4,<4.0.7|>=4.1,<4.1.4|>=4.2,<4.2.3",
+ "ibexa/core": ">=4,<4.0.7|>=4.1,<4.1.4|>=4.2,<4.2.3|>=4.5,<4.5.4",
"ibexa/graphql": ">=2.5,<2.5.31|>=3.3,<3.3.28|>=4.2,<4.2.3",
"ibexa/post-install": "<=1.0.4",
+ "ibexa/solr": ">=4.5,<4.5.4",
"ibexa/user": ">=4,<4.4.3",
"icecoder/icecoder": "<=8.1",
"idno/known": "<=1.3.1",
@@ -4652,7 +4660,7 @@
"melisplatform/melis-front": "<5.0.1",
"mezzio/mezzio-swoole": "<3.7|>=4,<4.3",
"mgallegos/laravel-jqgrid": "<=1.3",
- "microweber/microweber": "<2",
+ "microweber/microweber": "<2.0.3",
"miniorange/miniorange-saml": "<1.4.3",
"mittwald/typo3_forum": "<1.2.1",
"mobiledetect/mobiledetectlib": "<2.8.32",
@@ -4660,10 +4668,13 @@
"mojo42/jirafeau": "<4.4",
"mongodb/mongodb": ">=1,<1.9.2",
"monolog/monolog": ">=1.8,<1.12",
- "moodle/moodle": "<4.2.0.0-RC2-dev|==4.2",
+ "moodle/moodle": "<4.3.0.0-RC2-dev",
"mos/cimage": "<0.7.19",
"movim/moxl": ">=0.8,<=0.10",
"mpdf/mpdf": "<=7.1.7",
+ "munkireport/comment": "<4.1",
+ "munkireport/managedinstalls": "<2.6",
+ "munkireport/munkireport": ">=2.5.3,<5.6.3",
"mustache/mustache": ">=2,<2.14.1",
"namshi/jose": "<2.2",
"neoan3-apps/template": "<1.1.1",
@@ -4732,17 +4743,19 @@
"phpxmlrpc/extras": "<0.6.1",
"phpxmlrpc/phpxmlrpc": "<4.9.2",
"pi/pi": "<=2.5",
- "pimcore/admin-ui-classic-bundle": "<1.2",
+ "pimcore/admin-ui-classic-bundle": "<1.2.1",
"pimcore/customer-management-framework-bundle": "<3.4.2",
"pimcore/data-hub": "<1.2.4",
"pimcore/demo": "<10.3",
"pimcore/perspective-editor": "<1.5.1",
- "pimcore/pimcore": "<11.1",
+ "pimcore/pimcore": "<11.1.1",
"pixelfed/pixelfed": "<=0.11.4",
"pocketmine/bedrock-protocol": "<8.0.2",
"pocketmine/pocketmine-mp": "<=4.23|>=5,<5.3.1",
+ "pocketmine/raklib": ">=0.14,<0.14.6|>=0.15,<0.15.1",
"pressbooks/pressbooks": "<5.18",
"prestashop/autoupgrade": ">=4,<4.10.1",
+ "prestashop/blockreassurance": "<=5.1.3",
"prestashop/blockwishlist": ">=2,<2.1.1",
"prestashop/contactform": ">=1.0.1,<4.3",
"prestashop/gamification": "<2.3.2",
@@ -4769,6 +4782,8 @@
"react/http": ">=0.7,<1.9",
"really-simple-plugins/complianz-gdpr": "<6.4.2",
"remdex/livehelperchat": "<3.99",
+ "reportico-web/reportico": "<=7.1.21",
+ "rhukster/dom-sanitizer": "<1.0.7",
"rmccue/requests": ">=1.6,<1.8",
"robrichards/xmlseclibs": "<3.0.4",
"roots/soil": "<4.1",
@@ -4828,7 +4843,7 @@
"spoonity/tcpdf": "<6.2.22",
"squizlabs/php_codesniffer": ">=1,<2.8.1|>=3,<3.0.1",
"ssddanbrown/bookstack": "<22.02.3",
- "statamic/cms": "<4.10",
+ "statamic/cms": "<4.36",
"stormpath/sdk": "<9.9.99",
"studio-42/elfinder": "<2.1.62",
"subhh/libconnect": "<7.0.8|>=8,<8.1",
@@ -4837,6 +4852,7 @@
"sumocoders/framework-user-bundle": "<1.4",
"swag/paypal": "<5.4.4",
"swiftmailer/swiftmailer": ">=4,<5.4.5",
+ "swiftyedit/swiftyedit": "<1.2",
"sylius/admin-bundle": ">=1,<1.0.17|>=1.1,<1.1.9|>=1.2,<1.2.2",
"sylius/grid": ">=1,<1.1.19|>=1.2,<1.2.18|>=1.3,<1.3.13|>=1.4,<1.4.5|>=1.5,<1.5.1",
"sylius/grid-bundle": "<1.10.1",
@@ -4868,14 +4884,16 @@
"symfony/security-core": ">=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8,<3.4.49|>=4,<4.4.24|>=5,<5.2.9",
"symfony/security-csrf": ">=2.4,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11",
"symfony/security-guard": ">=2.8,<3.4.48|>=4,<4.4.23|>=5,<5.2.8",
- "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7|>=5.1,<5.2.8|>=5.3,<5.3.2",
+ "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7|>=5.1,<5.2.8|>=5.3,<5.3.2|>=5.4,<5.4.31|>=6,<6.3.8",
"symfony/serializer": ">=2,<2.0.11|>=4.1,<4.4.35|>=5,<5.3.12",
- "symfony/symfony": "<4.4.50|>=5,<5.4.20|>=6,<6.0.20|>=6.1,<6.1.12|>=6.2,<6.2.6",
+ "symfony/symfony": "<4.4.51|>=5,<5.4.31|>=6,<6.3.8",
"symfony/translation": ">=2,<2.0.17",
+ "symfony/twig-bridge": ">=2,<4.4.51|>=5,<5.4.31|>=6,<6.3.8",
"symfony/ux-autocomplete": "<2.11.2",
"symfony/validator": ">=2,<2.0.24|>=2.1,<2.1.12|>=2.2,<2.2.5|>=2.3,<2.3.3",
"symfony/var-exporter": ">=4.2,<4.2.12|>=4.3,<4.3.8",
"symfony/web-profiler-bundle": ">=2,<2.3.19|>=2.4,<2.4.9|>=2.5,<2.5.4",
+ "symfony/webhook": ">=6.3,<6.3.8",
"symfony/yaml": ">=2,<2.0.22|>=2.1,<2.1.7",
"t3/dce": "<0.11.5|>=2.2,<2.6.2",
"t3g/svg-sanitizer": "<1.0.3",
@@ -4889,7 +4907,7 @@
"thinkcmf/thinkcmf": "<=5.1.7",
"thorsten/phpmyfaq": "<3.2.2",
"tikiwiki/tiki-manager": "<=17.1",
- "tinymce/tinymce": "<5.10.8|>=6,<6.7.1",
+ "tinymce/tinymce": "<5.10.9|>=6,<6.7.3",
"tinymighty/wiki-seo": "<1.2.2",
"titon/framework": "<9.9.99",
"tobiasbg/tablepress": "<=2.0.0.0-RC1",
@@ -4903,12 +4921,13 @@
"twig/twig": "<1.44.7|>=2,<2.15.3|>=3,<3.4.3",
"typo3/cms": "<9.5.29|>=10,<10.4.35|>=11,<11.5.23|>=12,<12.2",
"typo3/cms-backend": ">=7,<=7.6.50|>=8,<=8.7.39|>=9,<=9.5.24|>=10,<=10.4.13|>=11,<=11.1",
- "typo3/cms-core": "<8.7.51|>=9,<9.5.42|>=10,<10.4.39|>=11,<11.5.30|>=12,<12.4.4",
+ "typo3/cms-core": "<=8.7.54|>=9,<=9.5.43|>=10,<=10.4.40|>=11,<=11.5.32|>=12,<=12.4.7",
"typo3/cms-extbase": "<6.2.24|>=7,<7.6.8|==8.1.1",
"typo3/cms-form": ">=8,<=8.7.39|>=9,<=9.5.24|>=10,<=10.4.13|>=11,<=11.1",
+ "typo3/cms-install": ">=12.2,<12.4.8",
"typo3/cms-rte-ckeditor": ">=9.5,<9.5.42|>=10,<10.4.39|>=11,<11.5.30",
"typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.12|>=3.1,<3.1.10|>=3.2,<3.2.13|>=3.3,<3.3.13|>=4,<4.0.6",
- "typo3/html-sanitizer": ">=1,<1.5.1|>=2,<2.1.2",
+ "typo3/html-sanitizer": ">=1,<=1.5.2|>=2,<=2.1.3",
"typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4|>=2.3,<2.3.99|>=3,<3.0.20|>=3.1,<3.1.18|>=3.2,<3.2.14|>=3.3,<3.3.23|>=4,<4.0.17|>=4.1,<4.1.16|>=4.2,<4.2.12|>=4.3,<4.3.3",
"typo3/phar-stream-wrapper": ">=1,<2.1.1|>=3,<3.1.1",
"typo3/swiftmailer": ">=4.1,<4.1.99|>=5.4,<5.4.5",
@@ -4949,7 +4968,7 @@
"yetiforce/yetiforce-crm": "<=6.4",
"yidashi/yii2cmf": "<=2",
"yii2mod/yii2-cms": "<1.9.2",
- "yiisoft/yii": "<1.1.27",
+ "yiisoft/yii": "<1.1.29",
"yiisoft/yii2": "<2.0.38",
"yiisoft/yii2-bootstrap": "<2.0.4",
"yiisoft/yii2-dev": "<2.0.43",
@@ -5034,7 +5053,7 @@
"type": "tidelift"
}
],
- "time": "2023-11-01T17:04:28+00:00"
+ "time": "2023-11-23T04:04:32+00:00"
},
{
"name": "sebastian/cli-parser",
@@ -6010,16 +6029,16 @@
},
{
"name": "symfony/browser-kit",
- "version": "v5.4.21",
+ "version": "v5.4.31",
"source": {
"type": "git",
"url": "https://github.com/symfony/browser-kit.git",
- "reference": "a866ca7e396f15d7efb6d74a8a7d364d4e05b704"
+ "reference": "0ed1f634a36606f2065eec221b3975e05016cbbe"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/browser-kit/zipball/a866ca7e396f15d7efb6d74a8a7d364d4e05b704",
- "reference": "a866ca7e396f15d7efb6d74a8a7d364d4e05b704",
+ "url": "https://api.github.com/repos/symfony/browser-kit/zipball/0ed1f634a36606f2065eec221b3975e05016cbbe",
+ "reference": "0ed1f634a36606f2065eec221b3975e05016cbbe",
"shasum": ""
},
"require": {
@@ -6062,7 +6081,7 @@
"description": "Simulates the behavior of a web browser, allowing you to make requests, click on links and submit forms programmatically",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/browser-kit/tree/v5.4.21"
+ "source": "https://github.com/symfony/browser-kit/tree/v5.4.31"
},
"funding": [
{
@@ -6078,7 +6097,7 @@
"type": "tidelift"
}
],
- "time": "2023-02-14T08:03:56+00:00"
+ "time": "2023-10-31T07:58:33+00:00"
},
{
"name": "symfony/css-selector",
@@ -6292,16 +6311,16 @@
},
{
"name": "theseer/tokenizer",
- "version": "1.2.1",
+ "version": "1.2.2",
"source": {
"type": "git",
"url": "https://github.com/theseer/tokenizer.git",
- "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e"
+ "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e",
- "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e",
+ "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b2ad5003ca10d4ee50a12da31de12a5774ba6b96",
+ "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96",
"shasum": ""
},
"require": {
@@ -6330,7 +6349,7 @@
"description": "A small library for converting tokenized PHP source code into XML and potentially other formats",
"support": {
"issues": "https://github.com/theseer/tokenizer/issues",
- "source": "https://github.com/theseer/tokenizer/tree/1.2.1"
+ "source": "https://github.com/theseer/tokenizer/tree/1.2.2"
},
"funding": [
{
@@ -6338,7 +6357,7 @@
"type": "github"
}
],
- "time": "2021-07-28T10:34:58+00:00"
+ "time": "2023-11-20T00:12:19+00:00"
}
],
"aliases": [],
diff --git a/index.php b/index.php
index ffa11643..e4450cb4 100644
--- a/index.php
+++ b/index.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -23,10 +23,12 @@
*/
use SP\Core\Bootstrap\BootstrapWeb;
+use SP\Domain\Core\Bootstrap\BootstrapInterface;
+use SP\Domain\Core\Bootstrap\ModuleInterface;
const APP_ROOT = __DIR__;
const APP_MODULE = 'web';
-$dic = require APP_ROOT.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'Base.php';
+$dic = require APP_ROOT . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'Base.php';
-BootstrapWeb::run($dic);
+BootstrapWeb::run($dic->get(BootstrapInterface::class), $dic->get(ModuleInterface::class));
diff --git a/lib/Base.php b/lib/Base.php
index e89082f5..bb477003 100644
--- a/lib/Base.php
+++ b/lib/Base.php
@@ -26,28 +26,27 @@ use DI\ContainerBuilder;
use Dotenv\Dotenv;
use SP\Core\Definitions\CoreDefinitions;
use SP\Core\Definitions\DomainDefinitions;
+
use function SP\initModule;
use function SP\processException;
-defined('APP_ROOT') || die();
-
// Core PATHS
const DS = DIRECTORY_SEPARATOR;
const BASE_PATH = __DIR__;
-const APP_PATH = APP_ROOT.DS.'app';
-const VENDOR_PATH = APP_ROOT.DS.'vendor';
-const SQL_PATH = APP_ROOT.DS.'schemas';
-const PUBLIC_PATH = APP_ROOT.DS.'public';
-const XML_SCHEMA = SQL_PATH.DS.'syspass.xsd';
-const RESOURCES_PATH = APP_PATH.DS.'resources';
-const MODULES_PATH = APP_PATH.DS.'modules';
-const LOCALES_PATH = APP_PATH.DS.'locales';
+const APP_PATH = APP_ROOT . DS . 'app';
+const VENDOR_PATH = APP_ROOT . DS . 'vendor';
+const SQL_PATH = APP_ROOT . DS . 'schemas';
+const PUBLIC_PATH = APP_ROOT . DS . 'public';
+const XML_SCHEMA = SQL_PATH . DS . 'syspass.xsd';
+const RESOURCES_PATH = APP_PATH . DS . 'resources';
+const MODULES_PATH = APP_PATH . DS . 'modules';
+const LOCALES_PATH = APP_PATH . DS . 'locales';
// Start tracking the memory used
$memInit = memory_get_usage();
-require __DIR__.DS.'BaseFunctions.php';
-require VENDOR_PATH.DS.'autoload.php';
+require __DIR__ . DS . 'BaseFunctions.php';
+require VENDOR_PATH . DS . 'autoload.php';
$dotenv = Dotenv::createImmutable(APP_ROOT);
$dotenv->load();
@@ -63,60 +62,60 @@ define(
define(
'CONFIG_PATH',
getenv('CONFIG_PATH')
- ?: APP_PATH.DS.'config'
+ ?: APP_PATH . DS . 'config'
);
// Setup config files
-const OLD_CONFIG_FILE = CONFIG_PATH.DS.'config.php';
+const OLD_CONFIG_FILE = CONFIG_PATH . DS . 'config.php';
define(
'CONFIG_FILE',
getenv('CONFIG_FILE')
- ?: CONFIG_PATH.DS.'config.xml'
+ ?: CONFIG_PATH . DS . 'config.xml'
);
define(
'ACTIONS_FILE',
getenv('ACTIONS_FILE')
- ?: RESOURCES_PATH.DS.'actions.xml'
+ ?: RESOURCES_PATH . DS . 'actions.xml'
);
define(
'MIMETYPES_FILE',
getenv('MIMETYPES_FILE')
- ?: RESOURCES_PATH.DS.'mime.xml'
+ ?: RESOURCES_PATH . DS . 'mime.xml'
);
define(
'LOG_FILE',
getenv('LOG_FILE')
- ?: CONFIG_PATH.DS.'syspass.log'
+ ?: CONFIG_PATH . DS . 'syspass.log'
);
-const LOCK_FILE = CONFIG_PATH.DS.'.lock';
+const LOCK_FILE = CONFIG_PATH . DS . '.lock';
// Setup application paths
define(
'BACKUP_PATH',
getenv('BACKUP_PATH')
- ?: APP_PATH.DS.'backup'
+ ?: APP_PATH . DS . 'backup'
);
define(
'CACHE_PATH',
getenv('CACHE_PATH')
- ?: APP_PATH.DS.'cache'
+ ?: APP_PATH . DS . 'cache'
);
define(
'TMP_PATH',
getenv('TMP_PATH')
- ?: APP_PATH.DS.'temp'
+ ?: APP_PATH . DS . 'temp'
);
try {
$moduleDefinitions = initModule(APP_MODULE);
- $containerBuilder = new ContainerBuilder;
+ $containerBuilder = new ContainerBuilder();
if (!DEBUG) {
$containerBuilder->enableCompilation(CACHE_PATH);
- $containerBuilder->writeProxiesToFile(true, CACHE_PATH.DS.'proxies');
+ $containerBuilder->writeProxiesToFile(true, CACHE_PATH . DS . 'proxies');
}
return $containerBuilder
diff --git a/lib/SP/Core/Bootstrap/BootstrapApi.php b/lib/SP/Core/Bootstrap/BootstrapApi.php
index 24ab5eed..8c1de5f5 100644
--- a/lib/SP/Core/Bootstrap/BootstrapApi.php
+++ b/lib/SP/Core/Bootstrap/BootstrapApi.php
@@ -29,12 +29,11 @@ use Exception;
use Klein\Request;
use Klein\Response;
use Psr\Container\ContainerExceptionInterface;
-use Psr\Container\ContainerInterface;
use Psr\Container\NotFoundExceptionInterface;
-use SP\Core\HttpModuleBase;
use SP\Domain\Api\Ports\ApiRequestInterface;
use SP\Domain\Api\Services\JsonRpcResponse;
-use SP\Modules\Api\Init as InitApi;
+use SP\Domain\Core\Bootstrap\BootstrapInterface;
+use SP\Domain\Core\Bootstrap\ModuleInterface;
use function SP\logger;
use function SP\processException;
@@ -45,20 +44,16 @@ use function SP\processException;
final class BootstrapApi extends BootstrapBase
{
- protected HttpModuleBase $module;
+ protected ModuleInterface $module;
- public static function run(ContainerInterface $container): BootstrapApi
+ public static function run(BootstrapInterface $bootstrap, ModuleInterface $initModule): void
{
logger('------------');
logger('Boostrap:api');
try {
- /** @noinspection SelfClassReferencingInspection */
- $bs = $container->get(BootstrapApi::class);
- $bs->module = $container->get(InitApi::class);
- $bs->handleRequest();
-
- return $bs;
+ $bootstrap->module = $initModule;
+ $bootstrap->handleRequest();
} catch (NotFoundExceptionInterface|ContainerExceptionInterface $e) {
processException($e);
@@ -88,7 +83,6 @@ final class BootstrapApi extends BootstrapBase
if (!method_exists($controllerClass, $method)) {
logger($controllerClass . '::' . $method);
- /** @var Response $response */
$response->headers()->set('Content-type', 'application/json; charset=utf-8');
return $response->body(
@@ -112,7 +106,6 @@ final class BootstrapApi extends BootstrapBase
} catch (Exception $e) {
processException($e);
- /** @var Response $response */
$response->headers()->set('Content-type', 'application/json; charset=utf-8');
return $response->body(JsonRpcResponse::getResponseException($e, 0));
diff --git a/lib/SP/Core/Bootstrap/BootstrapBase.php b/lib/SP/Core/Bootstrap/BootstrapBase.php
index 12832a96..4458d43b 100644
--- a/lib/SP/Core/Bootstrap/BootstrapBase.php
+++ b/lib/SP/Core/Bootstrap/BootstrapBase.php
@@ -37,6 +37,8 @@ use SP\Core\Language;
use SP\Core\PhpExtensionChecker;
use SP\Domain\Config\Ports\ConfigDataInterface;
use SP\Domain\Config\Services\ConfigUtil;
+use SP\Domain\Core\Bootstrap\BootstrapInterface;
+use SP\Domain\Core\Bootstrap\ModuleInterface;
use SP\Domain\Core\Bootstrap\UriContextInterface;
use SP\Domain\Core\Context\ContextInterface;
use SP\Domain\Core\Exceptions\CheckException;
@@ -57,10 +59,8 @@ use function SP\processException;
/**
* Class BootstrapBase
- *
- * @package SP
*/
-abstract class BootstrapBase
+abstract class BootstrapBase implements BootstrapInterface
{
public const CONTEXT_ACTION_NAME = "_actionName";
@@ -146,7 +146,7 @@ abstract class BootstrapBase
abstract protected function configureRouter(): void;
- abstract public static function run(ContainerInterface $container): BootstrapBase;
+ abstract public static function run(BootstrapInterface $bootstrap, ModuleInterface $initModule): void;
/**
* @deprecated
diff --git a/lib/SP/Core/Bootstrap/BootstrapWeb.php b/lib/SP/Core/Bootstrap/BootstrapWeb.php
index 0e348c1a..7fdb3073 100644
--- a/lib/SP/Core/Bootstrap/BootstrapWeb.php
+++ b/lib/SP/Core/Bootstrap/BootstrapWeb.php
@@ -29,12 +29,11 @@ use Exception;
use Klein\Request;
use Klein\Response;
use Psr\Container\ContainerExceptionInterface;
-use Psr\Container\ContainerInterface;
use Psr\Container\NotFoundExceptionInterface;
use RuntimeException;
-use SP\Core\HttpModuleBase;
+use SP\Domain\Core\Bootstrap\BootstrapInterface;
+use SP\Domain\Core\Bootstrap\ModuleInterface;
use SP\Domain\Core\Exceptions\SessionTimeout;
-use SP\Modules\Web\Init as InitWeb;
use SP\Util\Filter;
use function SP\__;
@@ -46,24 +45,16 @@ use function SP\processException;
*/
final class BootstrapWeb extends BootstrapBase
{
- private const ROUTE_REGEX = /** @lang RegExp */
- '#(?P[a-zA-Z]+)(?:/(?P[a-zA-Z]+))?(?P(/[a-zA-Z\d.]+)+)?#';
+ protected ModuleInterface $module;
- protected HttpModuleBase $module;
-
- public static function run(ContainerInterface $container): BootstrapWeb
+ public static function run(BootstrapInterface $bootstrap, ModuleInterface $initModule): void
{
logger('------------');
logger('Boostrap:web');
try {
- /** @noinspection SelfClassReferencingInspection */
- $bs = $container->get(BootstrapWeb::class);
- $bs->module = $container->get(InitWeb::class);
-
- $bs->handleRequest();
-
- return $bs;
+ $bootstrap->module = $initModule;
+ $bootstrap->handleRequest();
} catch (NotFoundExceptionInterface|ContainerExceptionInterface $e) {
processException($e);
@@ -85,30 +76,24 @@ final class BootstrapWeb extends BootstrapBase
$route = Filter::getString($request->param('r', 'index/index'));
- if (!preg_match_all(self::ROUTE_REGEX, $route, $matches)) {
- throw new RuntimeException(self::OOPS_MESSAGE);
- }
+ $routeContextData = RouteContext::getRouteContextData($route);
- $controllerName = $matches['controller'][0];
- $actionName = empty($matches['actions'][0]) ? 'index' : $matches['actions'][0];
- $methodName = sprintf('%sAction', $actionName);
- $methodParams = empty($matches['params'][0])
- ? []
- : Filter::getArray(explode('/', trim($matches['params'][0], '/')));
-
- $controllerClass = self::getClassFor($controllerName, $actionName);
+ $controllerClass = self::getClassFor(
+ $routeContextData->getController(),
+ $routeContextData->getActionName()
+ );
$this->initializePluginClasses();
- if (!method_exists($controllerClass, $methodName)) {
- logger($controllerClass . '::' . $methodName);
+ if (!method_exists($controllerClass, $routeContextData->getMethodName())) {
+ logger($controllerClass . '::' . $routeContextData->getMethodName());
$response->code(404);
throw new RuntimeException(self::OOPS_MESSAGE);
}
- $this->context->setTrasientKey(self::CONTEXT_ACTION_NAME, $actionName);
+ $this->context->setTrasientKey(self::CONTEXT_ACTION_NAME, $routeContextData->getActionName());
$this->setCors($response);
@@ -120,15 +105,18 @@ final class BootstrapWeb extends BootstrapBase
sprintf(
'Routing call: %s::%s::%s',
$controllerClass,
- $methodName,
- print_r($methodParams, true)
+ $routeContextData->getMethodName(),
+ print_r($routeContextData->getMethodParams(), true)
)
);
$controller = $this->createObjectFor($controllerClass);
- return call_user_func_array([$controller, $methodName], $methodParams);
- } catch (SessionTimeout $sessionTimeout) {
+ return call_user_func_array(
+ [$controller, $routeContextData->getMethodName()],
+ $routeContextData->getMethodParams()
+ );
+ } catch (SessionTimeout) {
logger('Session timeout');
} catch (Exception $e) {
processException($e);
diff --git a/lib/SP/Core/Bootstrap/RouteContext.php b/lib/SP/Core/Bootstrap/RouteContext.php
new file mode 100644
index 00000000..8c2ffb42
--- /dev/null
+++ b/lib/SP/Core/Bootstrap/RouteContext.php
@@ -0,0 +1,57 @@
+.
+ */
+
+namespace SP\Core\Bootstrap;
+
+use RuntimeException;
+use SP\Domain\Core\Bootstrap\RouteContextData;
+use SP\Util\Filter;
+
+use function SP\__u;
+
+/**
+ * Class RouteContext
+ */
+final class RouteContext
+{
+ private const ROUTE_REGEX = /** @lang RegExp */
+ '#(?P[a-zA-Z]+)(?:/(?P[a-zA-Z]+))?(?P(/[a-zA-Z\d.]+)+)?#';
+
+
+ public static function getRouteContextData(string $route): RouteContextData
+ {
+ if (!preg_match_all(self::ROUTE_REGEX, $route, $matches)) {
+ throw new RuntimeException(__u('Invalid route'));
+ }
+
+ $controllerName = $matches['controller'][0];
+ $actionName = empty($matches['actions'][0]) ? 'index' : $matches['actions'][0];
+ $methodName = sprintf('%sAction', $actionName);
+ $methodParams = empty($matches['params'][0])
+ ? []
+ : Filter::getArray(explode('/', trim($matches['params'][0], '/')));
+
+ return new RouteContextData($controllerName, $actionName, $methodName, $methodParams);
+ }
+}
diff --git a/lib/SP/Core/Definitions/CoreDefinitions.php b/lib/SP/Core/Definitions/CoreDefinitions.php
index a85714a1..e7cbfa56 100644
--- a/lib/SP/Core/Definitions/CoreDefinitions.php
+++ b/lib/SP/Core/Definitions/CoreDefinitions.php
@@ -25,12 +25,15 @@
namespace SP\Core\Definitions;
use Aura\SqlQuery\QueryFactory;
+use http\Exception\RuntimeException;
use Monolog\Logger;
use PHPMailer\PHPMailer\PHPMailer;
use Psr\Container\ContainerInterface;
use SP\Core\Acl\Acl;
use SP\Core\Acl\Actions;
use SP\Core\Application;
+use SP\Core\Bootstrap\BootstrapApi;
+use SP\Core\Bootstrap\BootstrapWeb;
use SP\Core\Bootstrap\UriContext;
use SP\Core\Context\ContextFactory;
use SP\Core\Crypt\Crypt;
@@ -52,6 +55,8 @@ use SP\Domain\Config\Ports\ConfigInterface;
use SP\Domain\Config\Services\ConfigBackupService;
use SP\Domain\Config\Services\ConfigFileService;
use SP\Domain\Core\Acl\ActionsInterface;
+use SP\Domain\Core\Bootstrap\BootstrapInterface;
+use SP\Domain\Core\Bootstrap\ModuleInterface;
use SP\Domain\Core\Bootstrap\UriContextInterface;
use SP\Domain\Core\Context\ContextInterface;
use SP\Domain\Core\Crypt\CryptInterface;
@@ -80,6 +85,9 @@ use SP\Infrastructure\File\FileCache;
use SP\Infrastructure\File\FileCacheInterface;
use SP\Infrastructure\File\FileHandler;
use SP\Infrastructure\File\XmlHandler;
+use SP\Modules\Api\Init as InitApi;
+use SP\Modules\Cli\Init as InitCli;
+use SP\Modules\Web\Init as InitWeb;
use SP\Mvc\View\Template;
use SP\Mvc\View\TemplateInterface;
use SP\Providers\Acl\AclHandler;
@@ -241,6 +249,29 @@ final class CoreDefinitions
get(RequestInterface::class)
),
RequestBasedPasswordInterface::class => autowire(RequestBasedPassword::class),
+ BootstrapInterface::class => factory(static function (ContainerInterface $c) {
+ switch (APP_MODULE) {
+ case 'web':
+ return $c->get(BootstrapWeb::class);
+ case 'api':
+ return $c->get(BootstrapApi::class);
+ }
+
+ throw new RuntimeException(__u('Unknown module'));
+ }),
+ ModuleInterface::class => factory(static function (ContainerInterface $c) {
+ switch (APP_MODULE) {
+ case 'web':
+ return $c->get(InitWeb::class);
+ case 'api':
+ return $c->get(InitApi::class);
+ case 'cli':
+ return $c->get(InitCli::class);
+ }
+
+ throw new RuntimeException(__u('Unknown module'));
+ }),
+
];
}
}
diff --git a/lib/SP/Core/ModuleBase.php b/lib/SP/Core/ModuleBase.php
index c0f70135..410766cd 100644
--- a/lib/SP/Core/ModuleBase.php
+++ b/lib/SP/Core/ModuleBase.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -26,15 +26,14 @@ namespace SP\Core;
use SP\Domain\Config\Ports\ConfigDataInterface;
use SP\Domain\Config\Services\ConfigFileService;
+use SP\Domain\Core\Bootstrap\ModuleInterface;
use SP\Domain\Core\Context\ContextInterface;
use SP\Domain\Core\Events\EventDispatcherInterface;
/**
* Class ModuleBase
- *
- * @package SP\Core
*/
-abstract class ModuleBase
+abstract class ModuleBase implements ModuleInterface
{
protected ConfigFileService $config;
protected ConfigDataInterface $configData;
@@ -55,8 +54,6 @@ abstract class ModuleBase
$this->eventDispatcher = $application->getEventDispatcher();
}
- abstract public function initialize(string $controller): void;
-
/**
* Initializes event handlers
*/
diff --git a/lib/SP/Domain/Core/Bootstrap/BootstrapInterface.php b/lib/SP/Domain/Core/Bootstrap/BootstrapInterface.php
new file mode 100644
index 00000000..354a18c6
--- /dev/null
+++ b/lib/SP/Domain/Core/Bootstrap/BootstrapInterface.php
@@ -0,0 +1,33 @@
+.
+ */
+
+namespace SP\Domain\Core\Bootstrap;
+
+/**
+ * Interface BootstrapInterface
+ */
+interface BootstrapInterface
+{
+
+}
diff --git a/lib/SP/Domain/Core/Bootstrap/ModuleInterface.php b/lib/SP/Domain/Core/Bootstrap/ModuleInterface.php
new file mode 100644
index 00000000..13889b69
--- /dev/null
+++ b/lib/SP/Domain/Core/Bootstrap/ModuleInterface.php
@@ -0,0 +1,33 @@
+.
+ */
+
+namespace SP\Domain\Core\Bootstrap;
+
+/**
+ * Interface ModuleInterface
+ */
+interface ModuleInterface
+{
+ public function initialize(string $controller): void;
+}
diff --git a/lib/SP/Domain/Core/Bootstrap/RouteContextData.php b/lib/SP/Domain/Core/Bootstrap/RouteContextData.php
new file mode 100644
index 00000000..97c2624c
--- /dev/null
+++ b/lib/SP/Domain/Core/Bootstrap/RouteContextData.php
@@ -0,0 +1,59 @@
+.
+ */
+
+namespace SP\Domain\Core\Bootstrap;
+
+/**
+ * Class RouteContextData
+ */
+final class RouteContextData
+{
+ public function __construct(
+ private readonly string $controller,
+ private readonly string $actionName,
+ private readonly string $methodName,
+ private readonly array $methodParams
+ ) {
+ }
+
+ public function getController(): string
+ {
+ return $this->controller;
+ }
+
+ public function getActionName(): string
+ {
+ return $this->actionName;
+ }
+
+ public function getMethodName(): string
+ {
+ return $this->methodName;
+ }
+
+ public function getMethodParams(): array
+ {
+ return $this->methodParams;
+ }
+}