Skip to content

Commit a76d2a7

Browse files
committed
Update User Guide
1 parent 0c5090a commit a76d2a7

5 files changed

Lines changed: 29 additions & 20 deletions

File tree

general/managing_apps.html

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ <h1>Managing your Applications<a class="headerlink" href="#managing-your-applica
308308
<p>If you would like to rename your application directory or even move
309309
it to a different location on your server, other than your project root, open
310310
your main <strong>app/Config/Paths.php</strong> and set a <em>full server path</em> in the
311-
<code class="docutils literal notranslate"><span class="pre">$appDirectory</span></code> variable (at about line 44):</p>
311+
<code class="docutils literal notranslate"><span class="pre">$appDirectory</span></code> variable (at about line 45):</p>
312312
<div class="highlight-html+php notranslate"><div class="highlight"><pre><span></span><span class="o">&lt;?</span><span class="nx">php</span>
313313

314314
<span class="k">namespace</span> <span class="nx">Config</span><span class="p">;</span>
@@ -317,7 +317,7 @@ <h1>Managing your Applications<a class="headerlink" href="#managing-your-applica
317317
<span class="p">{</span>
318318
<span class="c1">// ...</span>
319319

320-
<span class="k">public</span> <span class="nv">$appDirectory</span> <span class="o">=</span> <span class="s1">&#39;/path/to/your/app&#39;</span><span class="p">;</span>
320+
<span class="k">public</span> <span class="nx">string</span> <span class="nv">$appDirectory</span> <span class="o">=</span> <span class="s1">&#39;/path/to/your/app&#39;</span><span class="p">;</span>
321321

322322
<span class="c1">// ...</span>
323323
<span class="p">}</span>
@@ -345,23 +345,23 @@ <h1>Managing your Applications<a class="headerlink" href="#managing-your-applica
345345
<p>If you would like to share a common CodeIgniter framework installation, to manage
346346
several different applications, simply put all of the directories located
347347
inside your application directory into their own (sub)-directory.</p>
348-
<p>For example, let’s say you want to create two applications, named <strong>foo</strong>
349-
and <strong>bar</strong>. You could structure your application project directories like this:</p>
350-
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>foo/
348+
<p>For example, let’s say you want to create two applications, named <strong>blog</strong>
349+
and <strong>shop</strong>. You could structure your application project directories like this:</p>
350+
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>blog/
351351
app/
352352
public/
353353
tests/
354354
writable/
355355
env
356-
phpunit.xml.dist
356+
phpunit.dist.xml
357357
spark
358-
bar/
358+
shop/
359359
app/
360360
public/
361361
tests/
362362
writable/
363363
env
364-
phpunit.xml.dist
364+
phpunit.dist.xml
365365
spark
366366
vendor/
367367
autoload.php
@@ -373,13 +373,13 @@ <h1>Managing your Applications<a class="headerlink" href="#managing-your-applica
373373
<div class="admonition note">
374374
<p class="admonition-title">Note</p>
375375
<p>If you install CodeIgniter from the Zip file, the directory structure would be following:</p>
376-
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>foo/
377-
bar/
376+
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>blog/
377+
shop/
378378
codeigniter4/system/
379379
</pre></div>
380380
</div>
381381
</div>
382-
<p>This would have two apps, <strong>foo</strong> and <strong>bar</strong>, both having standard application directories
382+
<p>This would have two apps, <strong>blog</strong> and <strong>shop</strong>, both having standard application directories
383383
and a <strong>public</strong> folder, and sharing a common <strong>codeigniter4/framework</strong>.</p>
384384
<p>The <code class="docutils literal notranslate"><span class="pre">$systemDirectory</span></code> variable in <strong>app/Config/Paths.php</strong> inside each
385385
of those would be set to refer to the shared common <strong>codeigniter4/framework</strong> folder:</p>
@@ -397,17 +397,18 @@ <h1>Managing your Applications<a class="headerlink" href="#managing-your-applica
397397
<span class="p">}</span>
398398
</pre></div>
399399
</div>
400-
<div class="admonition note">
401-
<p class="admonition-title">Note</p>
402-
<p>If you install CodeIgniter from the Zip file, the <code class="docutils literal notranslate"><span class="pre">$systemDirectory</span></code> would be <code class="docutils literal notranslate"><span class="pre">__DIR__</span> <span class="pre">.</span> <span class="pre">'/../../../codeigniter4/system'</span></code>.</p>
403-
</div>
404400
<p>And modify the <code class="docutils literal notranslate"><span class="pre">COMPOSER_PATH</span></code> constant in <strong>app/Config/Constants.php</strong> inside each
405401
of those:</p>
406402
<div class="highlight-html+php notranslate"><div class="highlight"><pre><span></span><span class="o">&lt;?</span><span class="nx">php</span>
407403

408404
<span class="nb">defined</span><span class="p">(</span><span class="s1">&#39;COMPOSER_PATH&#39;</span><span class="p">)</span> <span class="o">||</span> <span class="nb">define</span><span class="p">(</span><span class="s1">&#39;COMPOSER_PATH&#39;</span><span class="p">,</span> <span class="nx">ROOTPATH</span> <span class="o">.</span> <span class="s1">&#39;../vendor/autoload.php&#39;</span><span class="p">);</span>
409405
</pre></div>
410406
</div>
407+
<div class="admonition note">
408+
<p class="admonition-title">Note</p>
409+
<p>If you install CodeIgniter from the Zip file, the <code class="docutils literal notranslate"><span class="pre">$systemDirectory</span></code> would be <code class="docutils literal notranslate"><span class="pre">__DIR__</span> <span class="pre">.</span> <span class="pre">'/../../../codeigniter4/system'</span></code>.
410+
If you don’t use Composer, you don’t have to edit the <code class="docutils literal notranslate"><span class="pre">COMPOSER_PATH</span></code>.</p>
411+
</div>
411412
<p>Only when you change the Application Directory, see <a class="reference internal" href="#renaming-app-directory"><span class="std std-ref">Renaming or Relocating the Application Directory</span></a> and modify the paths in the <strong>index.php</strong> and <strong>spark</strong>.</p>
412413
</section>
413414
<section id="changing-the-location-of-the-env-file">

installation/installing_composer.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -460,10 +460,13 @@ <h3><a class="toc-backref" href="#id15" role="doc-backlink">Structure</a><a clas
460460
<span id="switch-to-dev-version"></span><h3><a class="toc-backref" href="#id16" role="doc-backlink">Latest Dev</a><a class="headerlink" href="#latest-dev" title="Link to this heading"></a></h3>
461461
<p>The App Starter repo comes with a <code class="docutils literal notranslate"><span class="pre">builds</span></code> scripts to switch Composer sources between the
462462
current stable release and the latest development branch of the framework. Use this script
463-
for a developer who is willing to live with the latest unreleased changes, which may be unstable.</p>
463+
for a developer who is willing to live with the latest unreleased changes, which may be unstable.
464+
This way you can help find bugs and improve new features.</p>
464465
<p>The <a class="reference external" href="https://codeigniter4.github.io/CodeIgniter4/">development user guide</a> is accessible online.
465466
Note that this differs from the released user guide, and will pertain to the
466467
develop branch explicitly.</p>
468+
<p>Before running the script, check <code class="docutils literal notranslate"><span class="pre">$files</span></code>, which is the list of files to be changed.
469+
This is useful if you have additional places in the code that mention the directory with the framework.</p>
467470
<div class="admonition note">
468471
<p class="admonition-title">Note</p>
469472
<p>You should not rely on the version of the framework in your project
@@ -531,7 +534,7 @@ <h3><a class="toc-backref" href="#id19" role="doc-backlink">Setting Up</a><a cla
531534
<blockquote>
532535
<div><ol class="arabic simple">
533536
<li><p>Copy the <strong>app</strong>, <strong>public</strong>, <strong>tests</strong> and <strong>writable</strong> folders from <strong>vendor/codeigniter4/framework</strong> to your project root</p></li>
534-
<li><p>Copy the <strong>env</strong>, <strong>phpunit.xml.dist</strong> and <strong>spark</strong> files, from <strong>vendor/codeigniter4/framework</strong> to your project root</p></li>
537+
<li><p>Copy the <strong>env</strong>, <strong>phpunit.dist.xml</strong> and <strong>spark</strong> files, from <strong>vendor/codeigniter4/framework</strong> to your project root</p></li>
535538
<li><p>You will have to adjust the <code class="docutils literal notranslate"><span class="pre">$systemDirectory</span></code> property in <strong>app/Config/Paths.php</strong> to refer to the vendor one, e.g., <code class="docutils literal notranslate"><span class="pre">__DIR__</span> <span class="pre">.</span> <span class="pre">'/../../vendor/codeigniter4/framework/system'</span></code>.</p></li>
536539
</ol>
537540
</div></blockquote>
@@ -595,7 +598,8 @@ <h2><a class="toc-backref" href="#id25" role="doc-backlink">Translations Install
595598
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">composer require codeigniter4/translations</span>
596599
</pre></div>
597600
</div>
598-
<p>These will be updated along with the framework whenever you do a <code class="docutils literal notranslate"><span class="pre">composer</span> <span class="pre">update</span></code>.</p>
601+
<p>Copy the <strong>vendor/codeigniter4/translations/Language</strong> folder contents in it to your <strong>app/Language</strong> folder.
602+
These will be updated along with the framework whenever you do a <code class="docutils literal notranslate"><span class="pre">composer</span> <span class="pre">update</span></code>.</p>
599603
</section>
600604
</section>
601605

installation/worker_mode.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,10 @@ <h3><a class="toc-backref" href="#id5" role="doc-backlink">Installation</a><a cl
432432
<li><p>Configure your worker settings in <strong>app/Config/WorkerMode.php</strong> if needed.
433433
The defaults are recommended for most applications.</p></li>
434434
</ol>
435+
<div class="admonition note">
436+
<p class="admonition-title">Note</p>
437+
<p>When changing the project directory, see the section <a class="reference internal" href="../general/managing_apps.html#renaming-app-directory"><span class="std std-ref">Renaming or Relocating the Application Directory</span></a> and update your <strong>public/frankenphp-worker.php</strong>.</p>
438+
</div>
435439
</section>
436440
<section id="running-the-worker">
437441
<h3><a class="toc-backref" href="#id6" role="doc-backlink">Running the Worker</a><a class="headerlink" href="#running-the-worker" title="Link to this heading"></a></h3>

searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

testing/overview.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ <h4><a class="toc-backref" href="#id4" role="doc-backlink">Phar</a><a class="hea
367367
<h2><a class="toc-backref" href="#id5" role="doc-backlink">Testing Your Application</a><a class="headerlink" href="#testing-your-application" title="Link to this heading"></a></h2>
368368
<section id="phpunit-configuration">
369369
<h3><a class="toc-backref" href="#id6" role="doc-backlink">PHPUnit Configuration</a><a class="headerlink" href="#phpunit-configuration" title="Link to this heading"></a></h3>
370-
<p>In your CodeIgniter project root, there is the <code class="docutils literal notranslate"><span class="pre">phpunit.xml.dist</span></code> file. This
370+
<p>In your CodeIgniter project root, there is the <code class="docutils literal notranslate"><span class="pre">phpunit.dist.xml</span></code> file. This
371371
controls unit testing of your application. If you provide your own <code class="docutils literal notranslate"><span class="pre">phpunit.xml</span></code>,
372372
it will over-ride this.</p>
373373
<p>By default, test files are placed under the <strong>tests</strong> directory in the project root.</p>

0 commit comments

Comments
 (0)