Skip to content

Commit 9732e9d

Browse files
authored
Merge pull request #1690 from jim-parry/docs/install
Rework install docs
2 parents 1c1bb68 + ab559bb commit 9732e9d

11 files changed

Lines changed: 404 additions & 274 deletions

File tree

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

0 commit comments

Comments
 (0)