Skip to content

Commit 55cf61e

Browse files
committed
Release 4.0.0-rc.4
1 parent cadc4ea commit 55cf61e

File tree

10 files changed

+69
-97
lines changed

10 files changed

+69
-97
lines changed

app/Config/App.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class App extends BaseConfig
2121
| environments.
2222
|
2323
*/
24-
public $baseURL = 'http://localhost:8080';
24+
public $baseURL = 'http://localhost:8080/';
2525

2626
/*
2727
|--------------------------------------------------------------------------

app/Config/Autoload.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ public function __construct()
5050
* `];
5151
*/
5252
$psr4 = [
53-
'Config' => APPPATH . 'Config',
54-
APP_NAMESPACE => APPPATH, // For custom namespace
5553
'App' => APPPATH, // To ensure filters, etc still found,
54+
APP_NAMESPACE => APPPATH, // For custom namespace
55+
'Config' => APPPATH . 'Config',
5656
];
5757

5858
/**

app/Config/Database.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ class Database extends \CodeIgniter\Database\Config
6262
'hostname' => '127.0.0.1',
6363
'username' => '',
6464
'password' => '',
65-
'database' => '',
66-
'DBDriver' => '',
67-
'DBPrefix' => 'db_', // Needed to ensure we're working correctly with prefixes live. DO NOT REMOVE.
65+
'database' => ':memory:',
66+
'DBDriver' => 'SQLite3',
67+
'DBPrefix' => 'db_', // Needed to ensure we're working correctly with prefixes live. DO NOT REMOVE FOR CI DEVS
6868
'pConnect' => false,
6969
'DBDebug' => (ENVIRONMENT !== 'production'),
7070
'cacheOn' => false,

app/Config/Email.php

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<?php
22
namespace Config;
33

4-
class Email
4+
use CodeIgniter\Config\BaseConfig;
5+
6+
class Email extends BaseConfig
57
{
68

79
/**
@@ -14,6 +16,11 @@ class Email
1416
*/
1517
public $fromName;
1618

19+
/**
20+
* @var string
21+
*/
22+
public $recipients;
23+
1724
/**
1825
* The "user agent"
1926
*

app/Config/Logger.php

+7-14
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,8 @@ class Logger extends BaseConfig
3838
|--------------------------------------------------------------------------
3939
| Error Logging Directory Path
4040
|--------------------------------------------------------------------------
41-
|
42-
|
43-
|
41+
| By default, logs are written to WRITEPATH . 'logs/'
42+
| Specify a different destination here, if desired.
4443
*/
4544
public $path = '';
4645

@@ -102,19 +101,13 @@ class Logger extends BaseConfig
102101
],
103102

104103
/*
105-
* Leave this BLANK unless you would like to set something other than the default
106-
* writeable/logs/ directory. Use a full getServer path with trailing slash.
107-
*/
108-
'path' => WRITEPATH . 'logs/',
109-
110-
/*
111-
* The default filename extension for log files. The default 'php' allows for
112-
* protecting the log files via basic scripting, when they are to be stored
113-
* under a publicly accessible directory.
104+
* The default filename extension for log files.
105+
* An extension of 'php' allows for protecting the log files via basic
106+
* scripting, when they are to be stored under a publicly accessible directory.
114107
*
115-
* Note: Leaving it blank will default to 'php'.
108+
* Note: Leaving it blank will default to 'log'.
116109
*/
117-
'fileExtension' => 'php',
110+
'fileExtension' => '',
118111

119112
/*
120113
* The file system permissions to be applied on newly created log files.

app/Config/Routes.php

-42
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,5 @@
11
<?php namespace Config;
22

3-
/**
4-
* --------------------------------------------------------------------
5-
* URI Routing
6-
* --------------------------------------------------------------------
7-
* This file lets you re-map URI requests to specific controller functions.
8-
*
9-
* Typically there is a one-to-one relationship between a URL string
10-
* and its corresponding controller class/method. The segments in a
11-
* URL normally follow this pattern:
12-
*
13-
* example.com/class/method/id
14-
*
15-
* In some instances, however, you may want to remap this relationship
16-
* so that a different class/function is called than the one
17-
* corresponding to the URL.
18-
*/
19-
203
// Create a new instance of our RouteCollection class.
214
$routes = Services::routes(true);
225

@@ -31,31 +14,6 @@
3114
* --------------------------------------------------------------------
3215
* Router Setup
3316
* --------------------------------------------------------------------
34-
* The RouteCollection object allows you to modify the way that the
35-
* Router works, by acting as a holder for it's configuration settings.
36-
* The following methods can be called on the object to modify
37-
* the default operations.
38-
*
39-
* $routes->defaultNamespace()
40-
*
41-
* Modifies the namespace that is added to a controller if it doesn't
42-
* already have one. By default this is the global namespace (\).
43-
*
44-
* $routes->defaultController()
45-
*
46-
* Changes the name of the class used as a controller when the route
47-
* points to a folder instead of a class.
48-
*
49-
* $routes->defaultMethod()
50-
*
51-
* Assigns the method inside the controller that is ran when the
52-
* Router is unable to determine the appropriate method to run.
53-
*
54-
* $routes->setAutoRoute()
55-
*
56-
* Determines whether the Router will attempt to match URIs to
57-
* Controllers when no specific route has been defined. If false,
58-
* only routes that have been defined here will be available.
5917
*/
6018
$routes->setDefaultNamespace('App\Controllers');
6119
$routes->setDefaultController('Home');

contributing.md

+44-31
Original file line numberDiff line numberDiff line change
@@ -3,77 +3,90 @@
33

44
## Contributions
55

6-
We expect all contributions to conform to our style guide, be commented (inside the PHP source files),
7-
be documented (in the user guide), and unit tested (in the test folder).
6+
We expect all contributions to conform to our [style guide](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/styleguide.rst), be commented (inside the PHP source files),
7+
be documented (in the [user guide](https://codeigniter4.github.io/userguide/)), and unit tested (in the [test folder](https://github.com/codeigniter4/CodeIgniter4/tree/develop/tests)).
88
There is a [Contributing to CodeIgniter](./contributing/README.rst) section in the repository which describes the contribution process; this page is an overview.
99

10+
The [Open Source Guide](https://opensource.guide/) is a good first read for those new to contributing to open source!
1011
## Issues
1112

12-
Issues are a quick way to point out a bug. If you find a bug or documentation error in CodeIgniter then please check a few things first:
13+
Issues are a quick way to point out a bug. If you find a bug or documentation error in CodeIgniter then please make sure that:
1314

14-
1. There is not already an open Issue
15-
2. The issue has already been fixed (check the develop branch, or look for closed Issues)
16-
3. Is it something really obvious that you can fix yourself?
15+
1. There is not already an open [Issue](https://github.com/codeigniter4/CodeIgniter4/issues)
16+
2. The Issue has not already been fixed (check the develop branch or look for [closed Issues](https://github.com/codeigniter4/CodeIgniter4/issues?q=is%3Aissue+is%3Aclosed))
17+
3. It's not something really obvious that you can fix yourself
1718

18-
Reporting issues is helpful but an even [better approach](./contributing/workflow.rst) is to send a Pull Request, which is done by "Forking" the main repository and committing to your own copy. This will require you to use the version control system called Git.
19+
Reporting Issues is helpful, but an even [better approach](./contributing/workflow.rst) is to send a [Pull Request](https://help.github.com/en/articles/creating-a-pull-request), which is done by [Forking](https://help.github.com/en/articles/fork-a-repo) the main repository and making a [Commit](https://help.github.com/en/desktop/contributing-to-projects/committing-and-reviewing-changes-to-your-project) to your own copy of the project. This will require you to use the version control system called [Git](https://git-scm.com/).
1920

2021
## Guidelines
2122

22-
Before we look into how, here are the guidelines. If your Pull Requests fail
23-
to pass these guidelines it will be declined and you will need to re-submit
23+
Before we look into how to contribute to CodeIgniter4, here are some guidelines. If your Pull Requests fail
24+
to pass these guidelines, they will be declined, and you will need to re-submit
2425
when you’ve made the changes. This might sound a bit tough, but it is required
25-
for us to maintain quality of the code-base.
26+
for us to maintain quality of the codebase.
2627

2728
### PHP Style
2829

2930
All code must meet the [Style Guide](./contributing/styleguide.rst).
30-
This makes certain that all code is the same format as the existing code and means it will be as readable as possible.
31+
This makes certain that all submitted code is of the same format as the existing code and ensures that the codebase will be as readable as possible.
3132

3233
### Documentation
3334

34-
If you change anything that requires a change to documentation then you will need to add it. New classes, methods, parameters, changing default values, etc are all things that will require a change to documentation. The change-log must also be updated for every change. Also PHPDoc blocks must be maintained.
35+
If you change anything that requires a change to documentation, then you will need to add to the documentation. New classes, methods, parameters, changing default values, etc. are all changes that require a change to documentation. Also, the [changelog](https://codeigniter4.github.io/CodeIgniter4/changelogs/index.html) must be updated for every change, and [PHPDoc](https://github.com/codeigniter4/CodeIgniter4/blob/develop/phpdoc.dist.xml) blocks must be maintained.
3536

3637
### Compatibility
3738

38-
CodeIgniter4 requires PHP 7.2.
39+
CodeIgniter4 requires [PHP 7.2](https://php.net/releases/7_2_0.php).
3940

4041
### Branching
4142

42-
CodeIgniter4 uses the [Git-Flow](http://nvie.com/posts/a-successful-git-branching-model/) branching model which requires all pull requests to be sent to the "develop" branch. This is
43-
where the next planned version will be developed. The "master" branch will always contain the latest stable version and is kept clean so a "hotfix" (e.g: an emergency security patch) can be applied to master to create a new version, without worrying about other features holding it up. For this reason all commits need to be made to "develop" and any sent to "master" will be closed automatically. If you have multiple changes to submit, please place all changes into their own branch on your fork.
43+
CodeIgniter4 uses the [Git-Flow](http://nvie.com/posts/a-successful-git-branching-model/) branching model which requires all
44+
Pull Requests to be sent to the "develop" branch; this is where the next planned version will be developed.
45+
The "master" branch will always contain the latest stable version and is kept clean so a "hotfix" (e.g. an
46+
emergency security patch) can be applied to the "master" branch to create a new version, without worrying
47+
about other features holding it up. For this reason, all commits need to be made to the "develop" branch,
48+
and any sent to the "master" branch will be closed automatically. If you have multiple changes to submit,
49+
please place all changes into their own branch on your fork.
4450

45-
One thing at a time: A pull request should only contain one change. That does not mean only one commit, but one change - however many commits it took. The reason for this is that if you change X and Y but send a pull request for both at the same time, we might really want X but disagree with Y, meaning we cannot merge the request. Using the Git-Flow branching model you can create new branches for both of these features and send two requests.
51+
**One thing at a time:** A pull request should only contain one change. That does not mean only one commit,
52+
but one change - however many commits it took. The reason for this is that if you change X and Y,
53+
but send a pull request for both at the same time, we might really want X but disagree with Y,
54+
meaning we cannot merge the request. Using the Git-Flow branching model you can create new
55+
branches for both of these features and send two requests.
56+
57+
A reminder: **please use separate branches for each of your PRs** - it will make it easier for you to keep changes separate from
58+
each other and from whatever else you are doing with your repository!
4659

4760
### Signing
4861

49-
You must [GPG-sign](./contributing/signing.rst) your work, certifying that you either wrote the work or otherwise have the right to pass it on to an open source project. This is *not* just a "signed-off-by" commit, but instead a digitally signed one.
62+
You must [GPG-sign](./contributing/signing.rst) your work, certifying that you either wrote the work or otherwise have the right to pass it on to an open source project. This is *not* just a "signed-off-by" commit, but instead, a digitally signed one.
5063

5164
## How-to Guide
5265

5366
The best way to contribute is to fork the CodeIgniter4 repository, and "clone" that to your development area. That sounds like some jargon, but "forking" on GitHub means "making a copy of that repo to your account" and "cloning" means "copying that code to your environment so you can work on it".
5467

55-
1. Set up Git (Windows, Mac & Linux)
56-
2. Go to the CodeIgniter4 repo
57-
3. Fork it (to your Github account)
58-
4. Clone your CodeIgniter repo: [email protected]:\<your-name>/CodeIgniter4.git
59-
5. Create a new branch in your project for each set of changes you want to make.
60-
6. Fix existing bugs on the Issue tracker after taking a look to see nobody else is working on them.
61-
7. Commit the changed files in your contribution branch
62-
8. Push your contribution branch to your fork
63-
9. Send a pull request [http://help.github.com/send-pull-requests/](http://help.github.com/send-pull-requests/)
68+
1. Set up Git ([Windows](https://git-scm.com/download/win), [Mac](https://git-scm.com/download/mac), & [Linux](https://git-scm.com/download/linux)).
69+
2. Go to the [CodeIgniter4 repository](https://github.com/codeigniter4/CodeIgniter4).
70+
3. [Fork](https://help.github.com/en/articles/fork-a-repo) it (to your Github account).
71+
4. [Clone](https://help.github.com/en/articles/cloning-a-repository) your CodeIgniter repository: `[email protected]:\<your-name>/CodeIgniter4.git`
72+
5. Create a new [branch](https://help.github.com/en/articles/about-branches) in your project for each set of changes you want to make.
73+
6. Fix existing bugs on the [Issue tracker](https://github.com/codeigniter4/CodeIgniter4/issues) after confirming that no one else is working on them.
74+
7. [Commit](https://help.github.com/en/desktop/contributing-to-projects/committing-and-reviewing-changes-to-your-project) the changed files in your contribution branch.
75+
8. [Push](https://help.github.com/en/articles/pushing-to-a-remote) your contribution branch to your fork.
76+
9. Send a [pull request](http://help.github.com/send-pull-requests/).
6477

65-
The codebase maintainers will now be alerted about the change and at least one of the team will respond. If your change fails to meet the guidelines it will be bounced, or feedback will be provided to help you improve it.
78+
The codebase maintainers will now be alerted to the submission and someone from the team will respond. If your change fails to meet the guidelines, it will be rejected or feedback will be provided to help you improve it.
6679

67-
Once the maintainer handling your pull request is happy with it they will merge it into develop and your patch will be part of the next release.
80+
Once the maintainer handling your pull request is satisfied with it they will approve the pull request and merge it into the "develop" branch; your patch will now be part of the next release!
6881

6982
### Keeping your fork up-to-date
7083

71-
Unlike systems like Subversion, Git can have multiple remotes. A remote is the name for a URL of a Git repository. By default your fork will have a remote named "origin" which points to your fork, but you can add another remote named "codeigniter" which points to `git://github.com/codeigniter4/CodeIgniter4.git`. This is a read-only remote but you can pull from this develop branch to update your own.
84+
Unlike systems like Subversion, Git can have multiple remotes. A remote is the name for the URL of a Git repository. By default, your fork will have a remote named "origin", which points to your fork, but you can add another remote named "codeigniter", which points to `git://github.com/codeigniter4/CodeIgniter4.git`. This is a read-only remote, but you can pull from this develop branch to update your own.
7285

73-
If you are using command-line you can do the following:
86+
If you are using the command-line, you can do the following to update your fork to the latest changes:
7487

7588
1. `git remote add codeigniter git://github.com/codeigniter4/CodeIgniter4.git`
7689
2. `git pull codeigniter develop`
7790
3. `git push origin develop`
7891

79-
Now your fork is up to date. This should be done regularly, or before you send a pull request at least.
92+
Your fork is now up to date. This should be done regularly and, at the least, before you submit a pull request.

license.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
The MIT License (MIT)
22

33
Copyright (c) 2014-2019 British Columbia Institute of Technology
4-
Copyright (c) 2019 CodeIgniter Foundation
4+
Copyright (c) 2019-2020 CodeIgniter Foundation
55

66
Permission is hereby granted, free of charge, to any person obtaining a copy
77
of this software and associated documentation files (the "Software"), to deal

public/.htaccess

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ Options All -Indexes
1717
# RewriteBase /
1818

1919
# Redirect Trailing Slashes...
20-
RewriteRule ^(.*)/$ /$1 [L,R=301]
20+
RewriteCond %{REQUEST_FILENAME} !-d
21+
RewriteRule ^(.*)/$ /$1 [L,R=301]
2122

2223
# Rewrite "www.example.com -> example.com"
2324
RewriteCond %{HTTPS} !=on

tests/_support/Models/ValidModel.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class ValidModel extends Model
2222
'required',
2323
'min_length[3]',
2424
],
25-
'token' => 'in_list[{id}]',
25+
'token' => 'permit_empty|in_list[{id}]',
2626
];
2727

2828
protected $validationMessages = [

0 commit comments

Comments
 (0)