Skip to content

Commit 4bc010b

Browse files
committed
extending、changelogs 同步完成
1 parent fbb4027 commit 4bc010b

8 files changed

Lines changed: 193 additions & 107 deletions

File tree

source/changelogs/index.rst

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,28 @@ Version |version|
1010
See all the changes.
1111

1212
.. toctree::
13-
:titlesonly:
13+
:titlesonly:
1414

15-
v4.1.2
16-
v4.1.1
17-
v4.1.0
18-
v4.0.5
19-
v4.0.4
20-
v4.0.3
21-
v4.0.0
22-
v4.0.0-rc.4
23-
v4.0.0-rc.3
24-
v4.0.0-rc.2
25-
v4.0.0-rc.1
26-
v4.0.0-beta.4
27-
v4.0.0-beta.3
28-
v4.0.0-beta.2
29-
v4.0.0-beta.1
30-
v4.0.0-alpha.5
31-
v4.0.0-alpha.4
32-
v4.0.0-alpha.3
33-
v4.0.0-alpha.2
34-
v4.0.0-alpha.1
15+
v4.1.5
16+
v4.1.4
17+
v4.1.3
18+
v4.1.2
19+
v4.1.1
20+
v4.1.0
21+
v4.0.5
22+
v4.0.4
23+
v4.0.3
24+
v4.0.0
25+
v4.0.0-rc.4
26+
v4.0.0-rc.3
27+
v4.0.0-rc.2
28+
v4.0.0-rc.1
29+
v4.0.0-beta.4
30+
v4.0.0-beta.3
31+
v4.0.0-beta.2
32+
v4.0.0-beta.1
33+
v4.0.0-alpha.5
34+
v4.0.0-alpha.4
35+
v4.0.0-alpha.3
36+
v4.0.0-alpha.2
37+
v4.0.0-alpha.1

source/changelogs/v4.1.3.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Version 4.1.3
2+
=============
3+
4+
Release Date: June 6, 2021
5+
6+
**4.1.3 release of CodeIgniter4**
7+
8+
Enhancements:
9+
10+
- New functions in the File Helper: ``directory_mirror()`` and ``same_file()``
11+
- Implemented NexusPHP's ``Tachycardia`` for slow test identification
12+
- Added a new ``$ttl`` option to ``Cache`` config for future use
13+
14+
Changes:
15+
16+
- Added MySQL 8.0 to the test matrix
17+
- Improved environment detection from ``$_SERVER``
18+
- Numerous sweeping code improvements via Rector and analysis
19+
20+
Bugs Fixed:
21+
22+
- Fixed a bug where ``CURLRequest`` would try to use a project URI instead of its base
23+
- Fixed a bug where CLI mode was not detected under ``cgi-fcgi``
24+
- Fixed a logic bug in Cookie construction
25+
- Fixed numerous issues in SQLite3's ``Forge`` class related to an incorrect attribute name

source/changelogs/v4.1.4.rst

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
Version 4.1.4
2+
=============
3+
4+
Release Date: September 6, 2021
5+
6+
**4.1.4 release of CodeIgniter4**
7+
8+
This release focuses on code style. All changes (except those noted below) are cosmetic to bring the code in line with the new
9+
`CodeIgniter Coding Standard <https://github.com/CodeIgniter/coding-standard>`_ (based on PSR-12).
10+
11+
Breaking Changes:
12+
13+
- The following methods were changed from "public" to "protected" to match their parent class methods and better align with their uses:
14+
15+
* ``CodeIgniter\Database\MySQLi\Connection::execute()``
16+
* ``CodeIgniter\Database\MySQLi\Connection::_fieldData()``
17+
* ``CodeIgniter\Database\MySQLi\Connection::_indexData()``
18+
* ``CodeIgniter\Database\MySQLi\Connection::_foreignKeyData()``
19+
* ``CodeIgniter\Database\Postgre\Builder::_like_statement()``
20+
* ``CodeIgniter\Database\Postgre\Connection::execute()``
21+
* ``CodeIgniter\Database\Postgre\Connection::_fieldData()``
22+
* ``CodeIgniter\Database\Postgre\Connection::_indexData()``
23+
* ``CodeIgniter\Database\Postgre\Connection::_foreignKeyData()``
24+
* ``CodeIgniter\Database\SQLSRV\Connection::execute()``
25+
* ``CodeIgniter\Database\SQLSRV\Connection::_fieldData()``
26+
* ``CodeIgniter\Database\SQLSRV\Connection::_indexData()``
27+
* ``CodeIgniter\Database\SQLSRV\Connection::_foreignKeyData()``
28+
* ``CodeIgniter\Database\SQLite3\Connection::execute()``
29+
* ``CodeIgniter\Database\SQLite3\Connection::_fieldData()``
30+
* ``CodeIgniter\Database\SQLite3\Connection::_indexData()``
31+
* ``CodeIgniter\Database\SQLite3\Connection::_foreignKeyData()``
32+
* ``CodeIgniter\Images\Handlers\GDHandler::_flatten()``
33+
* ``CodeIgniter\Images\Handlers\GDHandler::_flip()``
34+
* ``CodeIgniter\Images\Handlers\ImageMagickHandler::_flatten()``
35+
* ``CodeIgniter\Images\Handlers\ImageMagickHandler::_flip()``
36+
* ``CodeIgniter\Test\Mock\MockIncomingRequest::detectURI()``
37+
* ``CodeIgniter\Test\Mock\MockSecurity.php::sendCookie()``
38+
39+
- To be compatible with the strict inheritance checks of PHP 8.1, the following method signatures were added return types to match their parents' signatures whenever possible:
40+
41+
* ``CodeIgniter\Cookie\Cookie::offsetExists()``
42+
* ``CodeIgniter\Cookie\Cookie::offsetSet()``
43+
* ``CodeIgniter\Cookie\Cookie::offsetUnset()``
44+
* ``CodeIgniter\Cookie\CookieStore::getIterator()``
45+
* ``CodeIgniter\I18n\Time::__wakeup()``
46+
* ``CodeIgniter\Test\Filters\CITestStreamFilter::filter()``
47+
48+
- Related to the strict inheritance checks of PHP 8.1, the following session handlers implementing ``SessionHandlerInterface`` have their public methods modified to match the interface:
49+
50+
* ``CodeIgniter\Session\Handlers\ArrayHandler``
51+
* ``CodeIgniter\Session\Handlers\DatabaseHandler``
52+
* ``CodeIgniter\Session\Handlers\FileHandler``
53+
* ``CodeIgniter\Session\Handlers\MemcachedHandler``
54+
* ``CodeIgniter\Session\Handlers\RedisHandler``

source/changelogs/v4.1.5.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
Version 4.1.5
2+
#############
3+
4+
Release Date: November 8, 2021
5+
6+
**4.1.5 release of CodeIgniter4**
7+
8+
.. contents::
9+
:local:
10+
:depth: 1
11+
12+
BREAKING
13+
========
14+
15+
- Fixed `a bug <https://github.com/codeigniter4/CodeIgniter4/issues/2913>`_ on CSRF protection. Now CSRF protection works on PUT/PATCH/DELETE requests when CSRF filter is applied. If you use such requests, you need to send CSRF token.
16+
- In the previous version, if you didn't provide your own headers, ``CURLRequest`` would send the request-headers from the browser, due to a bug. As of this version, it does not send them.
17+
- Fixed ``BaseBuilder::insertBatch()`` return value for ``testMode``. Now it returns SQL string array instead of a number of affected rows. This change was made because of maintaining compatibility between returning types for batch methods. Now the returned data type for ``BaseBuilder::insertBatch()`` is the same as the `updateBatch()` method.
18+
- Major optimizations have been made to the way data is processed in ``BaseBuilder::insertBatch()`` and ``BaseBuilder::updateBatch()`` methods. This resulted in reduced memory usage and faster query processing. As a trade-off, the result generated by the ``$query->getOriginalQuery()`` method was changed. It no longer returns the query with the binded parameters, but the actual query that was run.
19+
20+
Enhancements
21+
============
22+
23+
- Added Cache config for reserved characters
24+
- The ``addForeignKey`` function of the ``Forge`` class can now define composite foreign keys in an array
25+
- The ``dropKey`` function of the ``Forge`` class can remove key
26+
27+
Changes
28+
=======
29+
30+
- Always escape identifiers in the ``set``, ``setUpdateBatch``, and ``insertBatch`` functions in ``BaseBuilder``.
31+
32+
Deprecations
33+
============
34+
35+
- Deprecated ``CodeIgniter\\Cache\\Handlers\\BaseHandler::RESERVED_CHARACTERS`` in favor of the new config property

source/extending/authentication.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,14 @@ CodeIgniter 刻意不提供內建的認證或授權相關類別,因為已經
77
===============
88

99
* 處理登入以及登出的操作應該在成功時觸發相應的 ``login`` 與 ``logout`` 事件。
10-
* 定義 "目前使用者" 的模組應該定義函數 ``user_id()`` 來回傳使用者的唯一識別符號,對於 "目前沒有使用者" 登入應該回傳 ``null`` 。
10+
* 定義 "目前使用者" 的模組應該定義函數 ``user_id()`` 來回傳使用者的唯一識別符號,對於 "目前沒有使用者" 登入應該回傳 ``null`` 。
11+
12+
符合上述建議的模組可以透過在 **composer.json** 中加入以下內容來表示相容性。
13+
14+
::
15+
16+
"provide": {
17+
"codeigniter4/authentication-implementation": "1.0"
18+
},
19+
20+
你可以在 `Packagist <https://packagist.org/providers/codeigniter4/authentication-implementation>`_ 上查閱提供上述實作模組列表。

source/extending/basecontroller.rst

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ CodeIgniter 的核心控制器不應該被改變,但是在 **app/Controllers/B
66

77
::
88

9-
<?php
9+
<?php
1010

11-
namespace App\Controllers;
11+
namespace App\Controllers;
1212

13-
use CodeIgniter\Controller;
13+
use CodeIgniter\Controller;
1414

15-
class Home extends BaseController
16-
{
17-
// ...
18-
}
15+
class Home extends BaseController
16+
{
17+
// ...
18+
}
1919

2020

2121
預載組件
@@ -25,19 +25,19 @@ CodeIgniter 的核心控制器不應該被改變,但是在 **app/Controllers/B
2525

2626
::
2727

28-
protected $helpers = ['html', 'text'];
28+
protected $helpers = ['html', 'text'];
2929

3030
任何需要載入的組件或需要處理的資料都應該加入到建構函數 ``initController()`` 中。例如:你的專案大量使用到會談程式庫,你可以會需要在這裡啟動它:
3131

3232
::
3333

34-
public function initController(...)
35-
{
36-
// 請不要編輯這行
37-
parent::initController($request, $response, $logger);
38-
39-
$this->session = \Config\Services::session();
40-
}
34+
public function initController(...)
35+
{
36+
// 請不要編輯這行
37+
parent::initController($request, $response, $logger);
38+
39+
$this->session = \Config\Services::session();
40+
}
4141

4242
新增方法
4343
==================
@@ -53,7 +53,7 @@ CodeIgniter 的核心控制器不應該被改變,但是在 **app/Controllers/B
5353

5454
::
5555

56-
class Home extends \CodeIgniter\Controller
57-
{
58-
59-
}
56+
class Home extends \CodeIgniter\Controller
57+
{
58+
59+
}

source/extending/contributing.rst

Lines changed: 2 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -2,53 +2,6 @@
22
為 CodeIgniter 貢獻
33
###########################
44

5-
CodeIgniter 是一個社群促使開發的專案,接受來自社群的程式碼與使用手冊的貢獻。這些貢獻以發出問題或 `拉取請求 <https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests>`_ 的形式在 GitHub 上的 `CodeIgniter4 儲存庫 <https://github.com/codeigniter4/CodeIgniter4>`_ 中提交。
5+
CodeIgniter 是一個社群驅動開發的專案,接受來自社群的程式碼與使用手冊的貢獻。這些貢獻以發出問題或 `拉取請求 <https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests>`_ 的形式在 GitHub 上的 `CodeIgniter4 儲存庫 <https://github.com/codeigniter4/CodeIgniter4>`_ 中提交。
66

7-
發出問題是一種快速指出 BUG 的方法,如果你在 CodeIgniter 或 使用手冊發現了錯誤,那麼請你先檢查幾件事:
8-
9-
- 是否從未有人針對這個錯誤發出問題
10-
- 這個問題是否已經被修復了(查看分支或尋找已經被關閉的問題)
11-
- 是不是真的有很明顯的問題需要你去解決?
12-
13-
問題回報是非常用的方法,但更好的方案是透過分叉主儲存庫並提交修改到你自己的副本中,再回到 GitHub 發送拉取請求(這需要你使用 Git 版本控制系統)。
14-
15-
詳情請見儲存庫中的 `貢獻至 CodeIgniter4 <https://github.com/codeigniter4/CodeIgniter4/tree/develop/contributing>`_ 部分。
16-
17-
*******
18-
支援
19-
*******
20-
21-
請注意, GitHub 儲存庫並不是回答一般問題的地方!如果你在使用某項功能遇到了非錯誤的困難,你可以:
22-
23-
- 在 `論壇 <http://forum.codeigniter.com/>`_ 上創建主題
24-
- 在 `Slack <https://codeigniterchat.slack.com/>`_ 提出你的問題
25-
26-
如果你確定你的使用方法是否正確,或是你真的發現了 BUG ,煩請先至論壇上詢問。
27-
28-
********
29-
安全性
30-
********
31-
32-
你是否發現了 CodeIgniter 中的安全性問題?
33-
34-
請 *不要* 公開它們,請你發送電子郵件至 security@codeigniter.com ,或在 `HackerOne <https://hackerone.com/codeigniter>`_ 上的頁面傳送問題報告。
35-
36-
如果你真的發現了嚴重的漏洞,我們很願意將這個功勞歸功於你,並紀載至 `ChangeLog <../changelogs/index.html>`_ 上。
37-
38-
****************************
39-
如何撰寫好的問題回報
40-
****************************
41-
42-
使用一個具有描述性的主題,例如:解釋器程式庫無法正確解釋逗號( parser library chokes on commas ),而不是一個模糊的標題:你的程式碼壞掉了( your code broke )。
43-
44-
在一個問題回報中只提出一個問題。
45-
46-
請列出你所知道發生問題的版本(例如: 4.0.1 )或是組件為何(例如:解釋器)。
47-
48-
解釋一下你預期會有什麼結果,但卻發生了什麼問題。如果有的話也可以提供:錯誤訊息以及堆疊追蹤的資訊。
49-
50-
如果簡短的程式碼塊有助於你解釋錯誤的話,也請附上。你可以使用 pastebin 或 Dropbox 的工具,來幫助你處理較長的程式碼與螢幕截圖——不要將它們直接置於問題報告中。
51-
52-
如果你知道如何解決這個問題,你可以在自己的分叉與分支中這麼做,並且提交一個拉取請求給主儲存庫,而上面的問題報告也請附在拉取請求中。
53-
54-
如果你的問題報告能描述出重現問題的方法,那就太好了!如果你能包含重現問題的單元測試,那就更好了!因為這樣可以幫助修復問題人員可以有更明確的目標。
7+
如果你想要做出貢獻,請查閱我們儲存庫中的 `貢獻 CodeIgniter4 <https://github.com/codeigniter4/CodeIgniter4/tree/develop/contributing>`_ 。

source/extending/core_classes.rst

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,19 @@
5757
}
5858

5959

60-
然後,你得修改 ``routes`` 服務,改成載入你的類別:
60+
然後,你得修改在 **app/Config/Services.php** 的 ``routes`` 服務,改成載入你的類別:
6161

6262
::
6363

64-
public static function routes(bool $getShared = true)
65-
{
66-
if ($getShared)
67-
{
68-
return static::getSharedInstance('routes');
69-
}
64+
public static function routes(bool $getShared = true)
65+
{
66+
if ($getShared)
67+
{
68+
return static::getSharedInstance('routes');
69+
}
7070

71-
return new RouteCollection(static::locator(), config('Modules'));
72-
}
71+
return new RouteCollection(static::locator(), config('Modules'));
72+
}
7373

7474
擴充核心系統類別
7575
======================
@@ -82,29 +82,35 @@
8282

8383
::
8484

85-
<?php namespace App\Libraries;
85+
<?php
86+
87+
namespace App\Libraries;
8688

8789
use CodeIgniter\Router\RouteCollection;
8890

8991
class RouteCollection extends RouteCollection
9092
{
91-
93+
// ...
9294
}
9395

9496
如果你需要在你的類別中使用建構函數,請確定你同時運作了父類別的擴充函數:
9597

9698
::
9799

98-
<?php namespace App\Libraries;
100+
<?php
101+
102+
namespace App\Libraries;
99103

100104
use CodeIgniter\Router\RouteCollection as BaseRouteCollection;
101105

102106
class RouteCollection extends BaseRouteCollection
103107
{
104-
public function __construct()
105-
{
106-
parent::__construct();
107-
}
108-
}
108+
public function __construct()
109+
{
110+
parent::__construct();
111+
112+
// your code here
113+
}
114+
}
109115

110116
**Tip :** 在你的類別中,任何與父類別相同的函數都將被使用,而不會使用原生的函數,這就是所謂的方法覆寫,你可以利用這種方式大幅度地修改 CodeIgniter 的核心。

0 commit comments

Comments
 (0)