Skip to content

Commit 9c94729

Browse files
authored
Merge branch 'codeigniter4:develop' into patch-9
2 parents c7d6825 + 482b8bb commit 9c94729

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+271
-75
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Check File Permissions
2+
3+
on:
4+
pull_request:
5+
push:
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
9+
cancel-in-progress: true
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
permission-check:
16+
name: Check File Permission
17+
runs-on: ubuntu-22.04
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Detect unnecessary execution permissions
24+
run: php utils/check_permission_x.php

admin/starter/tests/.htaccess

100755100644
File mode changed.

admin/starter/tests/index.html

100755100644
File mode changed.

app/Config/DocTypes.php

100755100644
File mode changed.

rector.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,9 @@
4444
use Rector\EarlyReturn\Rector\Return_\PreparedValueToEarlyReturnRector;
4545
use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector;
4646
use Rector\Php70\Rector\FuncCall\RandomFunctionRector;
47-
use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector;
4847
use Rector\Php80\Rector\Class_\AnnotationToAttributeRector;
4948
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
5049
use Rector\Php80\Rector\FunctionLike\MixedTypeRector;
51-
use Rector\Php81\Rector\ClassConst\FinalizePublicClassConstantRector;
5250
use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector;
5351
use Rector\PHPUnit\AnnotationsToAttributes\Rector\Class_\AnnotationWithValueToAttributeRector;
5452
use Rector\PHPUnit\AnnotationsToAttributes\Rector\Class_\CoversAnnotationWithValueToAttributeRector;
@@ -107,7 +105,6 @@
107105
__DIR__ . '/tests/_support/Commands/Foobar.php',
108106
__DIR__ . '/tests/_support/View',
109107

110-
JsonThrowOnErrorRector::class,
111108
YieldDataProviderRector::class,
112109

113110
RemoveUnusedPromotedPropertyRector::class => [
@@ -174,16 +171,6 @@
174171
],
175172
MixedTypeRector::class,
176173

177-
// PHP 8.1 features but cause breaking changes
178-
FinalizePublicClassConstantRector::class => [
179-
__DIR__ . '/system/Cache/Handlers/BaseHandler.php',
180-
__DIR__ . '/system/Cache/Handlers/FileHandler.php',
181-
__DIR__ . '/system/CodeIgniter.php',
182-
__DIR__ . '/system/Events/Events.php',
183-
__DIR__ . '/system/Log/Handlers/ChromeLoggerHandler.php',
184-
__DIR__ . '/system/Log/Handlers/ErrorlogHandler.php',
185-
__DIR__ . '/system/Security/Security.php',
186-
],
187174
ReturnNeverTypeRector::class => [
188175
__DIR__ . '/system/Cache/Handlers/BaseHandler.php',
189176
__DIR__ . '/system/Cache/Handlers/MemcachedHandler.php',

system/Database/BaseConnection.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,12 @@ public function initialize()
420420
// Connect to the database and set the connection ID
421421
$this->connID = $this->connect($this->pConnect);
422422
} catch (Throwable $e) {
423-
$connectionErrors[] = sprintf('Main connection [%s]: %s', $this->DBDriver, $e->getMessage());
423+
$this->connID = false;
424+
$connectionErrors[] = sprintf(
425+
'Main connection [%s]: %s',
426+
$this->DBDriver,
427+
$e->getMessage()
428+
);
424429
log_message('error', 'Error connecting to the database: ' . $e);
425430
}
426431

@@ -441,7 +446,12 @@ public function initialize()
441446
// Try to connect
442447
$this->connID = $this->connect($this->pConnect);
443448
} catch (Throwable $e) {
444-
$connectionErrors[] = sprintf('Failover #%d [%s]: %s', ++$index, $this->DBDriver, $e->getMessage());
449+
$connectionErrors[] = sprintf(
450+
'Failover #%d [%s]: %s',
451+
++$index,
452+
$this->DBDriver,
453+
$e->getMessage()
454+
);
445455
log_message('error', 'Error connecting to the database: ' . $e);
446456
}
447457

system/Database/Postgre/Connection.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,24 @@ public function connect(bool $persistent = false)
7878
$this->connID = $persistent === true ? pg_pconnect($this->DSN) : pg_connect($this->DSN);
7979

8080
if ($this->connID !== false) {
81-
if ($persistent === true && pg_connection_status($this->connID) === PGSQL_CONNECTION_BAD && pg_ping($this->connID) === false
81+
if (
82+
$persistent === true
83+
&& pg_connection_status($this->connID) === PGSQL_CONNECTION_BAD
84+
&& pg_ping($this->connID) === false
8285
) {
83-
return false;
86+
$error = pg_last_error($this->connID);
87+
88+
throw new DatabaseException($error);
8489
}
8590

8691
if (! empty($this->schema)) {
8792
$this->simpleQuery("SET search_path TO {$this->schema},public");
8893
}
8994

9095
if ($this->setClientEncoding($this->charset) === false) {
91-
return false;
96+
$error = pg_last_error($this->connID);
97+
98+
throw new DatabaseException($error);
9299
}
93100
}
94101

system/Database/SQLSRV/Builder.php

100755100644
File mode changed.

system/Database/SQLSRV/Connection.php

100755100644
File mode changed.

system/Database/SQLSRV/Forge.php

100755100644
File mode changed.

0 commit comments

Comments
 (0)