Skip to content

Commit 3573f5d

Browse files
authored
docs: Improve guide (#10109)
* docs: Update "Managing your Applications" * docs: Update "Composer Installation" * docs: Update "Worker Mode" * docs: Update "Testing" * fix: Move next line
1 parent 554be61 commit 3573f5d

File tree

5 files changed

+23
-15
lines changed

5 files changed

+23
-15
lines changed

user_guide_src/source/general/managing_apps.rst

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Renaming or Relocating the Application Directory
2020
If you would like to rename your application directory or even move
2121
it to a different location on your server, other than your project root, open
2222
your main **app/Config/Paths.php** and set a *full server path* in the
23-
``$appDirectory`` variable (at about line 44):
23+
``$appDirectory`` variable (at about line 45):
2424

2525
.. literalinclude:: managing_apps/001.php
2626

@@ -46,26 +46,26 @@ If you would like to share a common CodeIgniter framework installation, to manag
4646
several different applications, simply put all of the directories located
4747
inside your application directory into their own (sub)-directory.
4848

49-
For example, let's say you want to create two applications, named **foo**
50-
and **bar**. You could structure your application project directories like this:
49+
For example, let's say you want to create two applications, named **blog**
50+
and **shop**. You could structure your application project directories like this:
5151

5252
.. code-block:: text
5353
54-
foo/
54+
blog/
5555
app/
5656
public/
5757
tests/
5858
writable/
5959
env
60-
phpunit.xml.dist
60+
phpunit.dist.xml
6161
spark
62-
bar/
62+
shop/
6363
app/
6464
public/
6565
tests/
6666
writable/
6767
env
68-
phpunit.xml.dist
68+
phpunit.dist.xml
6969
spark
7070
vendor/
7171
autoload.php
@@ -77,25 +77,26 @@ and **bar**. You could structure your application project directories like this:
7777

7878
.. code-block:: text
7979
80-
foo/
81-
bar/
80+
blog/
81+
shop/
8282
codeigniter4/system/
8383
84-
This would have two apps, **foo** and **bar**, both having standard application directories
84+
This would have two apps, **blog** and **shop**, both having standard application directories
8585
and a **public** folder, and sharing a common **codeigniter4/framework**.
8686

8787
The ``$systemDirectory`` variable in **app/Config/Paths.php** inside each
8888
of those would be set to refer to the shared common **codeigniter4/framework** folder:
8989

9090
.. literalinclude:: managing_apps/005.php
9191

92-
.. note:: If you install CodeIgniter from the Zip file, the ``$systemDirectory`` would be ``__DIR__ . '/../../../codeigniter4/system'``.
93-
9492
And modify the ``COMPOSER_PATH`` constant in **app/Config/Constants.php** inside each
9593
of those:
9694

9795
.. literalinclude:: managing_apps/004.php
9896

97+
.. note:: If you install CodeIgniter from the Zip file, the ``$systemDirectory`` would be ``__DIR__ . '/../../../codeigniter4/system'``.
98+
If you don't use Composer, you don't have to edit the ``COMPOSER_PATH``.
99+
99100
Only when you change the Application Directory, see :ref:`renaming-app-directory` and modify the paths in the **index.php** and **spark**.
100101

101102
Changing the Location of the .env File

user_guide_src/source/general/managing_apps/001.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class Paths
66
{
77
// ...
88

9-
public $appDirectory = '/path/to/your/app';
9+
public string $appDirectory = '/path/to/your/app';
1010

1111
// ...
1212
}

user_guide_src/source/installation/installing_composer.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,15 @@ Latest Dev
166166
The App Starter repo comes with a ``builds`` scripts to switch Composer sources between the
167167
current stable release and the latest development branch of the framework. Use this script
168168
for a developer who is willing to live with the latest unreleased changes, which may be unstable.
169+
This way you can help find bugs and improve new features.
169170

170171
The `development user guide <https://codeigniter4.github.io/CodeIgniter4/>`_ is accessible online.
171172
Note that this differs from the released user guide, and will pertain to the
172173
develop branch explicitly.
173174

175+
Before running the script, check ``$files``, which is the list of files to be changed.
176+
This is useful if you have additional places in the code that mention the directory with the framework.
177+
174178
.. note:: You should not rely on the version of the framework in your project
175179
- the development code may contain an incorrect number.
176180

@@ -247,7 +251,7 @@ Setting Up
247251
----------
248252

249253
1. Copy the **app**, **public**, **tests** and **writable** folders from **vendor/codeigniter4/framework** to your project root
250-
2. Copy the **env**, **phpunit.xml.dist** and **spark** files, from **vendor/codeigniter4/framework** to your project root
254+
2. Copy the **env**, **phpunit.dist.xml** and **spark** files, from **vendor/codeigniter4/framework** to your project root
251255
3. You will have to adjust the ``$systemDirectory`` property in **app/Config/Paths.php** to refer to the vendor one, e.g., ``__DIR__ . '/../../vendor/codeigniter4/framework/system'``.
252256

253257
Initial Configuration
@@ -322,4 +326,5 @@ From the command line inside your project root:
322326
323327
composer require codeigniter4/translations
324328
329+
Copy the **vendor/codeigniter4/translations/Language** folder contents in it to your **app/Language** folder.
325330
These will be updated along with the framework whenever you do a ``composer update``.

user_guide_src/source/installation/worker_mode.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ Installation
110110
3. Configure your worker settings in **app/Config/WorkerMode.php** if needed.
111111
The defaults are recommended for most applications.
112112

113+
.. note:: When changing the project directory, see the section :ref:`renaming-app-directory` and update your **public/frankenphp-worker.php**.
114+
113115
Running the Worker
114116
==================
115117

user_guide_src/source/testing/overview.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Testing Your Application
6060
PHPUnit Configuration
6161
=====================
6262

63-
In your CodeIgniter project root, there is the ``phpunit.xml.dist`` file. This
63+
In your CodeIgniter project root, there is the ``phpunit.dist.xml`` file. This
6464
controls unit testing of your application. If you provide your own ``phpunit.xml``,
6565
it will over-ride this.
6666

0 commit comments

Comments
 (0)