-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
328 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
.. toctree:: | ||
:titlesonly: | ||
|
||
v4.5.5 | ||
v4.5.4 | ||
v4.5.3 | ||
v4.5.2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
############# | ||
版本 4.5.5 | ||
############# | ||
|
||
发布日期:2024 年 9 月 7 日 | ||
|
||
**CodeIgniter4 的 4.5.5 版本发布** | ||
|
||
.. contents:: | ||
:local: | ||
:depth: 3 | ||
|
||
********** | ||
修复的错误 | ||
********** | ||
|
||
- **URL 辅助函数:** 修复了 :php:func:`auto_link()` 中正则表达式过时的错误。通过此修复,现在使用与 CodeIgniter 3 相同的正则表达式。 | ||
|
||
请参阅仓库的 | ||
`CHANGELOG.md <https://github.com/codeigniter4/CodeIgniter4/blob/develop/CHANGELOG.md>`_ | ||
以获取修复错误的完整列表。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<?php | ||
|
||
$string = 'Fred, Bill,, Joe, Jimmy'; | ||
$string = reduce_multiples($string, ','); // results in "Fred, Bill, Joe, Jimmy" | ||
$string = reduce_multiples($string); // results in "Fred, Bill, Joe, Jimmy" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<?php | ||
|
||
$string = ',Fred, Bill,, Joe, Jimmy,'; | ||
$string = reduce_multiples($string, ', ', true); // results in "Fred, Bill, Joe, Jimmy" | ||
$string = reduce_multiples($string, ',', true); // results in "Fred, Bill, Joe, Jimmy" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
// Get the router instance. | ||
/** @var \CodeIgniter\Router\Router $router */ | ||
$router = service('router'); | ||
|
||
// Retrieve the fully qualified class name of the controller handling the current request. | ||
$controller = $router->controllerName(); | ||
|
||
// Retrieve the method name being executed in the controller for the current request. | ||
$method = $router->methodName(); | ||
|
||
echo 'Current Controller: ' . $controller . '<br>'; | ||
echo 'Current Method: ' . $method; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
// Get the router instance. | ||
/** @var \CodeIgniter\Router\Router $router */ | ||
$router = service('router'); | ||
$filters = $router->getFilters(); | ||
|
||
echo 'Active Filters for the Route: ' . implode(', ', $filters); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
############################# | ||
从 4.5.4 升级到 4.5.5 | ||
############################# | ||
|
||
请参考与你的安装方法相对应的升级说明。 | ||
|
||
- :ref:`Composer 安装 App Starter 升级 <app-starter-upgrading>` | ||
- :ref:`Composer 安装 将 CodeIgniter4 添加到现有项目 升级 <adding-codeigniter4-upgrading>` | ||
- :ref:`手动安装 升级 <installing-manual-upgrading>` | ||
|
||
.. contents:: | ||
:local: | ||
:depth: 2 | ||
|
||
************* | ||
项目文件 | ||
************* | ||
|
||
**项目空间** (根目录、app、public、writable)中的一些文件收到了更新。由于这些文件位于 **system** 范围之外,因此不会在没有你干预的情况下进行更改。 | ||
|
||
.. note:: 有一些第三方 CodeIgniter 模块可以帮助合并项目空间的更改: | ||
`在 Packagist 上探索 <https://packagist.org/explore/?query=codeigniter4%20updates>`_。 | ||
|
||
内容更改 | ||
=============== | ||
|
||
以下文件进行了重大更改(包括弃用或视觉调整),建议你将更新版本与应用程序合并: | ||
|
||
配置 | ||
------ | ||
|
||
- composer.json | ||
|
||
所有更改 | ||
=========== | ||
|
||
这是 **项目空间** 中所有收到更改的文件列表;许多只是简单的注释或格式调整,对运行时没有影响: | ||
|
||
- composer.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace App\Models; | ||
|
||
use CodeIgniter\Model; | ||
|
||
class NewsModel extends Model | ||
{ | ||
// Sets the table name. | ||
protected $table = 'news'; | ||
|
||
// Sets the field names to allow to insert/update. | ||
protected $allowedFields = ['title', 'slug', 'text']; | ||
|
||
public function setNews($title, $slug, $text) | ||
{ | ||
$data = [ | ||
'title' => $title, | ||
'slug' => $slug, | ||
'text' => $text, | ||
]; | ||
|
||
// Uses Model's`insert()` method. | ||
return $this->insert($data); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
<?php | ||
|
||
class User_contact extends CI_Model | ||
class News_model extends CI_Model | ||
{ | ||
public function insert($name, $address, $email) | ||
public function set_news($title, $slug, $text) | ||
{ | ||
$this->db->insert('user_contacts', array( | ||
'name' => $name, | ||
'address' => $address, | ||
'email' => $email, | ||
)); | ||
$data = array( | ||
'title' => $title, | ||
'slug' => $slug, | ||
'text' => $text, | ||
); | ||
|
||
return $this->db->insert('news', $data); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
|
||
backward_compatibility_notes | ||
|
||
upgrade_455 | ||
upgrade_454 | ||
upgrade_453 | ||
upgrade_452 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
<?php | ||
|
||
$post_data = [ | ||
'foo' => 'bar', | ||
'userfile' => new \CURLFile('/path/to/file.txt'), | ||
]; | ||
$client->request('POST', '/post', [ | ||
'multipart' => [ | ||
'foo' => 'bar', | ||
'userfile' => new \CURLFile('/path/to/file.txt'), | ||
], | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.