Skip to content

Commit 61617e7

Browse files
authored
Merge pull request #311 from MGatner/tatter/patches
2 parents 75d80c3 + 074bf21 commit 61617e7

File tree

13 files changed

+104
-82
lines changed

13 files changed

+104
-82
lines changed

.php-cs-fixer.dist.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
__DIR__ . '/tests/',
1212
])
1313
->exclude('build')
14+
->exclude('Views/errors')
1415
->append([__FILE__]);
1516

1617
$overrides = [];

app/Config/App.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class App extends BaseConfig
4444
* URI PROTOCOL
4545
* --------------------------------------------------------------------------
4646
*
47-
* This item determines which getServer global should be used to retrieve the
47+
* This item determines which server global should be used to retrieve the
4848
* URI string. The default setting of 'REQUEST_URI' works for most servers.
4949
* If your links do not seem to work, try one of the other delicious flavors:
5050
*

app/Config/Constants.php

Lines changed: 51 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,38 @@
11
<?php
22

3-
//--------------------------------------------------------------------
4-
// App Namespace
5-
//--------------------------------------------------------------------
6-
// This defines the default Namespace that is used throughout
7-
// CodeIgniter to refer to the Application directory. Change
8-
// this constant to change the namespace that all application
9-
// classes should use.
10-
//
11-
// NOTE: changing this will require manually modifying the
12-
// existing namespaces of App\* namespaced-classes.
13-
//
3+
/*
4+
| --------------------------------------------------------------------
5+
| App Namespace
6+
| --------------------------------------------------------------------
7+
|
8+
| This defines the default Namespace that is used throughout
9+
| CodeIgniter to refer to the Application directory. Change
10+
| this constant to change the namespace that all application
11+
| classes should use.
12+
|
13+
| NOTE: changing this will require manually modifying the
14+
| existing namespaces of App\* namespaced-classes.
15+
*/
1416
defined('APP_NAMESPACE') || define('APP_NAMESPACE', 'App');
1517

1618
/*
17-
|--------------------------------------------------------------------------
18-
| Composer Path
19-
|--------------------------------------------------------------------------
20-
|
21-
| The path that Composer's autoload file is expected to live. By default,
22-
| the vendor folder is in the Root directory, but you can customize that here.
23-
*/
19+
| --------------------------------------------------------------------------
20+
| Composer Path
21+
| --------------------------------------------------------------------------
22+
|
23+
| The path that Composer's autoload file is expected to live. By default,
24+
| the vendor folder is in the Root directory, but you can customize that here.
25+
*/
2426
defined('COMPOSER_PATH') || define('COMPOSER_PATH', ROOTPATH . 'vendor/autoload.php');
2527

2628
/*
27-
|--------------------------------------------------------------------------
28-
| Timing Constants
29-
|--------------------------------------------------------------------------
30-
|
31-
| Provide simple ways to work with the myriad of PHP functions that
32-
| require information to be in seconds.
33-
*/
29+
|--------------------------------------------------------------------------
30+
| Timing Constants
31+
|--------------------------------------------------------------------------
32+
|
33+
| Provide simple ways to work with the myriad of PHP functions that
34+
| require information to be in seconds.
35+
*/
3436
defined('SECOND') || define('SECOND', 1);
3537
defined('MINUTE') || define('MINUTE', 60);
3638
defined('HOUR') || define('HOUR', 3600);
@@ -41,30 +43,30 @@
4143
defined('DECADE') || define('DECADE', 315_360_000);
4244

4345
/*
44-
|--------------------------------------------------------------------------
45-
| Exit Status Codes
46-
|--------------------------------------------------------------------------
47-
|
48-
| Used to indicate the conditions under which the script is exit()ing.
49-
| While there is no universal standard for error codes, there are some
50-
| broad conventions. Three such conventions are mentioned below, for
51-
| those who wish to make use of them. The CodeIgniter defaults were
52-
| chosen for the least overlap with these conventions, while still
53-
| leaving room for others to be defined in future versions and user
54-
| applications.
55-
|
56-
| The three main conventions used for determining exit status codes
57-
| are as follows:
58-
|
59-
| Standard C/C++ Library (stdlibc):
60-
| http://www.gnu.org/software/libc/manual/html_node/Exit-Status.html
61-
| (This link also contains other GNU-specific conventions)
62-
| BSD sysexits.h:
63-
| https://www.gsp.com/cgi-bin/man.cgi?section=3&topic=sysexits
64-
| Bash scripting:
65-
| https://tldp.org/LDP/abs/html/exitcodes.html
66-
|
67-
*/
46+
| --------------------------------------------------------------------------
47+
| Exit Status Codes
48+
| --------------------------------------------------------------------------
49+
|
50+
| Used to indicate the conditions under which the script is exit()ing.
51+
| While there is no universal standard for error codes, there are some
52+
| broad conventions. Three such conventions are mentioned below, for
53+
| those who wish to make use of them. The CodeIgniter defaults were
54+
| chosen for the least overlap with these conventions, while still
55+
| leaving room for others to be defined in future versions and user
56+
| applications.
57+
|
58+
| The three main conventions used for determining exit status codes
59+
| are as follows:
60+
|
61+
| Standard C/C++ Library (stdlibc):
62+
| http://www.gnu.org/software/libc/manual/html_node/Exit-Status.html
63+
| (This link also contains other GNU-specific conventions)
64+
| BSD sysexits.h:
65+
| http://www.gsp.com/cgi-bin/man.cgi?section=3&topic=sysexits
66+
| Bash scripting:
67+
| http://tldp.org/LDP/abs/html/exitcodes.html
68+
|
69+
*/
6870
defined('EXIT_SUCCESS') || define('EXIT_SUCCESS', 0); // no errors
6971
defined('EXIT_ERROR') || define('EXIT_ERROR', 1); // generic error
7072
defined('EXIT_CONFIG') || define('EXIT_CONFIG', 3); // configuration error

app/Config/Logger.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class Logger extends BaseConfig
6060
* The logging system supports multiple actions to be taken when something
6161
* is logged. This is done by allowing for multiple Handlers, special classes
6262
* designed to write the log to their chosen destinations, whether that is
63-
* a file on the getServer, a cloud-based service, or even taking actions such
63+
* a file on the server, a cloud-based service, or even taking actions such
6464
* as emailing the dev team.
6565
*
6666
* Each handler is defined by the class name used for that handler, and it

app/Config/Paths.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ class Paths
3434
*
3535
* If you want this front controller to use a different "app"
3636
* folder than the default one you can set its name here. The folder
37-
* can also be renamed or relocated anywhere on your getServer. If
38-
* you do, use a full getServer path.
37+
* can also be renamed or relocated anywhere on your server. If
38+
* you do, use a full server path.
3939
*
4040
* @see https://codeigniter.com/user_guide/general/managing_apps.html
4141
*

app/Libraries/Blog.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,8 @@ protected function readPost(string $folder, string $filename)
253253
}
254254

255255
if (! $inBody) {
256-
$key = substr($line, 0, strpos($line, ':'));
257-
$value = trim(substr($line, strpos($line, ':') + 1));
258-
259-
$post->{$key} = $value;
256+
$key = substr($line, 0, strpos($line, ':'));
257+
$post->{$key} = trim(substr($line, strpos($line, ':') + 1));
260258

261259
continue;
262260
}

app/Views/errors/html/error_404.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
<h1>404 - File Not Found</h1>
7474

7575
<p>
76-
<?php if (! empty($message) && $message !== '(null)') : ?>
76+
<?php if (ENVIRONMENT !== 'production') : ?>
7777
<?= nl2br(esc($message)) ?>
7878
<?php else : ?>
7979
Sorry! Cannot seem to find the page you were looking for.

composer.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,15 @@ GITHUB_ACCESS_TOKEN=
4848
# database.default.password = root
4949
# database.default.DBDriver = MySQLi
5050
# database.default.DBPrefix =
51+
# database.default.port = 3306
5152

5253
# database.tests.hostname = localhost
5354
# database.tests.database = ci4
5455
# database.tests.username = root
5556
# database.tests.password = root
5657
# database.tests.DBDriver = MySQLi
5758
# database.tests.DBPrefix =
59+
# database.tests.port = 3306
5860

5961
#--------------------------------------------------------------------
6062
# CONTENT SECURITY POLICY

public/index.php

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

3+
// Check PHP version.
4+
$minPhpVersion = '7.4'; // If you update this, don't forget to update `spark`.
5+
if (version_compare(PHP_VERSION, $minPhpVersion, '<')) {
6+
$message = sprintf(
7+
'Your PHP version must be %s or higher to run CodeIgniter. Current version: %s',
8+
$minPhpVersion,
9+
PHP_VERSION
10+
);
11+
12+
exit($message);
13+
}
14+
315
// Path to the front controller (this file)
416
define('FCPATH', __DIR__ . DIRECTORY_SEPARATOR);
517

0 commit comments

Comments
 (0)