Skip to content

Commit c82cbd6

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.3
Conflicts: user_guide_src/source/installation/upgrading.rst
2 parents 4649b0a + 9204889 commit c82cbd6

File tree

10 files changed

+65
-46
lines changed

10 files changed

+65
-46
lines changed

.github/workflows/test-userguide.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ jobs:
2525
- uses: ammaraskar/[email protected]
2626
with:
2727
docs-folder: user_guide_src
28+
build-command: 'make html SPHINXOPTS="-W --keep-going -w /tmp/sphinx-log"'

system/Email/Email.php

Lines changed: 38 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,13 @@ class Email
288288
*/
289289
protected $debugMessage = [];
290290

291+
/**
292+
* Raw debug messages
293+
*
294+
* @var string[]
295+
*/
296+
private array $debugMessageRaw = [];
297+
291298
/**
292299
* Recipients
293300
*
@@ -434,16 +441,17 @@ public function initialize($config)
434441
*/
435442
public function clear($clearAttachments = false)
436443
{
437-
$this->subject = '';
438-
$this->body = '';
439-
$this->finalBody = '';
440-
$this->headerStr = '';
441-
$this->replyToFlag = false;
442-
$this->recipients = [];
443-
$this->CCArray = [];
444-
$this->BCCArray = [];
445-
$this->headers = [];
446-
$this->debugMessage = [];
444+
$this->subject = '';
445+
$this->body = '';
446+
$this->finalBody = '';
447+
$this->headerStr = '';
448+
$this->replyToFlag = false;
449+
$this->recipients = [];
450+
$this->CCArray = [];
451+
$this->BCCArray = [];
452+
$this->headers = [];
453+
$this->debugMessage = [];
454+
$this->debugMessageRaw = [];
447455

448456
$this->setHeader('Date', $this->setDate());
449457

@@ -1658,7 +1666,12 @@ protected function spoolEmail()
16581666
}
16591667

16601668
if (! $success) {
1661-
$this->setErrorMessage(lang('Email.sendFailure' . ($protocol === 'mail' ? 'PHPMail' : ucfirst($protocol))));
1669+
$message = lang('Email.sendFailure' . ($protocol === 'mail' ? 'PHPMail' : ucfirst($protocol)));
1670+
1671+
log_message('error', 'Email: ' . $message);
1672+
log_message('error', $this->printDebuggerRaw());
1673+
1674+
$this->setErrorMessage($message);
16621675

16631676
return false;
16641677
}
@@ -1937,7 +1950,8 @@ protected function sendCommand($cmd, $data = '')
19371950

19381951
$reply = $this->getSMTPData();
19391952

1940-
$this->debugMessage[] = '<pre>' . $cmd . ': ' . $reply . '</pre>';
1953+
$this->debugMessage[] = '<pre>' . $cmd . ': ' . $reply . '</pre>';
1954+
$this->debugMessageRaw[] = $cmd . ': ' . $reply;
19411955

19421956
if ($resp === null || ((int) static::substr($reply, 0, 3) !== $resp)) {
19431957
$this->setErrorMessage(lang('Email.SMTPError', [$reply]));
@@ -2090,8 +2104,8 @@ protected function getHostname()
20902104
}
20912105

20922106
/**
2093-
* @param array $include List of raw data chunks to include in the output
2094-
* Valid options are: 'headers', 'subject', 'body'
2107+
* @param array|string $include List of raw data chunks to include in the output
2108+
* Valid options are: 'headers', 'subject', 'body'
20952109
*
20962110
* @return string
20972111
*/
@@ -2119,12 +2133,21 @@ public function printDebugger($include = ['headers', 'subject', 'body'])
21192133
return $msg . ($rawData === '' ? '' : '<pre>' . $rawData . '</pre>');
21202134
}
21212135

2136+
/**
2137+
* Returns raw debug messages
2138+
*/
2139+
private function printDebuggerRaw(): string
2140+
{
2141+
return implode("\n", $this->debugMessageRaw);
2142+
}
2143+
21222144
/**
21232145
* @param string $msg
21242146
*/
21252147
protected function setErrorMessage($msg)
21262148
{
2127-
$this->debugMessage[] = $msg . '<br />';
2149+
$this->debugMessage[] = $msg . '<br />';
2150+
$this->debugMessageRaw[] = $msg;
21282151
}
21292152

21302153
/**

system/Session/Session.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
*
2626
* Session configuration is done through session variables and cookie related
2727
* variables in app/config/App.php
28+
*
29+
* @property string $session_id
2830
*/
2931
class Session implements SessionInterface
3032
{

user_guide_src/source/changelogs/v4.2.2.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Deprecations
3232

3333
- The parameters of ``Services::request()`` are deprecated.
3434
- The first parameter ``$cacheConfig`` of ``CodeIgniter::gatherOutput()`` is deprecated.
35+
- The second parameter ``$ifNotExists`` of ``Forge::_createTable()`` is deprecated.
3536

3637
Bugs Fixed
3738
**********

user_guide_src/source/database/utilities/001.php

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

3-
$model = new class () extends \CodeIgniter\Model {
3+
class MyModel extends \CodeIgniter\Model
4+
{
45
protected $table = 'foo';
56
protected $primaryKey = 'id';
6-
};
7+
}
8+
9+
$model = new MyModel();
710

811
$util = \CodeIgniter\Database\Config::utils();
912

user_guide_src/source/installation/installing_composer.rst

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Initial Configuration
5656
---------------------
5757

5858
After installation, a few initial configurations are required.
59-
See :ref:`initial-configuration` for the details.
59+
See :ref:`initial-configuration` for the details.
6060

6161
.. _app-starter-upgrading:
6262

@@ -67,17 +67,6 @@ Whenever there is a new release, then from the command line in your project root
6767

6868
> composer update
6969

70-
If you want to compare the latest framework source structure for non-system directory (app, public, etc), you can update with ``--prefer-source``::
71-
72-
> composer update codeigniter4/framework --prefer-source
73-
74-
If ``--prefer-source`` doesn't automatically update to pull latest framework source structure, you can remove first::
75-
76-
rm -rf vendor/codeigniter4/framework && composer update codeigniter4/framework --prefer-source
77-
78-
If you used the ``--no-dev`` option when you created the project, it
79-
would be appropriate to do so here too, i.e., ``composer update --no-dev``.
80-
8170
Read the :doc:`upgrade instructions <upgrading>`, and check Breaking Changes and Enhancements.
8271

8372
Pros
@@ -97,7 +86,6 @@ Folders in your project after set up:
9786

9887
- app, public, tests, writable
9988
- vendor/codeigniter4/framework/system
100-
- vendor/codeigniter4/framework/app & public (compare with yours after updating when using ``--prefer-source``)
10189

10290
Latest Dev
10391
----------
@@ -112,13 +100,13 @@ develop branch explicitly.
112100

113101
In your project root::
114102

115-
php builds development
103+
> php builds development
116104

117105
The command above will update **composer.json** to point to the ``develop`` branch of the
118106
working repository, and update the corresponding paths in config and XML files. To revert
119107
these changes run::
120108

121-
php builds release
109+
> php builds release
122110

123111
After using the ``builds`` command be sure to run ``composer update`` to sync your vendor
124112
folder with the latest target build.
@@ -138,22 +126,17 @@ will be your document root.
138126

139127
In your project root::
140128

141-
> composer require codeigniter4/framework --prefer-source
129+
> composer require codeigniter4/framework
142130

143-
As with the earlier two composer install methods, you can omit installing
131+
As with the earlier composer install method, you can omit installing
144132
phpunit and its dependencies by adding the ``--no-dev`` argument to the ``composer require`` command.
145133

146134
Setting Up
147135
----------
148136

149-
Copy the ``app``, ``public``, and ``writable`` folders from ``vendor/codeigniter4/framework``
150-
to your project root
151-
152-
Copy the ``env``, ``phpunit.xml.dist`` and ``spark`` files, from
153-
``vendor/codeigniter4/framework`` to your project root
154-
155-
You will have to adjust the system path to refer to the vendor one, e.g., ``ROOTPATH . '/vendor/codeigniter4/framework/system'``,
156-
- the ``$systemDirectory`` variable in **app/Config/Paths.php**
137+
1. Copy the ``app``, ``public``, ``tests`` and ``writable`` folders from ``vendor/codeigniter4/framework`` to your project root
138+
2. Copy the ``env``, ``phpunit.xml.dist`` and ``spark`` files, from ``vendor/codeigniter4/framework`` to your project root
139+
3. You will have to adjust the ``$systemDirectory`` property in **app/Config/Paths.php** to refer to the vendor one, e.g., ``ROOTPATH . '/vendor/codeigniter4/framework/system'``.
157140

158141
Initial Configuration
159142
---------------------
@@ -168,7 +151,7 @@ Upgrading
168151

169152
Whenever there is a new release, then from the command line in your project root::
170153

171-
> composer update --prefer-source
154+
> composer update
172155

173156
Read the :doc:`upgrade instructions <upgrading>`, and check Breaking Changes and Enhancements.
174157

@@ -187,7 +170,7 @@ Structure
187170

188171
Folders in your project after set up:
189172

190-
- app, public, writable (when using ``--prefer-source``)
173+
- app, public, tests, writable
191174
- vendor/codeigniter4/framework/system
192175

193176
Translations Installation

user_guide_src/source/installation/installing_manual.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ Structure
5555
=========
5656

5757
Folders in your project after set up:
58-
app, public, system, writable
58+
59+
- app, public, tests, writable, system
5960

6061
Translations Installation
6162
=========================

user_guide_src/source/installation/upgrade_422.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Web Page Caching Bug Fix
2626
Others
2727
======
2828

29-
- The method ``Forge::createTable()`` no longer executes a ``CREATE TABLE IF NOT EXISTS``. If table is not found in ``$db->tableExists($table)`` then ``CREATE TABLE`` is executed.
29+
- The method ``Forge::createTable()`` no longer executes a ``CREATE TABLE IF NOT EXISTS``. When `$ifNotExists` is true, if the table is not found in ``$db->tableExists($table)`` then ``CREATE TABLE`` is executed.
3030
- The second parameter ``$ifNotExists`` of ``Forge::_createTable()`` is deprecated. It is no longer used and will be removed in a future release.
3131
- When you use :php:func:`random_string` with the first parameter ``'crypto'``, now if you set the second parameter ``$len`` to an odd number, ``InvalidArgumentException`` will be thrown. Change the parameter to an even number.
3232

user_guide_src/source/installation/upgrade_423.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,8 @@
22
Upgrading from 4.2.2 to 4.2.3
33
#############################
44

5+
.. contents::
6+
:local:
7+
:depth: 2
8+
59
Version ``4.2.3`` is an internal change for security measures and requires no intervention in projects.

user_guide_src/source/installation/upgrading.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ upgrading from.
1313
:titlesonly:
1414

1515
upgrade_430
16+
upgrade_423
1617
upgrade_422
1718
upgrade_421
1819
upgrade_420

0 commit comments

Comments
 (0)