Skip to content

Commit fc8f78e

Browse files
committed
Release 4.0.0-alpha.3
1 parent aa42bf1 commit fc8f78e

File tree

335 files changed

+75613
-2
lines changed

Some content is hidden

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

335 files changed

+75613
-2
lines changed

README.md

Lines changed: 69 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,69 @@
1-
# framework
2-
PHP framework
1+
# CodeIgniter 4 Framework
2+
3+
## What is CodeIgniter?
4+
CodeIgniter is a PHP full-stack web framework that is light, fast, flexible, and secure.
5+
More information can be found at the [official site](http://codeigniter.com).
6+
7+
This repository holds the distributable version of the framework,
8+
including the user guide. It has been built from the
9+
[development repository](https://github.com/codeigniter4/CodeIgniter4).
10+
11+
**This is pre-release code and should not be used in production sites.**
12+
13+
More information about the plans for version 4 can be found in [the announcement](http://forum.codeigniter.com/thread-62615.html) on the forums.
14+
15+
The user guide corresponding to this version of the framework can be found
16+
[here](https://codeigniter4.github.io/userguide/).
17+
18+
19+
## Important Change with index.php
20+
21+
`index.php` is no longer in the root of the project! It has been moved inside the *public* folder,
22+
for better security and separation of components.
23+
24+
This means that you should configure your web server to "point" to your project's *public* folder, and
25+
not to the project root. A better practice would be to configure a virtual host to point there. A poor practice would be to point your web server to the project root and expect to enter *public/...*, as the rest of your logic and the
26+
framework are exposed.
27+
28+
**Please** read the user guide for a better explanation of how CI4 works!
29+
The user guide updating and deployment is a bit awkward at the moment, but we are working on it!
30+
31+
## Repository Management
32+
We use Github issues to track **BUGS** and to track approved **DEVELOPMENT** work packages.
33+
We use our [forum](http://forum.codeigniter.com) to provide SUPPORT and to discuss
34+
FEATURE REQUESTS.
35+
36+
If you raise an issue here that pertains to support or a feature request, it will
37+
be closed! If you are not sure if you have found a bug, raise a thread on the forum first -
38+
someone else may have encountered the same thing.
39+
40+
Before raising a new Github issue, please check that your bug hasn't already
41+
been reported or fixed.
42+
43+
We use pull requests (PRs) for CONTRIBUTIONS to the repository.
44+
We are looking for contributions that address one of the reported bugs or
45+
approved work packages.
46+
47+
Do not use a PR as a form of feature request.
48+
Unsolicited contributions will only be considered if they fit nicely
49+
into the framework roadmap.
50+
Remember that some components that were part of CodeIgniter 3 are being moved
51+
to optional packages, with their own repository.
52+
53+
## Contributing
54+
We welcome contributions from the community.
55+
56+
Please read the [*Contributing to CodeIgniter*](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing.md) section in the development repository.
57+
58+
## Server Requirements
59+
PHP version 7.1 or higher is required, with the following extensions installed:
60+
61+
- [intl](http://php.net/manual/en/intl.requirements.php)
62+
- [libcurl](http://php.net/manual/en/curl.requirements.php) if you plan to use the HTTP\CURLRequest library
63+
64+
Additionally, make sure that the following extensions are enabled in your PHP:
65+
66+
- json (enabled by default - don't turn it off)
67+
- [mbstring](http://php.net/manual/en/mbstring.installation.php)
68+
- [mysqlnd](http://php.net/manual/en/mysqlnd.install.php)
69+
- xml (enabled by default - don't turn it off)

application/.htaccess

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<IfModule authz_core_module>
2+
Require all denied
3+
</IfModule>
4+
<IfModule !authz_core_module>
5+
Deny from all
6+
</IfModule>

application/Config/App.php

Lines changed: 306 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,306 @@
1+
<?php namespace Config;
2+
3+
use CodeIgniter\Config\BaseConfig;
4+
5+
class App extends BaseConfig
6+
{
7+
8+
/*
9+
|--------------------------------------------------------------------------
10+
| Base Site URL
11+
|--------------------------------------------------------------------------
12+
|
13+
| URL to your CodeIgniter root. Typically this will be your base URL,
14+
| WITH a trailing slash:
15+
|
16+
| http://example.com/
17+
|
18+
| If this is not set then CodeIgniter will try guess the protocol, domain
19+
| and path to your installation. However, you should always configure this
20+
| explicitly and never rely on auto-guessing, especially in production
21+
| environments.
22+
|
23+
*/
24+
public $baseURL = '';
25+
26+
/*
27+
|--------------------------------------------------------------------------
28+
| Index File
29+
|--------------------------------------------------------------------------
30+
|
31+
| Typically this will be your index.php file, unless you've renamed it to
32+
| something else. If you are using mod_rewrite to remove the page set this
33+
| variable so that it is blank.
34+
|
35+
*/
36+
public $indexPage = 'index.php';
37+
38+
/*
39+
|--------------------------------------------------------------------------
40+
| URI PROTOCOL
41+
|--------------------------------------------------------------------------
42+
|
43+
| This item determines which getServer global should be used to retrieve the
44+
| URI string. The default setting of 'REQUEST_URI' works for most servers.
45+
| If your links do not seem to work, try one of the other delicious flavors:
46+
|
47+
| 'REQUEST_URI' Uses $_SERVER['REQUEST_URI']
48+
| 'QUERY_STRING' Uses $_SERVER['QUERY_STRING']
49+
| 'PATH_INFO' Uses $_SERVER['PATH_INFO']
50+
|
51+
| WARNING: If you set this to 'PATH_INFO', URIs will always be URL-decoded!
52+
*/
53+
public $uriProtocol = 'REQUEST_URI';
54+
55+
/*
56+
|--------------------------------------------------------------------------
57+
| Default Locale
58+
|--------------------------------------------------------------------------
59+
|
60+
| The Locale roughly represents the language and location that your visitor
61+
| is viewing the site from. It affects the language strings and other
62+
| strings (like currency markers, numbers, etc), that your program
63+
| should run under for this request.
64+
|
65+
*/
66+
public $defaultLocale = 'en';
67+
68+
/*
69+
|--------------------------------------------------------------------------
70+
| Negotiate Locale
71+
|--------------------------------------------------------------------------
72+
|
73+
| If true, the current Request object will automatically determine the
74+
| language to use based on the value of the Accept-Language header.
75+
|
76+
| If false, no automatic detection will be performed.
77+
|
78+
*/
79+
public $negotiateLocale = false;
80+
81+
/*
82+
|--------------------------------------------------------------------------
83+
| Supported Locales
84+
|--------------------------------------------------------------------------
85+
|
86+
| If $negotiateLocale is true, this array lists the locales supported
87+
| by the application in descending order of priority. If no match is
88+
| found, the first locale will be used.
89+
|
90+
*/
91+
public $supportedLocales = ['en'];
92+
93+
/*
94+
|--------------------------------------------------------------------------
95+
| Application Timezone
96+
|--------------------------------------------------------------------------
97+
|
98+
| The default timezone that will be used in your application to display
99+
| dates with the date helper, and can be retrieved through app_timezone()
100+
|
101+
*/
102+
public $appTimezone = 'America/Chicago';
103+
104+
/*
105+
|--------------------------------------------------------------------------
106+
| Default Character Set
107+
|--------------------------------------------------------------------------
108+
|
109+
| This determines which character set is used by default in various methods
110+
| that require a character set to be provided.
111+
|
112+
| See http://php.net/htmlspecialchars for a list of supported charsets.
113+
|
114+
*/
115+
public $charset = 'UTF-8';
116+
117+
/*
118+
|--------------------------------------------------------------------------
119+
| URI PROTOCOL
120+
|--------------------------------------------------------------------------
121+
|
122+
| If true, this will force every request made to this application to be
123+
| made via a secure connection (HTTPS). If the incoming request is not
124+
| secure, the user will be redirected to a secure version of the page
125+
| and the HTTP Strict Transport Security header will be set.
126+
*/
127+
public $forceGlobalSecureRequests = false;
128+
129+
/*
130+
|--------------------------------------------------------------------------
131+
| Session Variables
132+
|--------------------------------------------------------------------------
133+
|
134+
| 'sessionDriver'
135+
|
136+
| The storage driver to use: files, database, redis, memcached
137+
| - CodeIgniter\Session\Handlers\FileHandler
138+
| - CodeIgniter\Session\Handlers\DatabaseHandler
139+
| - CodeIgniter\Session\Handlers\MemcachedHandler
140+
| - CodeIgniter\Session\Handlers\RedisHandler
141+
|
142+
| 'sessionCookieName'
143+
|
144+
| The session cookie name, must contain only [0-9a-z_-] characters
145+
|
146+
| 'sessionExpiration'
147+
|
148+
| The number of SECONDS you want the session to last.
149+
| Setting to 0 (zero) means expire when the browser is closed.
150+
|
151+
| 'sessionSavePath'
152+
|
153+
| The location to save sessions to, driver dependent.
154+
|
155+
| For the 'files' driver, it's a path to a writable directory.
156+
| WARNING: Only absolute paths are supported!
157+
|
158+
| For the 'database' driver, it's a table name.
159+
| Please read up the manual for the format with other session drivers.
160+
|
161+
| IMPORTANT: You are REQUIRED to set a valid save path!
162+
|
163+
| 'sessionMatchIP'
164+
|
165+
| Whether to match the user's IP address when reading the session data.
166+
|
167+
| WARNING: If you're using the database driver, don't forget to update
168+
| your session table's PRIMARY KEY when changing this setting.
169+
|
170+
| 'sessionTimeToUpdate'
171+
|
172+
| How many seconds between CI regenerating the session ID.
173+
|
174+
| 'sessionRegenerateDestroy'
175+
|
176+
| Whether to destroy session data associated with the old session ID
177+
| when auto-regenerating the session ID. When set to FALSE, the data
178+
| will be later deleted by the garbage collector.
179+
|
180+
| Other session cookie settings are shared with the rest of the application,
181+
| except for 'cookie_prefix' and 'cookie_httponly', which are ignored here.
182+
|
183+
*/
184+
public $sessionDriver = 'CodeIgniter\Session\Handlers\FileHandler';
185+
public $sessionCookieName = 'ci_session';
186+
public $sessionExpiration = 7200;
187+
public $sessionSavePath = WRITEPATH . 'session';
188+
public $sessionMatchIP = false;
189+
public $sessionTimeToUpdate = 300;
190+
public $sessionRegenerateDestroy = false;
191+
192+
/*
193+
|--------------------------------------------------------------------------
194+
| Cookie Related Variables
195+
|--------------------------------------------------------------------------
196+
|
197+
| 'cookiePrefix' = Set a cookie name prefix if you need to avoid collisions
198+
| 'cookieDomain' = Set to .your-domain.com for site-wide cookies
199+
| 'cookiePath' = Typically will be a forward slash
200+
| 'cookieSecure' = Cookie will only be set if a secure HTTPS connection exists.
201+
| 'cookieHTTPOnly' = Cookie will only be accessible via HTTP(S) (no javascript)
202+
|
203+
| Note: These settings (with the exception of 'cookie_prefix' and
204+
| 'cookie_httponly') will also affect sessions.
205+
|
206+
*/
207+
public $cookiePrefix = '';
208+
public $cookieDomain = '';
209+
public $cookiePath = '/';
210+
public $cookieSecure = false;
211+
public $cookieHTTPOnly = false;
212+
213+
/*
214+
|--------------------------------------------------------------------------
215+
| Reverse Proxy IPs
216+
|--------------------------------------------------------------------------
217+
|
218+
| If your server is behind a reverse proxy, you must whitelist the proxy
219+
| IP addresses from which CodeIgniter should trust headers such as
220+
| HTTP_X_FORWARDED_FOR and HTTP_CLIENT_IP in order to properly identify
221+
| the visitor's IP address.
222+
|
223+
| You can use both an array or a comma-separated list of proxy addresses,
224+
| as well as specifying whole subnets. Here are a few examples:
225+
|
226+
| Comma-separated: '10.0.1.200,192.168.5.0/24'
227+
| Array: array('10.0.1.200', '192.168.5.0/24')
228+
*/
229+
public $proxyIPs = '';
230+
231+
/*
232+
|--------------------------------------------------------------------------
233+
| Cross Site Request Forgery
234+
|--------------------------------------------------------------------------
235+
| Enables a CSRF cookie token to be set. When set to TRUE, token will be
236+
| checked on a submitted form. If you are accepting user data, it is strongly
237+
| recommended CSRF protection be enabled.
238+
|
239+
| CSRFTokenName = The token name
240+
| CSRFCookieName = The cookie name
241+
| CSRFExpire = The number in seconds the token should expire.
242+
| CSRFRegenerate = Regenerate token on every submission
243+
| CSRFRedirect = Redirect to previous page with error on failure
244+
*/
245+
public $CSRFTokenName = 'csrf_test_name';
246+
public $CSRFCookieName = 'csrf_cookie_name';
247+
public $CSRFExpire = 7200;
248+
public $CSRFRegenerate = true;
249+
public $CSRFRedirect = true;
250+
251+
/*
252+
|--------------------------------------------------------------------------
253+
| Content Security Policy
254+
|--------------------------------------------------------------------------
255+
| Enables the Response's Content Secure Policy to restrict the sources that
256+
| can be used for images, scripts, CSS files, audio, video, etc. If enabled,
257+
| the Response object will populate default values for the policy from the
258+
| ContentSecurityPolicy.php file. Controllers can always add to those
259+
| restrictions at run time.
260+
|
261+
| For a better understanding of CSP, see these documents:
262+
| - http://www.html5rocks.com/en/tutorials/security/content-security-policy/
263+
| - http://www.w3.org/TR/CSP/
264+
*/
265+
public $CSPEnabled = false;
266+
267+
/*
268+
|--------------------------------------------------------------------------
269+
| Debug Toolbar
270+
|--------------------------------------------------------------------------
271+
| The Debug Toolbar provides a way to see information about the performance
272+
| and state of your application during that page display. By default it will
273+
| NOT be displayed under production environments, and will only display if
274+
| CI_DEBUG is true, since if it's not, there's not much to display anyway.
275+
|
276+
| toolbarMaxHistory = Number of history files, 0 for none or -1 for unlimited
277+
|
278+
*/
279+
public $toolbarCollectors = [
280+
'CodeIgniter\Debug\Toolbar\Collectors\Timers',
281+
'CodeIgniter\Debug\Toolbar\Collectors\Database',
282+
'CodeIgniter\Debug\Toolbar\Collectors\Logs',
283+
'CodeIgniter\Debug\Toolbar\Collectors\Views',
284+
// 'CodeIgniter\Debug\Toolbar\Collectors\Cache',
285+
'CodeIgniter\Debug\Toolbar\Collectors\Files',
286+
'CodeIgniter\Debug\Toolbar\Collectors\Routes',
287+
'CodeIgniter\Debug\Toolbar\Collectors\Events',
288+
];
289+
public $toolbarMaxHistory = 20;
290+
291+
/*
292+
|--------------------------------------------------------------------------
293+
| Application Salt
294+
|--------------------------------------------------------------------------
295+
|
296+
| The $salt can be used anywhere within the application that you need
297+
| to provide secure data. It should be different for every application
298+
| and can be of any length, though the more random the characters
299+
| the better.
300+
|
301+
*/
302+
public $salt = '';
303+
304+
//--------------------------------------------------------------------
305+
306+
}

0 commit comments

Comments
 (0)