Skip to content

Commit 9dadd94

Browse files
authored
Merge pull request #1 from bcit-ci/develop
Merge from offcial [bcit-ci/CodeIgniter4]
2 parents 7240816 + af7eb03 commit 9dadd94

File tree

204 files changed

+5252
-2547
lines changed

Some content is hidden

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

204 files changed

+5252
-2547
lines changed

.php_cs

Lines changed: 7 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,38 @@
11
<?php
22

33
$finder = Symfony\CS\Finder\DefaultFinder::create()
4+
->exclude('ThirdParty')
45
->in('system');
56

67
return Symfony\CS\Config\Config::create()
7-
->level(Symfony\CS\FixerInterface::NONE_LEVEL)
8+
->level(Symfony\CS\FixerInterface::PSR1_LEVEL)
89
->fixers(array(
9-
'psr0',
10-
'encoding',
11-
'short_tag',
12-
'braces',
10+
'class_definition',
1311
'eof_ending',
14-
'line_after_namespace',
12+
'function_call_space',
1513
'linefeed',
1614
'lowercase_constants',
1715
'lowercase_keywords',
1816
'method_argument_space',
17+
'no_trailing_whitespace_in_comment',
1918
'parenthesis',
2019
'php_closing_tag',
21-
'single_line_after_imports',
2220
'trailing_spaces',
2321
'visibility',
2422
'array_element_no_space_before_comma',
2523
'array_element_white_space_after_comma',
2624
'concat_without_spaces',
27-
'double_arrow_multiline_whitespaces',
28-
'duplicate_semicolon',
29-
'function_typehint_space',
3025
'include',
31-
'multiline_array_trailing_comma',
32-
'no_empty_lines_after_phpdocs',
33-
'object_operator',
3426
'operators_spaces',
35-
'phpdoc_indent',
36-
'phpdoc_no_empty_return',
37-
'phpdoc_params',
38-
'phpdoc_scalar',
39-
'phpdoc_separation',
40-
'phpdoc_to_comment',
41-
'phpdoc_trim',
42-
'phpdoc_type_to_var',
43-
'phpdoc_types',
44-
'print_to_echo',
45-
'remove_leading_slash_use',
46-
'remove_lines_between_uses',
47-
'return',
48-
'single_array_no_trailing_comma',
4927
'spaces_before_semicolon',
50-
'standardize_not_equal',
5128
'ternary_spaces',
52-
'trim_array_spaces',
5329
'unary_operators_spaces',
54-
'unused_use',
30+
'spaces_cast',
5531
'whitespacy_lines',
5632
'align_double_arrow',
5733
'align_equals',
34+
'logical_not_operators_with_spaces',
5835
'logical_not_operators_with_successor_space',
5936
'multiline_spaces_before_semicolon',
60-
'no_blank_lines_before_namespace',
61-
'ordered_use',
62-
'phpdoc_order',
63-
'short_array_syntax',
6437
))
6538
->finder($finder);

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ language: php
22

33
php:
44
- 7
5+
- 7.1
56

67
global:
78
- CI=true
@@ -30,3 +31,5 @@ before_install:
3031
before_script:
3132
- composer install --prefer-source
3233

34+
after_success:
35+
- travis_retry php vendor/bin/coveralls

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# CodeIgniter 4 Development
22

33
[![Build Status](https://travis-ci.org/bcit-ci/CodeIgniter4.svg?branch=develop)](https://travis-ci.org/bcit-ci/CodeIgniter4)
4+
[![Coverage Status](https://coveralls.io/repos/github/bcit-ci/CodeIgniter4/badge.svg?branch=develop)](https://coveralls.io/github/bcit-ci/CodeIgniter4?branch=develop)
45
<br>
56

67
## What is CodeIgniter?

application/Config/App.php

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -292,28 +292,6 @@ class App extends BaseConfig
292292
*/
293293
public $errorViewPath = APPPATH.'Views/errors';
294294

295-
/*
296-
|--------------------------------------------------------------------------
297-
| Composer auto-loading
298-
|--------------------------------------------------------------------------
299-
|
300-
| Enabling this setting will tell CodeIgniter to look for a Composer
301-
| package auto-loader script in /vendor/autoload.php.
302-
|
303-
| $composerAutoload = TRUE;
304-
|
305-
| Or if you have your vendor/ directory located somewhere else, you
306-
| can opt to set a specific path as well:
307-
|
308-
| $composerAutoload = '/path/to/vendor/autoload.php';
309-
|
310-
| For more information about Composer, please visit http://getcomposer.org/
311-
|
312-
| Note: This will NOT disable or override the CodeIgniter-specific
313-
| autoloading.
314-
*/
315-
public $composerAutoload = false;
316-
317295
/*
318296
|--------------------------------------------------------------------------
319297
| Encryption Key

application/Config/Autoload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function __construct()
5454
APP_NAMESPACE => APPPATH, // For custom namespace
5555
'App' => APPPATH, // To ensure filters, etc still found
5656
];
57-
57+
5858
/**
5959
* -------------------------------------------------------------------
6060
* Class Map

application/Config/Boot/development.php

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44
|--------------------------------------------------------------------------
55
| ERROR DISPLAY
66
|--------------------------------------------------------------------------
7+
| In development, we want to show as many errors as possible to help
8+
| make sure they don't make it to production. And save us hours of
9+
| painful debugging.
710
*/
8-
9-
// In development, we want to show as many errors as possible to help
10-
// make sure they don't make it to production. And save us hours of
11-
// painful debugging.
1211
error_reporting(-1);
1312
ini_set('display_errors', 1);
1413

@@ -22,23 +21,13 @@
2221
*/
2322
define('SHOW_DEBUG_BACKTRACE', true);
2423

25-
/*
26-
|--------------------------------------------------------------------------
27-
| KINT
28-
|--------------------------------------------------------------------------
29-
| If true, will enable the Kint PHP Debugging tool and make it available
30-
| globally throughout your application to use while making sure things
31-
| work the way you intend them to.
32-
*/
33-
$useKint = true;
34-
3524
/*
3625
|--------------------------------------------------------------------------
3726
| DEBUG MODE
3827
|--------------------------------------------------------------------------
3928
| Debug mode is an experimental flag that can allow changes throughout
40-
| the system. It's not widely used currently, and may not survive
41-
| release of the framework.
29+
| the system. This will control whether Kint is loaded, and a few other
30+
| items. It can always be used within your own application too.
4231
*/
4332

44-
define('CI_DEBUG', 1);
33+
define('CI_DEBUG', 1);

application/Config/Boot/production.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@
44
|--------------------------------------------------------------------------
55
| ERROR DISPLAY
66
|--------------------------------------------------------------------------
7+
| Don't show ANY in production environments. Instead, let the system catch
8+
| it and display a generic error message.
79
*/
8-
9-
// Don't show ANY in production environments. Instead, let the system catch
10-
// it and display a generic error message.
1110
ini_set('display_errors', 0);
1211
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
1312

@@ -20,4 +19,4 @@
2019
| release of the framework.
2120
*/
2221

23-
define('CI_DEBUG', 0);
22+
define('CI_DEBUG', 0);

application/Config/Boot/testing.php

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44
|--------------------------------------------------------------------------
55
| ERROR DISPLAY
66
|--------------------------------------------------------------------------
7+
| In development, we want to show as many errors as possible to help
8+
| make sure they don't make it to production. And save us hours of
9+
| painful debugging.
710
*/
8-
9-
// In development, we want to show as many errors as possible to help
10-
// make sure they don't make it to production. And save us hours of
11-
// painful debugging.
1211
error_reporting(-1);
1312
ini_set('display_errors', 1);
1413

@@ -22,16 +21,6 @@
2221
*/
2322
define('SHOW_DEBUG_BACKTRACE', true);
2423

25-
/*
26-
|--------------------------------------------------------------------------
27-
| KINT
28-
|--------------------------------------------------------------------------
29-
| If true, will enable the Kint PHP Debugging tool and make it available
30-
| globally throughout your application to use while making sure things
31-
| work the way you intend them to.
32-
*/
33-
$useKint = true;
34-
3524
/*
3625
|--------------------------------------------------------------------------
3726
| DEBUG MODE
@@ -41,4 +30,4 @@
4130
| release of the framework.
4231
*/
4332

44-
define('CI_DEBUG', 1);
33+
define('CI_DEBUG', 1);

application/Config/Constants.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@
1313
//
1414
define('APP_NAMESPACE', 'App');
1515

16+
/*
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+
*/
24+
define('COMPOSER_PATH', ROOTPATH.'vendor/autoload.php');
25+
1626
/*
1727
|--------------------------------------------------------------------------
1828
| Timing Constants

application/Config/Paths.php

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?php namespace Config;
2+
3+
/**
4+
* Holds the paths that are used by the system to
5+
* locate the main directories, application, system, etc.
6+
* Modifying these allows you to re-structure your application,
7+
* share a system folder between multiple applications, and more.
8+
*
9+
* All paths are relative to the application's front controller, index.php
10+
*/
11+
class Paths
12+
{
13+
/*
14+
*---------------------------------------------------------------
15+
* SYSTEM FOLDER NAME
16+
*---------------------------------------------------------------
17+
*
18+
* This variable must contain the name of your "system" folder.
19+
* Include the path if the folder is not in the same directory
20+
* as this file.
21+
*/
22+
public $systemDirectory = '../system';
23+
24+
/*
25+
*---------------------------------------------------------------
26+
* APPLICATION FOLDER NAME
27+
*---------------------------------------------------------------
28+
*
29+
* If you want this front controller to use a different "application"
30+
* folder than the default one you can set its name here. The folder
31+
* can also be renamed or relocated anywhere on your getServer. If
32+
* you do, use a full getServer path. For more info please see the user guide:
33+
* http://codeigniter.com/user_guide/general/managing_apps.html
34+
*
35+
* NO TRAILING SLASH!
36+
*/
37+
public $applicationDirectory = '../application';
38+
39+
/*
40+
* ---------------------------------------------------------------
41+
* WRITABLE DIRECTORY NAME
42+
* ---------------------------------------------------------------
43+
*
44+
* This variable must contain the name of your "writable" directory.
45+
* The writable directory allows you to group all directories that
46+
* need write permission to a single place that can be tucked away
47+
* for maximum security, keeping it out of the application and/or
48+
* system directories.
49+
*/
50+
public $writableDirectory = '../writable';
51+
52+
/*
53+
* ---------------------------------------------------------------
54+
* TESTS DIRECTORY NAME
55+
* ---------------------------------------------------------------
56+
*
57+
* This variable must contain the name of your "tests" directory.
58+
* The writable directory allows you to group all directories that
59+
* need write permission to a single place that can be tucked away
60+
* for maximum security, keeping it out of the application and/or
61+
* system directories.
62+
*/
63+
public $testsDirectory = '../tests';
64+
65+
/*
66+
* ---------------------------------------------------------------
67+
* PUBLIC DIRECTORY NAME
68+
* ---------------------------------------------------------------
69+
*
70+
* This variable must contain the name of the directory that
71+
* contains the main index.php front-controller. By default,
72+
* this is the `public` directory, but some hosts may not
73+
* be able to map a primary domain to a sub-directory so you
74+
* can change this to `public_html`, for example, to comply
75+
* with your host's needs.
76+
*/
77+
public $publicDirectory = 'public';
78+
}

application/Filters/DebugToolbar.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ public function after(RequestInterface $request, ResponseInterface $response)
3535
{
3636
if ( ! is_cli() && CI_DEBUG)
3737
{
38-
global $codeigniter;
38+
global $app;
3939

4040
$toolbar = Services::toolbar(new App());
41-
$stats = $codeigniter->getPerfomanceStats();
41+
$stats = $app->getPerformanceStats();
4242

4343
return $response->appendBody(
4444
$toolbar->run(

application/Models/TempModel.php

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

0 commit comments

Comments
 (0)