Repository navigation
Expand file tree
/
Copy pathREADME.html
More file actions
57 lines (40 loc) · 2.07 KB
/
Copy pathREADME.html
File metadata and controls
57 lines (40 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<h1 id="orbisiusdotenv">orbisius-dot-env</h1>
<p>Orbisius Dot Env is a free php class that allows you to read .env project files.
It is just one file and doesn't have any dependencies.</p>
<p>If the file is not passed the class will try to look for .env starting from Document Root, then checking if WordPress' const ABSPATH is defined and try one level up.</p>
<p>The class is very efficient and doesn't currently use regular expressions at all.
When it parses the key names are automatically uppercases them.
It can define the values in environment, $<em>ENV, $</em>SERVER etc. and also define php constants if they haven't been defined just yet.</p>
<p>This class was created by <a href='https://orbisius.com/?utm_source=orbisius-dot-env' title='WordPress Plugin Development, SaaS App Development'>https://orbisius.com</a></p>
<h2 id="usagenotes">Usage Notes</h2>
<p>Check the example.php file.</p>
<pre><code class="php language-php">$dot_env = Orbisius_Dot_Env::getInstance();
$data = $dot_env->read();
$dot_env->updateEnv($data);
$dot_env->defineConsts($data);
</code></pre>
<br/>
... or<br/>
<pre><code class="php language-php">$dot_env = Orbisius_Dot_Env::getInstance();
$dot_env->run();
</code></pre>
<h3 id="envexample">.env Example</h3>
<p>You can comment your <code>.env</code> file using the <code>#</code> character. E.g.</p>
<pre><code class="shell language-shell"># This is a comment
ENV=dev
db_name = orbisius_db
db_user = orbisius_user
db_pass = orbisius_pass # you can have a comment here too
# Leave some lines blank
api_url = https://my-cool-saas-app.orbisius.com
author_url = https://orbisius.com
author_product_1_url = https://qsandbox.com
author_product_2_url = https://wpsandbox.net
author_product_3_url = https://wpdemo.net
author_product_3_url = https://go359.com
</code></pre>
<h2 id="customizationssupport">Customizations / Support</h2>
<p>We do offer paid support & customizations.
Contact us at <a href='https://orbisius.com/contact?utm_source=orbisius-dot-env'>https://orbisius.com/contact</a> for more info.</p>
<h2 id="license">License</h2>
<p>MIT</p>