Skip to content

Commit

Permalink
chore: adjust configs
Browse files Browse the repository at this point in the history
  • Loading branch information
albertcht committed Sep 3, 2024
1 parent 1ae51b4 commit 9711f0a
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 9 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"friendsofhyperf/tinker": "~3.1.0",
"hyperf/paginator": "~3.1.0",
"hyperf/redis": "~3.1.0",
"hyperf/session": "~3.1.0",
"hyperf/validation": "~3.1.0",
"hyperf/view": "~3.1.0",
"hyperf/view-engine": "~3.1.0",
Expand Down
1 change: 1 addition & 0 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
'Response' => SwooleTW\Hyperf\Support\Facades\Response::class,
'Route' => SwooleTW\Hyperf\Support\Facades\Route::class,
'Schedule' => SwooleTW\Hyperf\Support\Facades\Schedule::class,
'Session' => SwooleTW\Hyperf\Support\Facades\Session::class,
'URL' => SwooleTW\Hyperf\Support\Facades\URL::class,
'Validator' => SwooleTW\Hyperf\Support\Facades\Validator::class,
'View' => SwooleTW\Hyperf\Support\Facades\View::class,
Expand Down
4 changes: 2 additions & 2 deletions config/cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@

'file' => [
'driver' => 'file',
'path' => BASE_PATH . '/storage/cache/data',
'lock_path' => BASE_PATH . '/storage/cache/data',
'path' => storage_path('cache/data'),
'lock_path' => storage_path('cache/data'),
],

'redis' => [
Expand Down
6 changes: 3 additions & 3 deletions config/logging.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@

'single' => [
'driver' => 'single',
'path' => BASE_PATH . '/storage/logs/hyperf.log',
'path' => storage_path('logs/hyperf.log'),
'level' => env('LOG_LEVEL', 'debug'),
'replace_placeholders' => true,
],

'daily' => [
'driver' => 'daily',
'path' => BASE_PATH . '/storage/logs/hyperf.log',
'path' => storage_path('logs/hyperf.log'),
'level' => env('LOG_LEVEL', 'debug'),
'days' => 14,
'replace_placeholders' => true,
Expand Down Expand Up @@ -134,7 +134,7 @@
],

'emergency' => [
'path' => BASE_PATH . '/storage/logs/hyperf.log',
'path' => storage_path('logs/hyperf.log'),
],
],
];
4 changes: 2 additions & 2 deletions config/server.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
'http' => HttpKernel::class,
],
'settings' => [
'document_root' => BASE_PATH . '/public',
'document_root' => base_path('public'),
'enable_static_handler' => true,
Constant::OPTION_ENABLE_COROUTINE => true,
Constant::OPTION_WORKER_NUM => swoole_cpu_num(),
Constant::OPTION_PID_FILE => BASE_PATH . '/runtime/hyperf.pid',
Constant::OPTION_PID_FILE => base_path('runtime/hyperf.pid'),
Constant::OPTION_OPEN_TCP_NODELAY => true,
Constant::OPTION_MAX_COROUTINE => 100000,
Constant::OPTION_OPEN_HTTP2_PROTOCOL => true,
Expand Down
26 changes: 26 additions & 0 deletions config/session.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

declare(strict_types=1);
/**
* This file is part of Hyperf.
*
* @link https://www.hyperf.io
* @document https://hyperf.wiki
* @contact group@hyperf.io
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/
use Hyperf\Session\Handler;

return [
'handler' => Handler\FileHandler::class,
'options' => [
'path' => storage_path('framework/sessions'),
'connection' => 'default',
'table' => 'sessions',
'gc_maxlifetime' => 1200,
'session_name' => 'HYPERF_SESSION_ID',
'domain' => null,
'cookie_lifetime' => 5 * 60 * 60,
'cookie_same_site' => 'lax',
],
];
4 changes: 2 additions & 2 deletions config/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
'engine' => HyperfViewEngine::class,
'mode' => Mode::SYNC,
'config' => [
'view_path' => BASE_PATH . '/resources/views/',
'cache_path' => BASE_PATH . '/storage/framework/views/',
'view_path' => base_path('resources/views/'),
'cache_path' => storage_path('framework/views/'),
],
'components' => [
//
Expand Down

0 comments on commit 9711f0a

Please sign in to comment.