forked from rfussien/dotenv-benchmark
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDotenvBench.php
39 lines (34 loc) · 907 Bytes
/
DotenvBench.php
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
<?php
class DotenvBench
{
public function benchJosegonzalez()
{
(new josegonzalez\Dotenv\Loader(__DIR__ . '/.env'))
->parse()
->toEnv(true)
->putenv(true)
->toServer(true);
}
public function benchVlucas()
{
if (class_exists('Dotenv\Dotenv')) {
if (method_exists('Dotenv\Dotenv', 'createImmutable')) {
(Dotenv\Dotenv::createImmutable(__DIR__))->load();
} else {
(new Dotenv\Dotenv(__DIR__))->load();
}
}
}
public function benchSymfony()
{
(new Symfony\Component\Dotenv\Dotenv())->load(__DIR__ . '/.env');
}
public function benchRfussien()
{
(new Rfussien\Dotenv\Loader(__DIR__))->load();
}
public function benchDevcoderxyz()
{
(new DevCoder\DotEnv(__DIR__.'/.env'))->load();
}
}