Skip to content

docs: improve installation #6324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Aug 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 20 additions & 7 deletions user_guide_src/source/installation/installing_composer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Composer Installation

Composer can be used in several ways to install CodeIgniter4 on your system.

The first two techniques describe creating a skeleton project
The first technique describes creating a skeleton project
using CodeIgniter4, that you would then use as the base for a new webapp.
The third technique described below lets you add CodeIgniter4 to an existing
The second technique described below lets you add CodeIgniter4 to an existing
webapp,

.. note:: If you are using a Git repository to store your code, or for
Expand All @@ -27,8 +27,8 @@ the latest released version of the framework.
This installation technique would suit a developer who wishes to start
a new CodeIgniter4 based project.

Installation & Set Up
---------------------
Installation
------------

In the folder above your project root::

Expand All @@ -52,7 +52,11 @@ A sample such installation command, using the default project-root "appstarter":

> composer create-project codeigniter4/appstarter --no-dev

After installation you should follow the steps in the "Upgrading" section.
Initial Configuration
---------------------

After installation, a few initial configurations are required.
See :ref:`initial-configuration` for the details.

.. _app-starter-upgrading:

Expand Down Expand Up @@ -126,6 +130,9 @@ The same `CodeIgniter 4 framework <https://github.com/codeigniter4/framework>`_
repository described in "Manual Installation" can also be added to an
existing project using Composer.

Installation
------------

Develop your app inside the ``app`` folder, and the ``public`` folder
will be your document root.

Expand All @@ -136,8 +143,8 @@ In your project root::
As with the earlier two composer install methods, you can omit installing
phpunit and its dependencies by adding the ``--no-dev`` argument to the ``composer require`` command.

Set Up
------
Setting Up
----------

Copy the ``app``, ``public``, and ``writable`` folders from ``vendor/codeigniter4/framework``
to your project root
Expand All @@ -148,6 +155,12 @@ Copy the ``env``, ``phpunit.xml.dist`` and ``spark`` files, from
You will have to adjust the system path to refer to the vendor one, e.g., ``ROOTPATH . '/vendor/codeigniter4/framework/system'``,
- the ``$systemDirectory`` variable in **app/Config/Paths.php**

Initial Configuration
---------------------

A few initial configurations are required.
See :ref:`initial-configuration` for the details.

.. _adding-codeigniter4-upgrading:

Upgrading
Expand Down
15 changes: 8 additions & 7 deletions user_guide_src/source/installation/installing_manual.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,32 +26,33 @@ and extract it to become your project root.
The symbols that can be used are ``/``, ``_``, ``.``, ``:``, ``\`` and space.
So if you install CodeIgniter under the folder that contains the special characters like ``(``, ``)``, etc., CodeIgniter won't work.

Setting Up
----------
Initial Configuration
=====================

None
After installation, a few initial configurations are required.
See :ref:`initial-configuration` for the detail.

.. _installing-manual-upgrading:

Upgrading
---------
=========

Download a new copy of the framework, and then replace the ``system`` folder.

Read the :doc:`upgrade instructions <upgrading>`, and check Breaking Changes and Enhancements.

Pros
----
====

Download and run

Cons
----
====

You are responsible for merge conflicts when updating

Structure
---------
=========

Folders in your project after set up:
app, public, system, writable
Expand Down
21 changes: 14 additions & 7 deletions user_guide_src/source/installation/running.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,31 @@ This section addresses how to use each technique, and explains some of the pros
If you're new to CodeIgniter, please read the :doc:`Getting Started </intro/index>`
section of the User Guide to begin learning how to build dynamic PHP applications. Enjoy!

Initial Configuration & Set Up
==============================
.. _initial-configuration:

Initial Configuration
=====================

#. Open the **app/Config/App.php** file with a text editor and
set your base URL. If you need more flexibility, the baseURL may
set your base URL to ``$baseURL``. If you need more flexibility, the baseURL may
be set within the **.env** file as ``app.baseURL = 'http://example.com/'``.
(Always use a trailing slash on your base URL!)

.. note:: If you don't set the ``baseURL`` correctly, in development mode,
the debug toolbar may not load properly and web pages may take considerably
longer to display.

#. If you intend to use a database, open the
**app/Config/Database.php** file with a text editor and set your
database settings. Alternately, these could be set in your **.env** file.
#. If it is not on the production server, set ``CI_ENVIRONMENT`` to ``development``
in **.env** file to take advantage of the debugging tools provided. See
:ref:`setting-development-mode` for the detail.

.. important:: In production environments, you should disable error display and
any other development-only functionality. In CodeIgniter, this can be done
by setting the environment to "production". By default, the application will
run using the "production" environment. See also :ref:`environment-constant`.
.. important:: In production environments, you should disable error display and
any other development-only functionality. In CodeIgniter, this can be done
by setting the environment to "production". By default, the application will
run using the "production" environment. See also :ref:`environment-constant`.

.. note:: If you will be running your site using a web server (e.g., Apache or Nginx),
you will need to modify the permissions for the ``writable`` folder inside
Expand Down