Skip to content

Commit fcdf5da

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.4
2 parents 50c225c + 5c227fe commit fcdf5da

10 files changed

Lines changed: 44 additions & 49 deletions

File tree

rector.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector;
4040
use Rector\Php73\Rector\FuncCall\StringifyStrNeedlesRector;
4141
use Rector\PHPUnit\Rector\MethodCall\AssertPropertyExistsRector;
42-
use Rector\PHPUnit\Rector\MethodCall\GetMockBuilderGetMockToCreateMockRector;
4342
use Rector\PHPUnit\Set\PHPUnitSetList;
4443
use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector;
4544
use Rector\Set\ValueObject\LevelSetList;
@@ -112,11 +111,6 @@
112111
// use mt_rand instead of random_int on purpose on non-cryptographically random
113112
RandomFunctionRector::class,
114113

115-
// @TODO remove if https://github.com/rectorphp/rector-phpunit/issues/86 is fixed
116-
GetMockBuilderGetMockToCreateMockRector::class => [
117-
__DIR__ . '/tests/system/Email/EmailTest.php',
118-
],
119-
120114
SimplifyRegexPatternRector::class,
121115
]);
122116

system/Cache/Handlers/FileHandler.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ class FileHandler extends BaseHandler
4444
protected $mode;
4545

4646
/**
47+
* Note: Use `CacheFactory::getHandler()` to instantiate.
48+
*
4749
* @throws CacheException
4850
*/
4951
public function __construct(Cache $config)

system/Cache/Handlers/MemcachedHandler.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ class MemcachedHandler extends BaseHandler
4242
'raw' => false,
4343
];
4444

45+
/**
46+
* Note: Use `CacheFactory::getHandler()` to instantiate.
47+
*/
4548
public function __construct(Cache $config)
4649
{
4750
$this->prefix = $config->prefix;

system/Cache/Handlers/PredisHandler.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ class PredisHandler extends BaseHandler
4343
*/
4444
protected $redis;
4545

46+
/**
47+
* Note: Use `CacheFactory::getHandler()` to instantiate.
48+
*/
4649
public function __construct(Cache $config)
4750
{
4851
$this->prefix = $config->prefix;

system/Cache/Handlers/RedisHandler.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ class RedisHandler extends BaseHandler
4242
*/
4343
protected $redis;
4444

45+
/**
46+
* Note: Use `CacheFactory::getHandler()` to instantiate.
47+
*/
4548
public function __construct(Cache $config)
4649
{
4750
$this->prefix = $config->prefix;

system/Cache/Handlers/WincacheHandler.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
*/
2323
class WincacheHandler extends BaseHandler
2424
{
25+
/**
26+
* Note: Use `CacheFactory::getHandler()` to instantiate.
27+
*/
2528
public function __construct(Cache $config)
2629
{
2730
$this->prefix = $config->prefix;

user_guide_src/source/dbmgmt/migration.rst

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ need to go and run them. You would also have to keep track of which changes
99
need to be run against the production machines next time you deploy.
1010

1111
The database table **migrations** tracks which migrations have already been
12-
run so all you have to do is make sure your migrations are in place and
13-
call ``$migration->latest()`` to bring the database up to the most recent
14-
state. You can also use ``$migration->setNamespace(null)->latest()`` to
12+
run, so all you have to do is make sure your migrations are in place and
13+
run the ``spark migrate`` command to bring the database up to the most recent
14+
state. You can also use ``spark migrate --all`` to
1515
include migrations from all namespaces.
1616

1717
.. contents::
@@ -94,23 +94,14 @@ This will look for any migrations located at both **APPPATH/Database/Migrations*
9494
**ROOTPATH/MyCompany/Database/Migrations**. This makes it simple to include migrations in your
9595
re-usable, modular code suites.
9696

97-
*************
98-
Usage Example
99-
*************
100-
101-
In this example some simple code is placed in **app/Controllers/Migrate.php**
102-
to update the schema:
103-
104-
.. literalinclude:: migration/005.php
105-
10697
.. _command-line-tools:
10798

10899
*******************
109100
Command-Line Tools
110101
*******************
111102

112103
CodeIgniter ships with several :doc:`commands </cli/spark_commands>` that are available from the command line to help
113-
you work with migrations. These tools are not required to use migrations but might make things easier for those of you
104+
you work with migrations. These tools make things easier for those of you
114105
that wish to use them. The tools primarily provide access to the same methods that are available within the MigrationRunner class.
115106

116107
migrate
@@ -171,6 +162,9 @@ status
171162
Displays a list of all migrations and the date and time they ran, or '--' if they have not been run::
172163

173164
> php spark migrate:status
165+
166+
...
167+
174168
+----------------------+-------------------+-----------------------+---------+---------------------+-------+
175169
| Namespace | Version | Filename | Group | Migrated On | Batch |
176170
+----------------------+-------------------+-----------------------+---------+---------------------+-------+
@@ -194,13 +188,17 @@ creates is the Pascal case version of the filename.
194188

195189
> php spark make:migration <class> [options]
196190

197-
You can use (make:migration) with the following options:
191+
You can use (``make:migration``) with the following options:
192+
193+
- ``--namespace`` - Set root namespace. Default: ``APP_NAMESPACE``.
194+
- ``--suffix`` - Append the component title to the class name.
195+
196+
The following options are also available to generate the migration file for
197+
database sessions:
198198

199199
- ``--session`` - Generates the migration file for database sessions.
200200
- ``--table`` - Table name to use for database sessions. Default: ``ci_sessions``.
201201
- ``--dbgroup`` - Database group to use for database sessions. Default: ``default``.
202-
- ``--namespace`` - Set root namespace. Default: ``APP_NAMESPACE``.
203-
- ``--suffix`` - Append the component title to the class name.
204202

205203
*********************
206204
Migration Preferences
@@ -229,7 +227,7 @@ Class Reference
229227
:returns: An array of migration files
230228
:rtype: array
231229

232-
An array of migration filenames are returned that are found in the **path** property.
230+
An array of migration filenames are returned that are found in the ``path`` property.
233231

234232
.. php:method:: latest($group)
235233
@@ -259,7 +257,7 @@ Class Reference
259257
:returns: ``true`` on success, ``false`` on failure
260258
:rtype: bool
261259

262-
This forces a single file to migrate regardless of order or batches. Method "up" or "down" is detected based on whether it has already been migrated.
260+
This forces a single file to migrate regardless of order or batches. Method ``up()`` or ``down()`` is detected based on whether it has already been migrated.
263261

264262
.. note:: This method is recommended only for testing and could cause data consistency issues.
265263

user_guide_src/source/dbmgmt/migration/005.php

Lines changed: 0 additions & 20 deletions
This file was deleted.

user_guide_src/source/general/configuration.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ The loaded environment variables are accessed using any of the following:
122122

123123
.. literalinclude:: configuration/005.php
124124

125-
.. warning:: Note that your settings from the **.env** file are added to Environment Variables. As a side effect, this means that if your CodeIgniter application is (for example) generating a ``var_dump($_ENV)`` or ``phpinfo()`` (for debugging or other valid reasons) **your secure credentials are publicly exposed**.
125+
.. warning:: Note that your settings from the **.env** file are added to ``$_SERVER`` and ``$_ENV``. As a side effect, this means that if your CodeIgniter application is (for example) generating a ``var_dump($_ENV)`` or ``phpinfo()`` (for debugging or other valid reasons), or a detailed error report in the ``development`` environment is shown, **your secure credentials are publicly exposed**.
126126

127127
Nesting Variables
128128
-----------------

user_guide_src/source/general/errors.rst

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ Error Handling
33
##############
44

55
CodeIgniter builds error reporting into your system through Exceptions, both the `SPL collection <https://www.php.net/manual/en/spl.exceptions.php>`_, as
6-
well as a few custom exceptions that are provided by the framework. Depending on your environment's setup,
6+
well as a few exceptions that are provided by the framework.
7+
8+
Depending on your environment's setup,
79
the default action when an error or exception is thrown is to display a detailed error report unless the application
8-
is running under the ``production`` environment. In this case, a more generic message is displayed to
10+
is running under the ``production`` environment. In the ``production`` environment, a more generic message is displayed to
911
keep the best user experience for your users.
1012

1113
.. contents::
@@ -43,12 +45,19 @@ the error handler to function as normal, you can throw a new exception within th
4345
Configuration
4446
=============
4547

46-
By default, CodeIgniter will display all errors in the ``development`` and ``testing`` environments, and will not
48+
Error Reporting
49+
---------------
50+
51+
By default, CodeIgniter will display a detailed error report with all errors in the ``development`` and ``testing`` environments, and will not
4752
display any errors in the ``production`` environment. You can change this by setting the ``CI_ENVIRONMENT`` variable
48-
in the **.env** file.
53+
in the :ref:`.env <dotenv-file>` file.
4954

5055
.. important:: Disabling error reporting DOES NOT stop logs from being written if there are errors.
5156

57+
.. warning:: Note that your settings from the **.env** file are added to ``$_SERVER``
58+
and ``$_ENV``. As a side effect, this means that if the detailed error report
59+
is displayed, **your secure credentials are publicly exposed**.
60+
5261
Logging Exceptions
5362
------------------
5463

0 commit comments

Comments
 (0)