Skip to content

Commit 9f132fc

Browse files
committed
Merge branch 'develop' of github.com:bcit-ci/CodeIgniter4 into develop
2 parents 5951c37 + 20b3b4b commit 9f132fc

13 files changed

Lines changed: 547 additions & 311 deletions

File tree

system/Session/Handlers/MemcachedHandler.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ public function __construct(BaseConfig $config, string $ipAddress)
9494
{
9595
$this->keyPrefix .= $this->ipAddress . ':';
9696
}
97+
98+
if(!empty($this->keyPrefix))
99+
{
100+
ini_set('memcached.sess_prefix', $this->keyPrefix);
101+
}
97102

98103
$this->sessionExpiration = $config->sessionExpiration;
99104
}
@@ -184,7 +189,7 @@ public function read($sessionID)
184189
return $session_data;
185190
}
186191

187-
return false;
192+
return '';
188193
}
189194

190195
//--------------------------------------------------------------------

system/Session/Session.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,11 @@ protected function configure()
303303
{
304304
ini_set('session.gc_maxlifetime', (int) $this->sessionExpiration);
305305
}
306+
307+
if(!empty($this->sessionSavePath))
308+
{
309+
ini_set('session.save_path', $this->sessionSavePath);
310+
}
306311

307312
// Security is king
308313
ini_set('session.use_trans_sid', 0);
22.3 KB
Loading

user_guide_src/source/incoming/incomingrequest.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
=====================
21
IncomingRequest Class
3-
=====================
2+
*********************
43

54
The IncomingRequest class provides an object-oriented representation of an HTTP request from a client, like a browser.
65
It extends from, and has access to all the methods of the :doc:`Request </incoming/request>` and :doc:`Message </incoming/message>`
@@ -270,7 +269,6 @@ You can easily negotiate content types with the request through the ``negotiate(
270269

271270
See the :doc:`Content Negotiation </incoming/content_negotiation>` page for more details.
272271

273-
***************
274272
Class Reference
275273
***************
276274

user_guide_src/source/installation/index.rst

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,31 @@
22
Installation
33
############
44

5-
There are a number of ways to download, install and run a
5+
CodeIgniter4 can be installed in a number of different ways: manually,
6+
using `Composer <https://getcomposer.org>`_, or using
7+
`Git <https://git-scm.com/>`_. If you are not sure which is most
8+
appropriate for you, read the introduction for
9+
each technique, and consider their pros and cons.
10+
11+
Once installed, there are several ways to run a
612
CodeIgniter4 app. Read on :)
713

814
.. toctree::
915
:titlesonly:
1016

11-
downloads
12-
installing
17+
installing_manual
18+
installing_composer
19+
installing_git
1320
running
1421
upgrading
1522
troubleshooting
23+
repositories
24+
25+
However you choose to install and run CodeIgniter4, the
26+
`user guide <https://codeigniter4.github.io/userguide/>`_ is accessible online.
27+
28+
.. note:: Before using CodeIgniter 4, make sure that your server meets the
29+
:doc:`requirements </intro/requirements>`, in particular the PHP
30+
version and the PHP extensions that are needed.
31+
You may find that you have to uncomment the ``php.ini`` "extension"
32+
lines to enable "curl" and "intl", for instance.

user_guide_src/source/installation/installing.rst

Lines changed: 0 additions & 248 deletions
This file was deleted.
Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
Composer Installation
2+
###############################################################################
3+
4+
.. contents::
5+
:local:
6+
:depth: 1
7+
8+
Composer can be used in several ways to install CodeIgniter4 on your system.
9+
10+
The first two techniques describe creating a skeleton project
11+
using CodeIgniter4, that you would then use as the base for a new webapp.
12+
The third technique described below lets you add CodeIgniter4 to an existing
13+
webapp,
14+
15+
**Note**: if you are using a Git repository to store your code, or for
16+
collaboration with others, then the ``vendor`` folder would normally
17+
be "git ignored". In such a case, you will need to do a ``composer udpate``
18+
when you clone the repository to a new system.
19+
20+
App Starter
21+
============================================================
22+
23+
The `CodeIgniter 4 app starter <https://github.com/codeigniter4/appstarter>`_
24+
repository holds a skeleton application, with a composer dependency on
25+
the latest released version of the framework.
26+
27+
This installation technique would suit a developer who wishes to start
28+
a new CodeIgniter4 based project.
29+
30+
Installation
31+
-------------------------------------------------------
32+
33+
In the folder above your project root::
34+
35+
composer create-project codeigniter4/appstarter -s alpha
36+
37+
Setup
38+
-------------------------------------------------------
39+
40+
The command above will create an "appstarter" folder.
41+
Feel free to rename that for your project.
42+
43+
Upgrading
44+
-------------------------------------------------------
45+
46+
Whenever there is a new release, then from the command line in your project root::
47+
48+
composer update
49+
50+
Read the upgrade instructions, and check designated ``app/Config`` folders for affected changes.
51+
52+
Pros
53+
-------------------------------------------------------
54+
55+
Simple installation; easy to update
56+
57+
Cons
58+
-------------------------------------------------------
59+
60+
You still need to check for ``app/Config`` changes after updating
61+
62+
Structure
63+
-------------------------------------------------------
64+
65+
Folders in your project after setup:
66+
67+
- app, public, writable
68+
- vendor/codeigniter4/framework/system
69+
- vendor/codeigniter4/codeigniter4/app & public (compare with yours after updating)
70+
71+
Dev Starter
72+
============================================================
73+
74+
Installation
75+
-------------------------------------------------------
76+
77+
The `CodeIgniter 4 dev starter <https://github.com/codeigniter4/devstarter>`_
78+
repository holds a skeleton application, just like the appstarter above,
79+
but with a composer dependency on
80+
the develop branch (unreleased) of the framework.
81+
It can be composer-installed as described here.
82+
83+
This installation technique would suit a developer who wishes to start
84+
a new CodeIgniter4 based project, and who is willing to live with the
85+
latest unreleased changes, which may be unstable.
86+
87+
The `development user guide <https://codeigniter4.github.io/CodeIgniter4/>`_ is accessible online.
88+
Note that this differs from the released user guide, and will pertain to the
89+
develop branch explicitly.
90+
91+
In the folder above your project root::
92+
93+
composer create-project codeigniter4/devstarter -s dev
94+
95+
Setup
96+
-------------------------------------------------------
97+
98+
The command above will create an "devstarter" folder.
99+
Feel free to rename that for your project.
100+
101+
Upgrading
102+
-------------------------------------------------------
103+
104+
``composer update`` whenever you are ready for the latest changes.
105+
106+
Check the changelog to see if any recent changes affect your app,
107+
bearing in mind that the most recent changes may not have made it
108+
into the changelog!
109+
110+
Pros
111+
-------------------------------------------------------
112+
113+
Simple installation; easy to update; bleeding edge version
114+
115+
Cons
116+
-------------------------------------------------------
117+
118+
This is not guaranteed to be stable; the onus is on you to upgrade.
119+
You still need to check for ``app/Config`` changes after updating.
120+
121+
Structure
122+
-------------------------------------------------------
123+
124+
Folders in your project after setup:
125+
126+
- app, public, writable
127+
- vendor/codeigniter4/codeigniter4/system
128+
- vendor/codeigniter4/codeigniter4/app & public (compare with yours after updating)
129+
130+
Adding CodeIgniter4 to an Existing Project
131+
============================================================
132+
133+
The same `CodeIgniter 4 framework <https://github.com/codeigniter4/framework>`_
134+
repository described in "Manual Installation" can also be added to an
135+
existing project using Composer.
136+
137+
Develop your app inside the ``app`` folder, and the ``public`` folder
138+
will be your document root.
139+
140+
In your project root::
141+
142+
composer require codeigniter4/framework @alpha
143+
144+
Setup
145+
-------------------------------------------------------
146+
147+
Copy the app, public and writable folders from ``vendor/codeigniter4/framework``
148+
to your project root
149+
150+
Copy the ``env``, ``phpunit.xml.dist`` and ``spark`` files, from
151+
``vendor/codeigniter4/framework`` to your project root
152+
153+
You will have to adjust paths to refer to vendor/codeigniter/framework``,
154+
- the $systemDirectory variable in ``app/Config/Paths.php``
155+
156+
Upgrading
157+
-------------------------------------------------------
158+
159+
Whenever there is a new release, then from the command line in your project root::
160+
161+
composer update
162+
163+
Read the upgrade instructions, and check designated
164+
``app/Config`` folders for affected changes.
165+
166+
Pros
167+
-------------------------------------------------------
168+
169+
Relatively simple installation; easy to update
170+
171+
Cons
172+
-------------------------------------------------------
173+
174+
You still need to check for ``app/Config`` changes after updating
175+
176+
Structure
177+
-------------------------------------------------------
178+
179+
Folders in your project after setup:
180+
181+
- app, public, writable
182+
- vendor/codeigniter4/framework/system
183+
184+
185+
Translations Installation
186+
============================================================
187+
188+
If you want to take advantage of the system message translations,
189+
they can be added to your project in a similar fashion.
190+
191+
From the command line inside your project root::
192+
193+
composer require codeigniter4/translations
194+
195+
These will be updated along with the framework whenever you do a ``composer update``.
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
Git Installation
2+
###############################################################################
3+
4+
This would *not* be suitable for app development, but *is* suitable
5+
for contributing to the framework.
6+
7+
Installation
8+
-------------------------------------------------------
9+
10+
Install the latest version of the codebase by
11+
12+
- forking the `codebase <https://github.com/codeigniter4/CodeIgniter4>`_ to your github account
13+
- cloning **your** forked repository locally
14+
15+
Setup
16+
-------------------------------------------------------
17+
18+
The command above will create a "CodeIgniter4" folder.
19+
Feel free to rename that as you see fit.
20+
21+
You will want to setup a remote repository alias, so you can synchronize
22+
your repository with the main one::
23+
24+
git remote add upstream https://github.com/codeigniter4/CodeIgniter4.git
25+
26+
Copy the provided ``env`` file to ``.env``, and use that for your git-ignored configuration settings,
27+
28+
Copy the provided ``phpunit.xml.dist`` to ``phpunit.xml`` and tailor it as needed,
29+
if you want custom unit testing for the framework.
30+
31+
Upgrading
32+
-------------------------------------------------------
33+
34+
Update your code anytime::
35+
36+
git checkout develop
37+
git pull upstream develop
38+
git push origin develop
39+
40+
Merge conflicts may arise when you pull from "upstream".
41+
You will need to resolve them locally.
42+
43+
Pros
44+
-------------------------------------------------------
45+
46+
- You have the latest version of the codebase (unreleased)
47+
- You can propose contributions to the framework, by creating a
48+
feature branch and submitting a pull request for it to the main repo
49+
- a pre-commit hook is installed for your repo, that binds it to the
50+
coding-standard we use
51+
52+
Cons
53+
-------------------------------------------------------
54+
55+
You need to resolve merge conflicts when you synch with the repo.
56+
57+
You would not use this technique for app development.
58+
59+
Structure
60+
-------------------------------------------------------
61+
62+
Folders in your project after setup:
63+
64+
- app, public, system, tests, user_guide_src, writable
65+
66+
67+
Translations Installation
68+
============================================================
69+
70+
If you wish to contribute to the system message translations,
71+
then fork and clone the `translations repository
72+
<https://github.com/codeigniter4/translations>`_ separately from the codebase.
73+
These are two independent repositories!
74+
75+
76+
Coding Standards Installation
77+
============================================================
78+
79+
This is bound and installed automatically as part of the
80+
codebase installation.
81+
82+
If you wish to use it inside your project too,
83+
``composer require codeigniter4/translations @alpha``

0 commit comments

Comments
 (0)