Skip to content

Commit e222d32

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.3
Conflicts: composer.json user_guide_src/source/installation/upgrading.rst
2 parents 8785776 + e2cdbf4 commit e222d32

File tree

16 files changed

+133
-70
lines changed

16 files changed

+133
-70
lines changed

admin/RELEASE.md

Lines changed: 18 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,7 @@ git clone [email protected]:codeigniter4/userguide.git
5151
* Create a new PR from `develop` to `master`:
5252
* Title: "4.x.x Ready code"
5353
* Description: blank
54-
* Merge the PR then fast-forward `develop` to catch the merge commit
55-
* Update the next minor upgrade branch `4.x`
56-
```console
57-
git fetch origin
58-
git checkout 4.x
59-
git merge origin/4.x
60-
git merge origin/develop
61-
git push origin HEAD
62-
```
63-
* Create a new Release:
54+
* Merge the PR then create a new Release:
6455
* Version: "v4.x.x"
6556
* Title: "CodeIgniter 4.x.x"
6657
* Description:
@@ -76,25 +67,23 @@ composer create-project codeigniter4/appstarter release-test
7667
cd release-test
7768
composer test && composer info codeigniter4/framework
7869
```
79-
* publish any Security Advisories that were resolved from private forks
80-
81-
## User Guide
82-
83-
**This is now handled by GitHub Actions!**
84-
85-
Verify that the Actions succeeded:
86-
* "Deploy User Guide", this repo
87-
* "Deploy Production", UG repo
88-
* "pages-build-deployment", both repos
89-
90-
See the legacy notes in Appendix for reference or to help manually recover from workflow failures.
91-
92-
## Announcement
93-
94-
> Note: This forum is restricted to administrators.
95-
96-
* Make a new topic in the "News & Discussion" forums: https://forum.codeigniter.com/forum-2.html
97-
* The content is somewhat organic, but should include any major features and changes as well as a link to the User Guide's changelog
70+
* Verify that the User Guide Actions succeeded:
71+
* "Deploy User Guide", framework repo
72+
* "Deploy Production", UG repo
73+
* "pages-build-deployment", both repos
74+
* Fast-forward `develop` branch to catch the merge commit from `master`
75+
* Update the next minor upgrade branch `4.x`:
76+
```console
77+
git fetch origin
78+
git checkout 4.x
79+
git merge origin/4.x
80+
git merge origin/develop
81+
git push origin HEAD
82+
```
83+
* Publish any Security Advisories that were resolved from private forks
84+
* Announce the release on the forums and Slack channel (note: this forum is restricted to administrators):
85+
* Make a new topic in the "News & Discussion" forums: https://forum.codeigniter.com/forum-2.html
86+
* The content is somewhat organic, but should include any major features and changes as well as a link to the User Guide's changelog
9887

9988
## After Publishing Security Advisory
10089

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"phpstan/phpstan": "^1.7.1",
2525
"phpunit/phpunit": "^9.1",
2626
"predis/predis": "^1.1 || ^2.0",
27-
"rector/rector": "0.14.1",
27+
"rector/rector": "0.14.2",
2828
"vimeo/psalm": "^4.26"
2929
},
3030
"suggest": {

contributing/workflow.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,29 @@ For instance, to commit your work from a debugging session:
179179

180180
Just make sure that your commits in a feature branch are all related.
181181

182+
### GPG-Signing Old Commits
183+
184+
Any developer can forget GPG-signing their commits with the option `-S`, like `git commit -S -m 'Signed GPG'`. In such a case, all you need to do is the following:
185+
186+
Latest commit only:
187+
```console
188+
> git switch your-branch
189+
> git commit --amend --no-edit --no-verify -S
190+
> git push --force-with-lease origin your-branch
191+
```
192+
193+
All commits:
194+
```console
195+
> git switch your-branch
196+
> git rebase -i --root --exec 'git commit --amend --no-edit --no-verify -S'
197+
> git push --force-with-lease origin your-branch
198+
```
199+
200+
As a faster alternative, you can still securely sign commits without the `-S` option in `git commit` by setting `git config --global commit.gpgsign true` and `git config --global user.signingkey 3AC5C34371567BD2` to all local repositories. Without the `--global` option, the change is applied to one local repository only.
201+
202+
> **Note**
203+
> `3AC5C34371567BD2` is your GPG Key ID
204+
182205
### Changing a Commit Message
183206

184207
See <https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/changing-a-commit-message>.

rector.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,6 @@
110110
__DIR__ . '/app/Config/Validation.php',
111111
__DIR__ . '/tests/system/Validation/StrictRules/ValidationTest.php',
112112
__DIR__ . '/tests/system/Validation/ValidationTest.php',
113-
114-
// expected Qualified name
115-
__DIR__ . '/tests/system/Autoloader/FileLocatorTest.php',
116-
__DIR__ . '/tests/system/Router/RouteCollectionTest.php',
117113
],
118114

119115
// sometime too detail

system/CodeIgniter.php

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -718,18 +718,13 @@ protected function generateCacheName(Cache $config): string
718718
return md5($this->request->getPath());
719719
}
720720

721-
$uri = $this->request->getUri();
722-
if ($config->cacheQueryString) {
723-
if (is_array($config->cacheQueryString)) {
724-
$name = URI::createURIString($uri->getScheme(), $uri->getAuthority(), $uri->getPath(), $uri->getQuery(['only' => $config->cacheQueryString]));
725-
} else {
726-
$name = URI::createURIString($uri->getScheme(), $uri->getAuthority(), $uri->getPath(), $uri->getQuery());
727-
}
728-
} else {
729-
$name = URI::createURIString($uri->getScheme(), $uri->getAuthority(), $uri->getPath());
730-
}
721+
$uri = clone $this->request->getUri();
722+
723+
$query = $config->cacheQueryString
724+
? $uri->getQuery(is_array($config->cacheQueryString) ? ['only' => $config->cacheQueryString] : [])
725+
: '';
731726

732-
return md5($name);
727+
return md5($uri->setFragment('')->setQuery($query));
733728
}
734729

735730
/**

system/Database/BaseConnection.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* @property mixed $encrypt
3333
* @property array $failover
3434
* @property string $hostname
35-
* @property mixed $lastQuery
35+
* @property Query $lastQuery
3636
* @property string $password
3737
* @property bool $pConnect
3838
* @property int|string $port
@@ -151,7 +151,7 @@ abstract class BaseConnection implements ConnectionInterface
151151
/**
152152
* Encryption flag/data
153153
*
154-
* @var mixed
154+
* @var array|bool
155155
*/
156156
protected $encrypt = false;
157157

@@ -182,7 +182,7 @@ abstract class BaseConnection implements ConnectionInterface
182182
* The last query object that was executed
183183
* on this connection.
184184
*
185-
* @var mixed
185+
* @var Query
186186
*/
187187
protected $lastQuery;
188188

@@ -933,7 +933,7 @@ public function prepare(Closure $func, array $options = [])
933933
/**
934934
* Returns the last query's statement object.
935935
*
936-
* @return mixed
936+
* @return Query
937937
*/
938938
public function getLastQuery()
939939
{
@@ -1150,9 +1150,10 @@ private function protectDotItem(string $item, string $alias, bool $protectIdenti
11501150
*
11511151
* This function escapes column and table names
11521152
*
1153-
* @param mixed $item
1153+
* @param array|string $item
11541154
*
1155-
* @return mixed
1155+
* @return array|string
1156+
* @phpstan-return ($item is array ? array : string)
11561157
*/
11571158
public function escapeIdentifiers($item)
11581159
{
@@ -1232,9 +1233,10 @@ abstract public function affectedRows(): int;
12321233
* Escapes data based on type.
12331234
* Sets boolean and null types
12341235
*
1235-
* @param mixed $str
1236+
* @param array|bool|float|int|object|string|null $str
12361237
*
1237-
* @return mixed
1238+
* @return array|float|int|string
1239+
* @phpstan-return ($str is array ? array : float|int|string)
12381240
*/
12391241
public function escape($str)
12401242
{

system/Database/ConnectionInterface.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,10 @@ public function getLastQuery();
131131
* Escapes data based on type.
132132
* Sets boolean and null types.
133133
*
134-
* @param mixed $str
134+
* @param array|bool|float|int|object|string|null $str
135135
*
136-
* @return mixed
136+
* @return array|float|int|string
137+
* @phpstan-return ($str is array ? array : float|int|string)
137138
*/
138139
public function escape($str);
139140

system/Database/Postgre/Connection.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,10 @@ public function affectedRows(): int
171171
*
172172
* Escapes data based on type
173173
*
174-
* @param mixed $str
174+
* @param array|bool|float|int|object|string|null $str
175175
*
176-
* @return mixed
176+
* @return array|float|int|string
177+
* @phpstan-return ($str is array ? array : float|int|string)
177178
*/
178179
public function escape($str)
179180
{

system/I18n/Time.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,12 +1122,11 @@ protected static function hasRelativeKeywords(string $time): bool
11221122

11231123
/**
11241124
* Outputs a short format version of the datetime.
1125-
*
1126-
* @throws Exception
1125+
* The output is NOT localized intentionally.
11271126
*/
11281127
public function __toString(): string
11291128
{
1130-
return IntlDateFormatter::formatObject($this->toDateTime(), $this->toStringFormat, $this->locale);
1129+
return $this->format('Y-m-d H:i:s');
11311130
}
11321131

11331132
/**

tests/system/Autoloader/FileLocatorTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace CodeIgniter\Autoloader;
1313

14+
use CodeIgniter\HTTP\Header;
1415
use CodeIgniter\Test\CIUnitTestCase;
1516
use Config\Autoload;
1617
use Config\Modules;
@@ -260,7 +261,7 @@ public function testListFilesWithoutPath()
260261
public function testFindQNameFromPathSimple()
261262
{
262263
$ClassName = $this->locator->findQualifiedNameFromPath(SYSTEMPATH . 'HTTP/Header.php');
263-
$expected = '\CodeIgniter\HTTP\Header';
264+
$expected = '\\' . Header::class;
264265

265266
$this->assertSame($expected, $ClassName);
266267
}

0 commit comments

Comments
 (0)