Skip to content

Commit a830e4e

Browse files
committed
升级到 4.4.5
1 parent 59e1243 commit a830e4e

File tree

226 files changed

+1848
-617
lines changed

Some content is hidden

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

226 files changed

+1848
-617
lines changed

requirements.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
sphinx>=4.5.0,<5
2-
sphinxcontrib-phpdomain>=0.8.0
3-
docutils>=0.16
4-
sphinx-rtd-theme>=0.5.0
5-
jinja2<3.1
1+
sphinx>=5.3.0,<6.0.0
2+
sphinxcontrib-phpdomain>=0.11.0
3+
docutils>=0.19
4+
sphinx-rtd-theme>=2.0.0,<3.0.0
5+
jinja2>=3.1.3,<4.0.0
66
jieba==0.42.1

source/changelogs/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
.. toctree::
1313
:titlesonly:
1414

15+
v4.4.5
16+
v4.4.4
1517
v4.4.3
1618
v4.4.2
1719
v4.4.1

source/changelogs/v4.4.4.rst

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#############
2+
版本 4.4.4
3+
#############
4+
5+
发布日期:2023 年 12 月 28 日
6+
7+
**CodeIgniter4 的 4.4.4 版本发布**
8+
9+
.. contents::
10+
:local:
11+
:depth: 3
12+
13+
********
14+
重大变化
15+
********
16+
17+
采用 Dot 数组语法进行验证
18+
=========================
19+
20+
使用通配符 ``*`` 的验证规则现在只验证符合"Dot 数组语法"的正确维度数据。
21+
详见 :ref:`升级 <upgrade-444-validation-with-dot-array-syntax>` 获取详情。
22+
23+
验证规则匹配和差异
24+
===================
25+
26+
在严格和传统规则中,``matches`` 和 ``differs`` 验证非字符串类型数据的情况已修复。
27+
28+
在 CURLRequest 中移除了 `ssl_key` 选项的使用
29+
============================================
30+
31+
由于一个错误,我们在 CURLRequest 中使用了未记录的 `ssl_key` 配置选项来定义 CA bundle。现在已经修复,并且按照文档要求工作。你可以通过 `verify` 选项来定义你的 CA bundle。
32+
33+
文件系统助手
34+
=============
35+
36+
:php:func:`get_filenames()` 现在会跟踪符号连接文件夹,而之前只是返回而不跟踪。
37+
38+
********
39+
改进
40+
********
41+
42+
- 完全支持 PHP 8.3。
43+
44+
***************
45+
消息变更
46+
***************
47+
48+
- 添加 ``HTTP.invalidJSON`` 错误消息。
49+
- 添加 ``HTTP.unsupportedJSONFormat`` 错误消息。
50+
51+
************
52+
弃用
53+
************
54+
55+
- **请求:** :php:meth:`CodeIgniter\\HTTP\\Request::getEnv()` 方法已被弃用。此方法自从一开始就没有工作,请使用 :php:func:`env()`。
56+
57+
************
58+
已修复的错误
59+
************
60+
61+
- **CURLRequest:** 修复了即使配置项 'verify' 设置为 *false* 时,也会检查主机名的错误。
62+
63+
要查看完整的错误修复列表,请去看仓库的 `CHANGELOG.md <https://github.com/codeigniter4/CodeIgniter4/blob/develop/CHANGELOG.md>`_。

source/changelogs/v4.4.5.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#############
2+
版本 4.4.5
3+
#############
4+
5+
发布日期:2024 年 1 月 27 日
6+
7+
**CodeIgniter4 的 4.4.5 版本发布**
8+
9+
.. contents::
10+
:local:
11+
:depth: 3
12+
13+
************
14+
已修复的错误
15+
************
16+
17+
- **QueryBuilder:** 修复了因为 PostgreSQL 上的类型错误,导致 ``updateBatch()`` 方法无法工作的问题。
18+
19+
要查看完整的错误修复列表,可以查看仓库的 `CHANGELOG.md <https://github.com/codeigniter4/CodeIgniter4/blob/develop/CHANGELOG.md>`_。

source/cli/cli_generators.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ make:command
7575
选项:
7676
========
7777
* ``--command``:在 spark 中运行的命令名称。默认为 ``command:name``。
78-
* ``--group``:命令的组/命名空间。对于基本命令默认为 ``CodeIgniter``,对于生成器命令默认为 ``Generators``。
78+
* ``--group``:命令的组/命名空间。对于基本命令默认为 ``App``,对于生成器命令默认为 ``Generators``。
7979
* ``--type``:命令类型,可以是 ``basic`` 基本命令或 ``generator`` 生成器命令。默认为 ``basic``。
8080
* ``--namespace``:设置根命名空间。默认为 ``APP_NAMESPACE`` 的值。
8181
* ``--suffix``:在生成的类名后附加组件后缀。

source/cli/cli_library/002.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
<?php
22

3+
use CodeIgniter\CLI\CLI;
4+
35
$color = CLI::prompt('What is your favorite color?');

source/cli/cli_library/003.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
<?php
22

3+
use CodeIgniter\CLI\CLI;
4+
35
$color = CLI::prompt('What is your favorite color?', 'blue');

source/cli/cli_library/004.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
<?php
22

3+
use CodeIgniter\CLI\CLI;
4+
35
$overwrite = CLI::prompt('File exists. Overwrite?', ['y', 'n']);

source/cli/cli_library/005.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
<?php
22

3+
use CodeIgniter\CLI\CLI;
4+
35
$email = CLI::prompt('What is your email?', null, 'required|valid_email');

source/cli/cli_library/006.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
<?php
22

3+
use CodeIgniter\CLI\CLI;
4+
35
$email = CLI::prompt('What is your email?', null, ['required', 'valid_email']);

source/cli/cli_library/007.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
use CodeIgniter\CLI\CLI;
4+
35
$fruit = CLI::promptByKey('These are your choices:', ['The red apple', 'The plump orange', 'The ripe banana']);
46
/*
57
* These are your choices:

source/cli/cli_library/008.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
use CodeIgniter\CLI\CLI;
4+
35
$fruit = CLI::promptByKey(['These are your choices:', 'Which would you like?'], [
46
'apple' => 'The red apple',
57
'orange' => 'The plump orange',

source/cli/cli_library/009.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
<?php
22

3+
use CodeIgniter\CLI\CLI;
4+
35
CLI::write('The rain in Spain falls mainly on the plains.');

source/cli/cli_library/010.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
<?php
22

3+
use CodeIgniter\CLI\CLI;
4+
35
CLI::write('File created.', 'green');

source/cli/cli_library/011.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
<?php
22

3+
use CodeIgniter\CLI\CLI;
4+
35
CLI::write('File overwritten.', 'light_red', 'dark_gray');

source/cli/cli_library/012.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
use CodeIgniter\CLI\CLI;
4+
35
for ($i = 0; $i <= 10; $i++) {
46
CLI::print($i);
57
}

source/cli/cli_library/013.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
<?php
22

3+
use CodeIgniter\CLI\CLI;
4+
35
CLI::write("fileA \t" . CLI::color('/path/to/file', 'white'), 'yellow');

source/cli/cli_library/014.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
<?php
22

3+
use CodeIgniter\CLI\CLI;
4+
35
CLI::error('Cannot write to file: ' . $file);

source/cli/cli_library/015.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<?php
22

3+
use CodeIgniter\CLI\CLI;
4+
35
CLI::color("task1\t", 'yellow');
46
CLI::wrap('Some long description goes here that might be longer than the current window.');

source/cli/cli_library/016.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<?php
22

3+
use CodeIgniter\CLI\CLI;
4+
35
// Wrap the text at max 20 characters wide
46
CLI::wrap($description, 20);

source/cli/cli_library/017.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
use CodeIgniter\CLI\CLI;
4+
35
$titles = [
46
'task1a',
57
'task1abc',

source/cli/cli_library/018.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
<?php
22

3+
use CodeIgniter\CLI\CLI;
4+
35
CLI::newLine();

source/cli/cli_library/019.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
<?php
22

3+
use CodeIgniter\CLI\CLI;
4+
35
CLI::clearScreen();

source/cli/cli_library/020.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
use CodeIgniter\CLI\CLI;
4+
35
$totalSteps = count($tasks);
46
$currStep = 1;
57

source/cli/cli_library/021.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
use CodeIgniter\CLI\CLI;
4+
35
$thead = ['ID', 'Title', 'Updated At', 'Active'];
46
$tbody = [
57
[7, 'A great item title', '2017-11-15 10:35:02', 1],

source/cli/cli_library/022.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
use CodeIgniter\CLI\CLI;
4+
35
// wait for specified interval, with countdown displayed
46
CLI::wait($seconds, true);
57

source/cli/cli_library/023.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
use CodeIgniter\CLI\CLI;
4+
35
$hobbies = CLI::promptByMultipleKeys('Select your hobbies:', ['Playing game', 'Sleep', 'Badminton']);
46
/*
57
* Select your hobbies:

source/concepts/factories/002.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
use CodeIgniter\Config\Factories;
4+
35
$users = Factories::models('Blog\Models\UserModel');
46
// Or
57
$users = Factories::models(\Blog\Models\UserModel::class);

source/concepts/factories/004.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<?php
22

3+
use CodeIgniter\Config\Factories;
4+
35
$conn = db_connect('auth');
46
$users = Factories::models('UserModel', [], $conn);

source/concepts/factories/006.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?php
22

3+
use CodeIgniter\Config\Factories;
4+
use CodeIgniter\Filters\FilterInterface;
5+
36
Factories::setOptions('filters', [
47
'instanceOf' => FilterInterface::class,
58
'prefersApp' => false,

source/concepts/factories/007.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<?php
22

3+
use CodeIgniter\Config\Factories;
4+
35
$users = Factories::models('UserModel', ['getShared' => true]); // Default; will always be the same instance
46
$other = Factories::models('UserModel', ['getShared' => false]); // Will always create a new instance

source/concepts/factories/010.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
<?php
22

3+
use CodeIgniter\Config\Factories;
4+
35
$users = Factories::models('Blog\Models\UserModel', ['preferApp' => false]);

source/concepts/factories/013.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
<?php
22

3+
use CodeIgniter\Config\Factories;
4+
35
$lib = Factories::libraries('Sub/SubLib');

source/concepts/factories/014.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
<?php
22

3+
use CodeIgniter\Config\Factories;
4+
35
Factories::define('models', 'Myth\Auth\Models\UserModel', 'App\Models\UserModel');

source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
version = '4.4'
2727

2828
# The full version, including alpha/beta/rc tags.
29-
release = '4.4.3'
29+
release = '4.4.5'
3030

3131
# -- General configuration ---------------------------------------------------
3232

source/database/events.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
DBQuery
1616
=======
1717

18-
每当运行新查询时,无论成功与否,都会触发此事件。唯一的参数是当前查询的 :doc:`查询 </database/queries>` 实例。你可以使用它在 STDOUT 中显示所有查询,或日志记录到文件,甚至创建工具来执行自动查询分析以帮助你发现可能缺少的索引、慢查询等。示例用法可能是:
18+
无论成功与否,每当有新的查询被执行时,此事件就会被触发。唯一的参数是当前查询的 :doc:`查询 </database/queries>` 实例。你可以使用这个来在 STDOUT 显示所有的查询,或者记录到文件,甚至创建工具来进行自动查询分析,帮助你发现可能丢失的索引、慢查询等。
19+
20+
示例用法可能是:
1921

2022
.. literalinclude:: events/001.php

source/database/events/001.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11
<?php
22

33
// In app/Config/Events.php
4-
Events::on('DBQuery', 'CodeIgniter\Debug\Toolbar\Collectors\Database::collect');
4+
5+
namespace Config;
6+
7+
use CodeIgniter\Events\Events;
8+
use CodeIgniter\Exceptions\FrameworkException;
9+
use CodeIgniter\HotReloader\HotReloader;
10+
11+
// ...
12+
13+
Events::on(
14+
'DBQuery',
15+
static function (\CodeIgniter\Database\Query $query) {
16+
log_message('info', (string) $query);
17+
}
18+
);

0 commit comments

Comments
 (0)