Skip to content

Commit

Permalink
Merge branch '5.x' into papac-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
papac authored Sep 23, 2023
2 parents 116fe5b + 34f1b09 commit 3e93bc7
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 30 deletions.
6 changes: 3 additions & 3 deletions .env.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
"SESSION_SECURE": false,
"SESSION_HTTPONLY": true,

"S3_KEY": "",
"S3_SECRET": "",
"S3_REGION": "us-east-1",
"AWS_KEY": "",
"AWS_SECRET": "",
"AWS_REGION": "us-east-1",
"S3_BUCKET": "buckets",

"FTP_HOSTNAME": "localhost",
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/pull-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
pull_request_target:
types: [opened]

permissions:
pull-requests: write

jobs:
uneditable:
uses: bowphp/.github/.github/workflows/pull-requests.yml@main
3 changes: 0 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name: Tests

on: [ push, pull_request ]

permissions:
contents: read

jobs:
run:
runs-on: ${{ matrix.operating-system }}
Expand Down
12 changes: 6 additions & 6 deletions app/Exceptions/ErrorHandle.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ class ErrorHandle extends BaseErrorHandler
* handle the error
*
* @param Exception $exception
* @return mixed
*/
public function handle($exception): mixed
public function handle($exception)
{
if (request()->isAjax()) {
return $this->json($exception);
}

if ($exception instanceof ModelNotFoundException || $exception instanceof HttpException) {
if (
$exception instanceof ModelNotFoundException
|| $exception instanceof HttpException
) {
$code = $exception->getStatusCode();
$source = $this->render('errors.' . $code, [
return $this->render('errors.' . $code, [
'code' => 404,
'exception' => $exception
]);

return $source;
}

if ($exception instanceof HttpResponseException) {
Expand Down
12 changes: 5 additions & 7 deletions config/cache.php
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
<?php

return [
// Define the default store
"default" => "file",

"stores" => [
// The filesystem connection
"file" => [
"driver" => "file",
"path" => __DIR__ . '/../var/cache'
],

// The database connection
"database" => [
"driver" => "database",
"connection" => app_env('DB_DEFAULT', 'mysql'),
"table" => "caches",
],

// The redis connection
"redis" => [
'driver' => 'redis',
'host' => app_env('REDIS_HOSTNAME', '127.0.0.1'),
'port' => app_env('REDIS_PORT', 6379),
'timeout' => 2.5,
'ssl' => false,
'username' => app_env('REDIS_USERNAME'),
'password' => app_env('REDIS_PASSWORD'),
'database' => app_env('REDIS_CACHE_DB', '1'),
'database' => app_env('REDIS_CACHE_DB', 5),
"prefix" => "__app__",
]
]
Expand Down
18 changes: 16 additions & 2 deletions config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* The migration memory table
*/
'migration' => 'bow_migration_status',
'migration' => 'migrations',

/**
* The database on which the default application will connect.
Expand Down Expand Up @@ -66,6 +66,20 @@
'charset' => app_env('DB_CHARSET', 'utf8'),
'prefix' => app_env('DB_PREFIX', ''),
'foreign_key_constraints' => app_env('DB_FOREIGN_KEYS', true),
]
],
],

/**
* Connexion redis
*/
"redis" => [
'driver' => 'redis',
'host' => app_env('REDIS_HOSTNAME', '127.0.0.1'),
'port' => app_env('REDIS_PORT', 6379),
'timeout' => 2.5,
'ssl' => false,
'username' => app_env('REDIS_USERNAME'),
'password' => app_env('REDIS_PASSWORD'),
'database' => app_env('REDIS_CACHE_DB', '1'),
]
];
17 changes: 14 additions & 3 deletions config/worker.php → config/queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,20 @@
* The sqs connexion
*/
"sqs" => [
"hostname" => "127.0.0.0",
"port" => 11300,
"timeout" => 10,
"url" => app_env("SQS_URL"),
'region' => app_env('AWS_REGION'),
'version' => 'latest',
'credentials' => [
'key' => app_env('AWS_KEY'),
'secret' => app_env('AWS_SECRET'),
],
],

/**
* The database connexion
*/
"database" => [
"table" => "queues",
]
]
];
6 changes: 3 additions & 3 deletions config/storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@
's3' => [
'driver' => 's3',
'bucket' => app_env('S3_BUCKET', 'settlements'),
'region' => app_env('S3_REGION'),
'region' => app_env('AWS_REGION'),
'version' => 'latest',
'credentials' => [
'key' => app_env('S3_KEY'),
'secret' => app_env('S3_SECRET'),
'key' => app_env('AWS_KEY'),
'secret' => app_env('AWS_SECRET'),
],
]
],
Expand Down

0 comments on commit 3e93bc7

Please sign in to comment.