Skip to content

Commit 1dcf5b1

Browse files
committed
Add redis
1 parent b987602 commit 1dcf5b1

File tree

7 files changed

+69
-24
lines changed

7 files changed

+69
-24
lines changed

.idea/leantime-oss.iml

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/php.xml

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/phpspec.xml

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/Core/AppSettings.php

-18
Original file line numberDiff line numberDiff line change
@@ -40,24 +40,6 @@ public function loadSettings(Environment $config = null): void
4040
ini_set('display_errors', 0);
4141
}
4242

43-
/*
44-
if (session_status() !== PHP_SESSION_ACTIVE) {
45-
if (filter_var($config->useRedis, FILTER_VALIDATE_BOOL) && (!defined("LEAN_CLI") || !LEAN_CLI)) {
46-
ini_set('session.save_handler', 'redis');
47-
ini_set('session.save_path', $config->redisUrl);
48-
}
49-
50-
//ini_set('session.use_cookies', 1);
51-
ini_set('session.use_only_cookies', 1);
52-
ini_set('session.cookie_httponly', 1);
53-
ini_set('session.use_trans_sid', 0);
54-
55-
}
56-
57-
ini_set('session.cache_limiter', '');
58-
59-
}*/
60-
6143
ini_set("log_errors", 1);
6244

6345
if ($config->logPath != '' && $config->logPath != 'null') {

app/Core/Bootloader.php

+7-4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Illuminate\Contracts\Container\Container as IlluminateContainerContract;
1010
use Illuminate\Contracts\Encryption\Encrypter;
1111
use Illuminate\Contracts\Http\Kernel as HttpKernelContract;
12+
use Illuminate\Redis\RedisManager;
1213
use Illuminate\Session\SessionManager;
1314
use Illuminate\Support\Facades\Cache;
1415
use Illuminate\Support\Facades\Crypt;
@@ -211,9 +212,7 @@ private function registerCoreBindings(): void
211212
$this->app->singleton(OidcService::class, OidcService::class);
212213
$this->app->singleton(ModulemanagerService::class, ModulemanagerService::class);
213214
$this->app->singleton(\Illuminate\Filesystem\Filesystem::class, fn () => new \Illuminate\Filesystem\Filesystem());
214-
215215
$this->app->singleton(\Illuminate\Encryption\Encrypter::class, function ($app) {
216-
217216
$configKey = app()->make(Environment::class)->sessionPassword;
218217

219218
if (strlen($configKey) > 32) {
@@ -234,7 +233,8 @@ private function registerCoreBindings(): void
234233

235234
$app['config']['session'] = array(
236235
'driver' => "file",
237-
'lifetime' => app()->make(Environment::class)->sessionExpiration,
236+
'connection' => 'default',
237+
'lifetime' => $app['config']->sessionExpiration,
238238
'expire_on_close' => false,
239239
'encrypt' => true,
240240
'files' => APP_ROOT . '/cache/sessions',
@@ -249,7 +249,6 @@ private function registerCoreBindings(): void
249249
);
250250

251251
$sessionManager = new \Illuminate\Session\SessionManager($app);
252-
$sessionManager->setDefaultDriver("file");
253252

254253
return $sessionManager;
255254
});
@@ -268,13 +267,15 @@ private function registerCoreBindings(): void
268267
//installation cache is per server
269268
$app['config']['cache.stores.installation'] = [
270269
'driver' => 'file',
270+
'connection' => 'default',
271271
'path' => APP_ROOT . '/cache/installation',
272272
];
273273

274274
//Instance is per company id
275275
$instanceStore = fn () =>
276276
$app['config']['cache.stores.instance'] = [
277277
'driver' => 'file',
278+
'connection' => 'default',
278279
'path' => APP_ROOT . "/cache/" . $app->make(SettingsService::class)->getCompanyId(),
279280
];
280281

@@ -327,8 +328,10 @@ private function registerCoreAliases(): void
327328
$this->app->alias(\Illuminate\Session\SessionManager::class, 'session');
328329

329330
$this->app->alias(\Illuminate\Encryption\Encrypter::class, "encrypter");
331+
330332
}
331333

334+
332335
private function clearCache(): void
333336
{
334337
$currentVersion = app()->make(AppSettings::class)->appVersion;

composer.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@
6767
"nikic/php-parser": "^4.17",
6868
"nesbot/carbon": "^2.72",
6969
"spatie/icalendar-generator": "^2.6",
70-
"carbon-cli/carbon-cli": "^1.2"
70+
"carbon-cli/carbon-cli": "^1.2",
71+
"illuminate/redis": "^9.52"
7172
},
7273
"require-dev": {
7374
"squizlabs/php_codesniffer": "^3.8",

composer.lock

+55-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)