diff --git a/.gitignore b/.gitignore index 78baa0f79..fb0a8e536 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,9 @@ .env composer.lock +/donjo-app/cache/session +!/donjo-app/cache/session/index.php + # abaikan pada donjo-sys /donjo-sys/ @@ -11,3 +14,4 @@ composer.lock .php-cs-fixer.cache /install.sid + diff --git a/composer.json b/composer.json index d12c1f370..046508c04 100644 --- a/composer.json +++ b/composer.json @@ -7,6 +7,7 @@ }, "require-dev": { "codeigniter/coding-standard": "^1.1", + "filp/whoops": "^2.15", "friendsofphp/php-cs-fixer": "^3", "mikey179/vfsstream": "1.6.*" }, diff --git a/donjo-app/cache/session/index.html b/donjo-app/cache/session/index.html new file mode 100644 index 000000000..b702fbc39 --- /dev/null +++ b/donjo-app/cache/session/index.html @@ -0,0 +1,11 @@ + + +
+Directory access is forbidden.
+ + + diff --git a/donjo-app/config/config.php b/donjo-app/config/config.php index a77239ac6..423bb868e 100644 --- a/donjo-app/config/config.php +++ b/donjo-app/config/config.php @@ -105,7 +105,7 @@ | setting this variable to TRUE (boolean). See the user guide for details. | */ -$config['enable_hooks'] = false; +$config['enable_hooks'] = true; /* |-------------------------------------------------------------------------- @@ -390,7 +390,7 @@ $config['sess_cookie_name'] = 'ci_session'; $config['sess_samesite'] = 'Lax'; $config['sess_expiration'] = 7200; -$config['sess_save_path'] = null; +$config['sess_save_path'] = APPPATH . 'cache/session/'; $config['sess_match_ip'] = false; $config['sess_time_to_update'] = 300; $config['sess_regenerate_destroy'] = false; diff --git a/donjo-app/config/hooks.php b/donjo-app/config/hooks.php index 43b02544a..2e290b6bf 100644 --- a/donjo-app/config/hooks.php +++ b/donjo-app/config/hooks.php @@ -12,3 +12,11 @@ | https://codeigniter.com/userguide3/general/hooks.html | */ + +$hook['pre_system'][] = [ + 'class' => 'WhoopsHook', + 'function' => 'bootWhoops', + 'filename' => 'WhoopsHook.php', + 'filepath' => 'hooks', + 'params' => [], +]; diff --git a/donjo-app/hooks/WhoopsHook.php b/donjo-app/hooks/WhoopsHook.php new file mode 100644 index 000000000..a43532068 --- /dev/null +++ b/donjo-app/hooks/WhoopsHook.php @@ -0,0 +1,11 @@ +pushHandler(new Whoops\Handler\PrettyPageHandler()); + $whoops->register(); + } +}