Skip to content

Commit e50fed0

Browse files
authored
Merge branch 'develop' into foreignkey_forge
2 parents 5886a81 + 0d9394a commit e50fed0

File tree

265 files changed

+5856
-7758
lines changed

Some content is hidden

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

265 files changed

+5856
-7758
lines changed

.travis.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ language: php
33
php:
44
- 7
55
- 7.1
6+
- 7.2
7+
- nightly
8+
9+
matrix:
10+
fast_finish: true
11+
allow_failures:
12+
- php: 7.2
13+
- php: nightly
614

715
global:
816
- CI=true
@@ -20,6 +28,7 @@ services:
2028
- memcached
2129
- mysql
2230
- postgresql
31+
- redis-server
2332

2433
script:
2534
- php vendor/bin/phpunit -v
@@ -31,6 +40,7 @@ before_install:
3140

3241
before_script:
3342
- echo 'extension = memcached.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
43+
- echo 'extension = redis.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
3444
- composer install --prefer-source
3545

3646
after_success:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ We are not looking for out-of-scope contributions, only those that would be cons
6666
Please read the *Contributing to CodeIgniter* section in the user guide
6767

6868
## Server Requirements
69-
PHP version 7 or higher is required, with the following extensions installed:
69+
PHP version 7.0.15 or higher is required, with the following extensions installed:
7070

7171
- intl
7272

application/Config/Constants.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,14 @@
3131
| Provide simple ways to work with the myriad of PHP functions that
3232
| require information to be in seconds.
3333
*/
34-
defined('SECOND') || define('SECOND', 1);
35-
defined('MINUTE') || define('MINUTE', 60);
36-
defined('HOUR') || define('HOUR', 3600);
37-
defined('DAY') || define('DAY', 86400);
38-
defined('WEEK') || define('WEEK', 604800);
39-
defined('MONTH') || define('MONTH', 2592000);
40-
defined('YEAR') || define('YEAR', 31536000);
34+
defined('SECOND') || define('SECOND', 1);
35+
defined('MINUTE') || define('MINUTE', 60);
36+
defined('HOUR') || define('HOUR', 3600);
37+
defined('DAY') || define('DAY', 86400);
38+
defined('WEEK') || define('WEEK', 604800);
39+
defined('MONTH') || define('MONTH', 2592000);
40+
defined('YEAR') || define('YEAR', 31536000);
41+
defined('DECADE') || define('DECADE', 315360000);
4142

4243
/*
4344
|--------------------------------------------------------------------------

application/Config/Database.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class Database extends \CodeIgniter\Database\Config
4646
'compress' => false,
4747
'strictOn' => false,
4848
'failover' => [],
49+
'port' => 3306
4950
];
5051

5152
/**
@@ -73,6 +74,7 @@ class Database extends \CodeIgniter\Database\Config
7374
'compress' => false,
7475
'strictOn' => false,
7576
'failover' => [],
77+
'port' => 3306
7678
];
7779

7880
//--------------------------------------------------------------------

application/Config/Encryption.php

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Encryption extends BaseConfig
1515
{
1616
/*
1717
|--------------------------------------------------------------------------
18-
| Encryption Key
18+
| Encryption Key Starter
1919
|--------------------------------------------------------------------------
2020
|
2121
| If you use the Encryption class you must set an encryption key.
@@ -30,27 +30,40 @@ class Encryption extends BaseConfig
3030
| Encryption driver to use
3131
|--------------------------------------------------------------------------
3232
|
33-
| One of the supported drivers, eg 'openssl' or 'mcrypt'.
34-
| The default driver, if you don't specify one, is 'openssl'.
33+
| One of the supported drivers, eg 'OpenSSL' or 'Sodium'.
34+
| The default driver, if you don't specify one, is 'OpenSSL'.
3535
*/
36-
public $driver = 'openssl';
36+
public $driver = 'OpenSSL';
3737

3838
/*
3939
|--------------------------------------------------------------------------
4040
| Encryption Cipher
4141
|--------------------------------------------------------------------------
4242
|
43-
| Name of the encryption cipher to use, eg 'aes-256' or 'blowfish'
43+
| Name of the encryption cipher to use, eg 'aes-256' or 'blowfish'.
44+
| The cipher must be supported by your designated driver.
4445
*/
45-
public $cipher = 'aes-256';
46+
public $cipher = 'AES-256-CBC';
4647

4748
/*
4849
|--------------------------------------------------------------------------
49-
| Encryption mode
50+
| Authentication digest
5051
|--------------------------------------------------------------------------
5152
|
52-
| The encryption mode to use, eg 'cbc' or 'stream'
53+
| HMAC digest algorithm to use, empty for none.
54+
| Values: SHA512, SHA384, SHA256, or SHA224.
5355
*/
54-
public $mode = 'cbc';
56+
public $digest = 'SHA512';
57+
58+
/*
59+
|--------------------------------------------------------------------------
60+
| Result encoding
61+
|--------------------------------------------------------------------------
62+
|
63+
| Which, if any, encoding to apply to encrypted results and to assume
64+
| provided ciphertext.
65+
| Values; empty (for no encoding), base64 or hex.
66+
*/
67+
public $encoding = 'base64';
5568

5669
}

application/Config/Format.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class Format extends BaseConfig
4747
*
4848
* @param string $mime
4949
*
50-
* @return mixed
50+
* @return \CodeIgniter\Format\FormatterInterface
5151
*/
5252
public function getFormatter(string $mime)
5353
{

application/Controllers/Checks.php

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use CodeIgniter\I18n\Time;
77
use CodeIgniter\Model;
88
use Config\Database;
9-
use Tests\Support\Models\JobModel;
109

1110
class Checks extends Controller
1211
{
@@ -189,38 +188,38 @@ public function forms()
189188

190189
public function api()
191190
{
192-
$data = array(
191+
$data = [
193192
"total_users" => 3,
194-
"users" => array(
195-
array(
193+
"users" => [
194+
[
196195
"id" => 1,
197196
"name" => "Nitya",
198-
"address" => array(
197+
"address" => [
199198
"country" => "India",
200199
"city" => "Kolkata",
201200
"zip" => 700102,
202-
)
203-
),
204-
array(
201+
]
202+
],
203+
[
205204
"id" => 2,
206205
"name" => "John",
207-
"address" => array(
206+
"address" => [
208207
"country" => "USA",
209208
"city" => "Newyork",
210209
"zip" => "NY1234",
211-
)
212-
),
213-
array(
210+
]
211+
],
212+
[
214213
"id" => 3,
215214
"name" => "Viktor",
216-
"address" => array(
215+
"address" => [
217216
"country" => "Australia",
218217
"city" => "Sydney",
219218
"zip" => 123456,
220-
)
221-
),
222-
)
223-
);
219+
]
220+
],
221+
]
222+
];
224223

225224
return $this->respond($data);
226225
}
@@ -241,6 +240,18 @@ public function db()
241240
$query->execute('foo', '[email protected]', 'US');
242241
}
243242

243+
public function db2()
244+
{
245+
$db = Database::connect();
246+
$db->initialize();
247+
248+
$db->table('user')->insert([
249+
'name' => 'a',
250+
'email' => '[email protected]',
251+
'country' => 'x'
252+
]);
253+
}
254+
244255
public function format()
245256
{
246257
echo '<pre>';

application/Filters/CSRF.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
use CodeIgniter\Filters\FilterInterface;
44
use CodeIgniter\HTTP\RequestInterface;
55
use CodeIgniter\HTTP\ResponseInterface;
6-
use Config\App;
76
use Config\Services;
87

98
class CSRF implements FilterInterface
@@ -18,7 +17,7 @@ class CSRF implements FilterInterface
1817
* sent back to the client, allowing for error pages,
1918
* redirects, etc.
2019
*
21-
* @param \CodeIgniter\HTTP\RequestInterface $request
20+
* @param RequestInterface|\CodeIgniter\HTTP\IncomingRequest $request
2221
*
2322
* @return mixed
2423
*/
@@ -39,8 +38,8 @@ public function before(RequestInterface $request)
3938
/**
4039
* We don't have anything to do here.
4140
*
42-
* @param \CodeIgniter\HTTP\RequestInterface $request
43-
* @param \CodeIgniter\HTTP\ResponseInterface $response
41+
* @param RequestInterface|\CodeIgniter\HTTP\IncomingRequest $request
42+
* @param ResponseInterface|\CodeIgniter\HTTP\Response $response
4443
*
4544
* @return mixed
4645
*/

application/Filters/DebugToolbar.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class DebugToolbar implements FilterInterface
1111
/**
1212
* We don't need to do anything here.
1313
*
14-
* @param \CodeIgniter\HTTP\RequestInterface $request
14+
* @param RequestInterface|\CodeIgniter\HTTP\IncomingRequest $request
1515
*
1616
* @return mixed
1717
*/
@@ -26,8 +26,8 @@ public function before(RequestInterface $request)
2626
* If the debug flag is set (CI_DEBUG) then collect performance
2727
* and debug information and display it in a toolbar.
2828
*
29-
* @param \CodeIgniter\HTTP\RequestInterface $request
30-
* @param \CodeIgniter\HTTP\ResponseInterface $response
29+
* @param RequestInterface|\CodeIgniter\HTTP\IncomingRequest $request
30+
* @param ResponseInterface|\CodeIgniter\HTTP\Response $response
3131
*
3232
* @return mixed
3333
*/

application/Filters/Throttle.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Throttle implements FilterInterface
1111
* This is a demo implementation of using the Throttler class
1212
* to implement rate limiting for your application.
1313
*
14-
* @param \CodeIgniter\HTTP\RequestInterface $request
14+
* @param RequestInterface|\CodeIgniter\HTTP\IncomingRequest $request
1515
*
1616
* @return mixed
1717
*/
@@ -33,8 +33,8 @@ public function before(RequestInterface $request)
3333
/**
3434
* We don't have anything to do here.
3535
*
36-
* @param \CodeIgniter\HTTP\RequestInterface $request
37-
* @param \CodeIgniter\HTTP\ResponseInterface $response
36+
* @param RequestInterface|\CodeIgniter\HTTP\IncomingRequest $request
37+
* @param ResponseInterface|\CodeIgniter\HTTP\Response $response
3838
*
3939
* @return mixed
4040
*/

application/Views/errors/html/error_exception.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<div class="container">
2222
<h1><?= htmlspecialchars($title, ENT_SUBSTITUTE, 'UTF-8'), ($exception->getCode() ? ' #'.$exception->getCode() : '') ?></h1>
2323
<p>
24-
<?= htmlspecialchars($exception->getMessage(), ENT_SUBSTITUTE) ?>
24+
<?= $exception->getMessage() ?>
2525
<a href="https://www.google.com/search?q=<?= urlencode($title.' '.preg_replace('#\'.*\'|".*"#Us', '', $exception->getMessage())) ?>"
2626
rel="noreferrer" target="_blank">search &rarr;</a>
2727
</p>

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"support": {
88
"forum": "http://forum.codeigniter.com/",
99
"wiki": "https://github.com/bcit-ci/CodeIgniter4/wiki",
10-
"irc": "irc://irc.freenode.net/codeigniter",
10+
"slack": "https://codeigniterchat.slack.com",
1111
"source": "https://github.com/bcit-ci/CodeIgniter4"
1212
},
1313
"autoload": {
@@ -18,7 +18,8 @@
1818
"require": {
1919
"php": ">=7.0",
2020
"zendframework/zend-escaper": "^2.5",
21-
"paragonie/sodium_compat": "^1.1"
21+
"paragonie/sodium_compat": "^1.1",
22+
"kint-php/kint": "^2.1"
2223
},
2324
"require-dev": {
2425
"phpunit/phpunit": "^6.0",

serve.php renamed to serve

File renamed without changes.

ci.php renamed to spark

File renamed without changes.

0 commit comments

Comments
 (0)