website/public/docs/v3.1.5/Reference/Env.php

55 lines
No EOL
3.3 KiB
PHP

<?= VV::include("public/docs/v3.1.5/Reference/layout") ?>
<main>
<section>
<h1>Environment variables</h1>
<p>Vegvisir has a few environment variables that can be modified to change its behavior.</p>
<p>Copy <code>.env.example.ini</code> to <code>.env.ini</code> and edit the copied file to get started.</p>
</section>
<hr>
<section>
<h1>Reference</h1>
</section>
<section class="md param">
<h3><code class="mtk6">string</code></h3>
<h2><code class="mtk10">root_path</code></h2>
<p>An <strong>absolute</strong> path to the folder where your project is located.</p>
</section>
<section class="md param">
<h3><code class="mtk6">string</code></h3>
<h2><code class="mtk10">shell_page</code></h2>
<p>A path relative from your <code class="mtk10">root_path</code> to a PHP file that contains a <a href="/docs/v3.1.5/Reference/Env#vv-shell"><code>vv-shell</code></a> element, and will be loaded as the shell of your page.</p>
</section>
<section class="md param">
<h3><code class="mtk6">string</code></h3>
<h2><code class="mtk10">public_path</code></h2>
<p>A path relative from your <code class="mtk10">root_path</code> to a folder containing public PHP pages and other public static assets.</p>
<p>The default for this variable is "public/".</p>
</section>
<section class="md param">
<h3><code class="mtk6">string</code> | <code class="mtk6">null</code></h3>
<h2><code class="mtk10">error_page_path</code></h2>
<p>An optional path relative from your <code class="mtk10">root_path</code> to a PHP file that will be loaded when a page can not be found.</p>
<p>Commenting-out this variable or setting it to null will disable error pages. An empty respone body will be returned.</p>
</section>
<section class="md param">
<h3><code class="mtk6">string</code></h3>
<h2><code class="mtk10">worker_magic_pathname</code></h2>
<p>Vegvisir navigation worker code will be returned when request pathname matches this string</p>
<p>This variable can be left as-is for most applications.</p>
</section>
<section class="md param">
<h3><code class="mtk6">string</code> | <code class="mtk6">null</code></h3>
<h2><code class="mtk10">rfc_4288_url</code></h2>
<p>URL to an RFC 4288 compatible MIME-type file which will be cached (until server reboot) and referenced for serving static assets.</p>
<p>The default for this variable is <a href="https://raw.githubusercontent.com/apache/httpd/refs/heads/trunk/docs/conf/mime.types">Apache's httpd MIME-reference</a>.</p>
<p>Commenting-out this variable or setting it to null will disable custom MIME-lists and default to PHP's <a href="https://www.php.net/manual/en/function.mime-content-type.php"><code>mime_content_type</code></a> parser.</p>
</section>
<section class="md param">
<h3><code class="mtk6">bool</code></h3>
<h2><code class="mtk10">display_php_source</code></h2>
<h3>Enabling this can lead to sensitive information being leaked from your back-end.</h3>
<p>When set to <code class="mtk6">true</code> appending <i>".php"</i> to the end of any page pathname will return the PHP source for that page in <code>text/plain</code>.</p>
<p>For example, <i>https://example.com/page.php</i> will let the visitor inspect the PHP code for that page.</p>
<p>Commenting-out this variable or setting it to null will default this setting to <code class="mtk6">false</code>.</p>
</section>
</main>