diff --git a/.idea/leantime-oss.iml b/.idea/leantime-oss.iml index dc65bbe6f..43734fc7a 100644 --- a/.idea/leantime-oss.iml +++ b/.idea/leantime-oss.iml @@ -163,6 +163,7 @@ + diff --git a/.idea/php.xml b/.idea/php.xml index fd3bfb0a3..651818565 100644 --- a/.idea/php.xml +++ b/.idea/php.xml @@ -225,6 +225,7 @@ + diff --git a/.idea/phpspec.xml b/.idea/phpspec.xml index 2856bf96e..8645fe9c5 100644 --- a/.idea/phpspec.xml +++ b/.idea/phpspec.xml @@ -38,6 +38,9 @@ + + \ No newline at end of file diff --git a/app/Core/AppSettings.php b/app/Core/AppSettings.php index 32b602d8e..1e3a81f23 100644 --- a/app/Core/AppSettings.php +++ b/app/Core/AppSettings.php @@ -40,24 +40,6 @@ public function loadSettings(Environment $config = null): void ini_set('display_errors', 0); } - /* - if (session_status() !== PHP_SESSION_ACTIVE) { - if (filter_var($config->useRedis, FILTER_VALIDATE_BOOL) && (!defined("LEAN_CLI") || !LEAN_CLI)) { - ini_set('session.save_handler', 'redis'); - ini_set('session.save_path', $config->redisUrl); - } - - //ini_set('session.use_cookies', 1); - ini_set('session.use_only_cookies', 1); - ini_set('session.cookie_httponly', 1); - ini_set('session.use_trans_sid', 0); - - } - - ini_set('session.cache_limiter', ''); - - }*/ - ini_set("log_errors", 1); if ($config->logPath != '' && $config->logPath != 'null') { diff --git a/app/Core/Bootloader.php b/app/Core/Bootloader.php index d800aba6b..7f56165b4 100644 --- a/app/Core/Bootloader.php +++ b/app/Core/Bootloader.php @@ -9,6 +9,7 @@ use Illuminate\Contracts\Container\Container as IlluminateContainerContract; use Illuminate\Contracts\Encryption\Encrypter; use Illuminate\Contracts\Http\Kernel as HttpKernelContract; +use Illuminate\Redis\RedisManager; use Illuminate\Session\SessionManager; use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Crypt; @@ -211,9 +212,7 @@ private function registerCoreBindings(): void $this->app->singleton(OidcService::class, OidcService::class); $this->app->singleton(ModulemanagerService::class, ModulemanagerService::class); $this->app->singleton(\Illuminate\Filesystem\Filesystem::class, fn () => new \Illuminate\Filesystem\Filesystem()); - $this->app->singleton(\Illuminate\Encryption\Encrypter::class, function ($app) { - $configKey = app()->make(Environment::class)->sessionPassword; if (strlen($configKey) > 32) { @@ -234,7 +233,8 @@ private function registerCoreBindings(): void $app['config']['session'] = array( 'driver' => "file", - 'lifetime' => app()->make(Environment::class)->sessionExpiration, + 'connection' => 'default', + 'lifetime' => $app['config']->sessionExpiration, 'expire_on_close' => false, 'encrypt' => true, 'files' => APP_ROOT . '/cache/sessions', @@ -249,7 +249,6 @@ private function registerCoreBindings(): void ); $sessionManager = new \Illuminate\Session\SessionManager($app); - $sessionManager->setDefaultDriver("file"); return $sessionManager; }); @@ -268,6 +267,7 @@ private function registerCoreBindings(): void //installation cache is per server $app['config']['cache.stores.installation'] = [ 'driver' => 'file', + 'connection' => 'default', 'path' => APP_ROOT . '/cache/installation', ]; @@ -275,6 +275,7 @@ private function registerCoreBindings(): void $instanceStore = fn () => $app['config']['cache.stores.instance'] = [ 'driver' => 'file', + 'connection' => 'default', 'path' => APP_ROOT . "/cache/" . $app->make(SettingsService::class)->getCompanyId(), ]; @@ -327,8 +328,10 @@ private function registerCoreAliases(): void $this->app->alias(\Illuminate\Session\SessionManager::class, 'session'); $this->app->alias(\Illuminate\Encryption\Encrypter::class, "encrypter"); + } + private function clearCache(): void { $currentVersion = app()->make(AppSettings::class)->appVersion; diff --git a/composer.json b/composer.json index d1104ec5b..71a2791dc 100644 --- a/composer.json +++ b/composer.json @@ -67,7 +67,8 @@ "nikic/php-parser": "^4.17", "nesbot/carbon": "^2.72", "spatie/icalendar-generator": "^2.6", - "carbon-cli/carbon-cli": "^1.2" + "carbon-cli/carbon-cli": "^1.2", + "illuminate/redis": "^9.52" }, "require-dev": { "squizlabs/php_codesniffer": "^3.8", diff --git a/composer.lock b/composer.lock index 9d864cb0c..4dd187a42 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a2d23a429a667805ffb22a7a6f4381a8", + "content-hash": "1d11e667a65d455680c7f825be039445", "packages": [ { "name": "aws/aws-crt-php", @@ -2004,6 +2004,60 @@ }, "time": "2022-06-09T14:13:53+00:00" }, + { + "name": "illuminate/redis", + "version": "v9.52.16", + "source": { + "type": "git", + "url": "https://github.com/illuminate/redis.git", + "reference": "d4702b8d6a64a48cfab7259248ecbecf3b6135e2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/redis/zipball/d4702b8d6a64a48cfab7259248ecbecf3b6135e2", + "reference": "d4702b8d6a64a48cfab7259248ecbecf3b6135e2", + "shasum": "" + }, + "require": { + "illuminate/collections": "^9.0", + "illuminate/contracts": "^9.0", + "illuminate/macroable": "^9.0", + "illuminate/support": "^9.0", + "php": "^8.0.2" + }, + "suggest": { + "ext-redis": "Required to use the phpredis connector (^4.0|^5.0).", + "predis/predis": "Required to use the predis connector (^1.1.9|^2.0.2)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Redis\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Redis package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2023-07-31T15:01:27+00:00" + }, { "name": "illuminate/session", "version": "v9.52.16",