Skip to content

Commit

Permalink
升级到 4.4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
hex-ci committed Jan 31, 2024
1 parent 59e1243 commit a830e4e
Show file tree
Hide file tree
Showing 226 changed files with 1,848 additions and 617 deletions.
10 changes: 5 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sphinx>=4.5.0,<5
sphinxcontrib-phpdomain>=0.8.0
docutils>=0.16
sphinx-rtd-theme>=0.5.0
jinja2<3.1
sphinx>=5.3.0,<6.0.0
sphinxcontrib-phpdomain>=0.11.0
docutils>=0.19
sphinx-rtd-theme>=2.0.0,<3.0.0
jinja2>=3.1.3,<4.0.0
jieba==0.42.1
2 changes: 2 additions & 0 deletions source/changelogs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
.. toctree::
:titlesonly:

v4.4.5
v4.4.4
v4.4.3
v4.4.2
v4.4.1
Expand Down
63 changes: 63 additions & 0 deletions source/changelogs/v4.4.4.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#############
版本 4.4.4
#############

发布日期:2023 年 12 月 28 日

**CodeIgniter4 的 4.4.4 版本发布**

.. contents::
:local:
:depth: 3

********
重大变化
********

采用 Dot 数组语法进行验证
=========================

使用通配符 ``*`` 的验证规则现在只验证符合"Dot 数组语法"的正确维度数据。
详见 :ref:`升级 <upgrade-444-validation-with-dot-array-syntax>` 获取详情。

验证规则匹配和差异
===================

在严格和传统规则中,``matches`` 和 ``differs`` 验证非字符串类型数据的情况已修复。

在 CURLRequest 中移除了 `ssl_key` 选项的使用
============================================

由于一个错误,我们在 CURLRequest 中使用了未记录的 `ssl_key` 配置选项来定义 CA bundle。现在已经修复,并且按照文档要求工作。你可以通过 `verify` 选项来定义你的 CA bundle。

文件系统助手
=============

:php:func:`get_filenames()` 现在会跟踪符号连接文件夹,而之前只是返回而不跟踪。

********
改进
********

- 完全支持 PHP 8.3。

***************
消息变更
***************

- 添加 ``HTTP.invalidJSON`` 错误消息。
- 添加 ``HTTP.unsupportedJSONFormat`` 错误消息。

************
弃用
************

- **请求:** :php:meth:`CodeIgniter\\HTTP\\Request::getEnv()` 方法已被弃用。此方法自从一开始就没有工作,请使用 :php:func:`env()`。

************
已修复的错误
************

- **CURLRequest:** 修复了即使配置项 'verify' 设置为 *false* 时,也会检查主机名的错误。

要查看完整的错误修复列表,请去看仓库的 `CHANGELOG.md <https://github.com/codeigniter4/CodeIgniter4/blob/develop/CHANGELOG.md>`_。
19 changes: 19 additions & 0 deletions source/changelogs/v4.4.5.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#############
版本 4.4.5
#############

发布日期:2024 年 1 月 27 日

**CodeIgniter4 的 4.4.5 版本发布**

.. contents::
:local:
:depth: 3

************
已修复的错误
************

- **QueryBuilder:** 修复了因为 PostgreSQL 上的类型错误,导致 ``updateBatch()`` 方法无法工作的问题。

要查看完整的错误修复列表,可以查看仓库的 `CHANGELOG.md <https://github.com/codeigniter4/CodeIgniter4/blob/develop/CHANGELOG.md>`_。
2 changes: 1 addition & 1 deletion source/cli/cli_generators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ make:command
选项:
========
* ``--command``:在 spark 中运行的命令名称。默认为 ``command:name``。
* ``--group``:命令的组/命名空间。对于基本命令默认为 ``CodeIgniter``,对于生成器命令默认为 ``Generators``。
* ``--group``:命令的组/命名空间。对于基本命令默认为 ``App``,对于生成器命令默认为 ``Generators``。
* ``--type``:命令类型,可以是 ``basic`` 基本命令或 ``generator`` 生成器命令。默认为 ``basic``。
* ``--namespace``:设置根命名空间。默认为 ``APP_NAMESPACE`` 的值。
* ``--suffix``:在生成的类名后附加组件后缀。
Expand Down
2 changes: 2 additions & 0 deletions source/cli/cli_library/002.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<?php

use CodeIgniter\CLI\CLI;

$color = CLI::prompt('What is your favorite color?');
2 changes: 2 additions & 0 deletions source/cli/cli_library/003.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<?php

use CodeIgniter\CLI\CLI;

$color = CLI::prompt('What is your favorite color?', 'blue');
2 changes: 2 additions & 0 deletions source/cli/cli_library/004.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<?php

use CodeIgniter\CLI\CLI;

$overwrite = CLI::prompt('File exists. Overwrite?', ['y', 'n']);
2 changes: 2 additions & 0 deletions source/cli/cli_library/005.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<?php

use CodeIgniter\CLI\CLI;

$email = CLI::prompt('What is your email?', null, 'required|valid_email');
2 changes: 2 additions & 0 deletions source/cli/cli_library/006.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<?php

use CodeIgniter\CLI\CLI;

$email = CLI::prompt('What is your email?', null, ['required', 'valid_email']);
2 changes: 2 additions & 0 deletions source/cli/cli_library/007.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use CodeIgniter\CLI\CLI;

$fruit = CLI::promptByKey('These are your choices:', ['The red apple', 'The plump orange', 'The ripe banana']);
/*
* These are your choices:
Expand Down
2 changes: 2 additions & 0 deletions source/cli/cli_library/008.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use CodeIgniter\CLI\CLI;

$fruit = CLI::promptByKey(['These are your choices:', 'Which would you like?'], [
'apple' => 'The red apple',
'orange' => 'The plump orange',
Expand Down
2 changes: 2 additions & 0 deletions source/cli/cli_library/009.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<?php

use CodeIgniter\CLI\CLI;

CLI::write('The rain in Spain falls mainly on the plains.');
2 changes: 2 additions & 0 deletions source/cli/cli_library/010.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<?php

use CodeIgniter\CLI\CLI;

CLI::write('File created.', 'green');
2 changes: 2 additions & 0 deletions source/cli/cli_library/011.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<?php

use CodeIgniter\CLI\CLI;

CLI::write('File overwritten.', 'light_red', 'dark_gray');
2 changes: 2 additions & 0 deletions source/cli/cli_library/012.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use CodeIgniter\CLI\CLI;

for ($i = 0; $i <= 10; $i++) {
CLI::print($i);
}
2 changes: 2 additions & 0 deletions source/cli/cli_library/013.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<?php

use CodeIgniter\CLI\CLI;

CLI::write("fileA \t" . CLI::color('/path/to/file', 'white'), 'yellow');
2 changes: 2 additions & 0 deletions source/cli/cli_library/014.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<?php

use CodeIgniter\CLI\CLI;

CLI::error('Cannot write to file: ' . $file);
2 changes: 2 additions & 0 deletions source/cli/cli_library/015.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

use CodeIgniter\CLI\CLI;

CLI::color("task1\t", 'yellow');
CLI::wrap('Some long description goes here that might be longer than the current window.');
2 changes: 2 additions & 0 deletions source/cli/cli_library/016.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

use CodeIgniter\CLI\CLI;

// Wrap the text at max 20 characters wide
CLI::wrap($description, 20);
2 changes: 2 additions & 0 deletions source/cli/cli_library/017.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use CodeIgniter\CLI\CLI;

$titles = [
'task1a',
'task1abc',
Expand Down
2 changes: 2 additions & 0 deletions source/cli/cli_library/018.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<?php

use CodeIgniter\CLI\CLI;

CLI::newLine();
2 changes: 2 additions & 0 deletions source/cli/cli_library/019.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<?php

use CodeIgniter\CLI\CLI;

CLI::clearScreen();
2 changes: 2 additions & 0 deletions source/cli/cli_library/020.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use CodeIgniter\CLI\CLI;

$totalSteps = count($tasks);
$currStep = 1;

Expand Down
2 changes: 2 additions & 0 deletions source/cli/cli_library/021.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use CodeIgniter\CLI\CLI;

$thead = ['ID', 'Title', 'Updated At', 'Active'];
$tbody = [
[7, 'A great item title', '2017-11-15 10:35:02', 1],
Expand Down
2 changes: 2 additions & 0 deletions source/cli/cli_library/022.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use CodeIgniter\CLI\CLI;

// wait for specified interval, with countdown displayed
CLI::wait($seconds, true);

Expand Down
2 changes: 2 additions & 0 deletions source/cli/cli_library/023.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use CodeIgniter\CLI\CLI;

$hobbies = CLI::promptByMultipleKeys('Select your hobbies:', ['Playing game', 'Sleep', 'Badminton']);
/*
* Select your hobbies:
Expand Down
2 changes: 2 additions & 0 deletions source/concepts/factories/002.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use CodeIgniter\Config\Factories;

$users = Factories::models('Blog\Models\UserModel');
// Or
$users = Factories::models(\Blog\Models\UserModel::class);
2 changes: 2 additions & 0 deletions source/concepts/factories/004.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

use CodeIgniter\Config\Factories;

$conn = db_connect('auth');
$users = Factories::models('UserModel', [], $conn);
3 changes: 3 additions & 0 deletions source/concepts/factories/006.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?php

use CodeIgniter\Config\Factories;
use CodeIgniter\Filters\FilterInterface;

Factories::setOptions('filters', [
'instanceOf' => FilterInterface::class,
'prefersApp' => false,
Expand Down
2 changes: 2 additions & 0 deletions source/concepts/factories/007.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

use CodeIgniter\Config\Factories;

$users = Factories::models('UserModel', ['getShared' => true]); // Default; will always be the same instance
$other = Factories::models('UserModel', ['getShared' => false]); // Will always create a new instance
2 changes: 2 additions & 0 deletions source/concepts/factories/010.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<?php

use CodeIgniter\Config\Factories;

$users = Factories::models('Blog\Models\UserModel', ['preferApp' => false]);
2 changes: 2 additions & 0 deletions source/concepts/factories/013.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<?php

use CodeIgniter\Config\Factories;

$lib = Factories::libraries('Sub/SubLib');
2 changes: 2 additions & 0 deletions source/concepts/factories/014.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<?php

use CodeIgniter\Config\Factories;

Factories::define('models', 'Myth\Auth\Models\UserModel', 'App\Models\UserModel');
2 changes: 1 addition & 1 deletion source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
version = '4.4'

# The full version, including alpha/beta/rc tags.
release = '4.4.3'
release = '4.4.5'

# -- General configuration ---------------------------------------------------

Expand Down
4 changes: 3 additions & 1 deletion source/database/events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
DBQuery
=======

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

示例用法可能是:

.. literalinclude:: events/001.php
16 changes: 15 additions & 1 deletion source/database/events/001.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
<?php

// In app/Config/Events.php
Events::on('DBQuery', 'CodeIgniter\Debug\Toolbar\Collectors\Database::collect');

namespace Config;

use CodeIgniter\Events\Events;
use CodeIgniter\Exceptions\FrameworkException;
use CodeIgniter\HotReloader\HotReloader;

// ...

Events::on(
'DBQuery',
static function (\CodeIgniter\Database\Query $query) {
log_message('info', (string) $query);
}
);
Loading

0 comments on commit a830e4e

Please sign in to comment.