@@ -27,39 +27,39 @@ discard block |
||
27 | 27 | */ |
28 | 28 | public static function loadEnv(string $dir): void |
29 | 29 | { |
30 | - require_once $dir . '/vendor/autoload.php'; |
|
30 | + require_once $dir.'/vendor/autoload.php'; |
|
31 | 31 | |
32 | 32 | if (!class_exists(Dotenv::class)) { |
33 | - fwrite(STDERR, 'ERROR: No se ha cargado la clase Dotenv' . PHP_EOL); |
|
33 | + fwrite(STDERR, 'ERROR: No se ha cargado la clase Dotenv'.PHP_EOL); |
|
34 | 34 | exit(1); |
35 | 35 | } |
36 | 36 | |
37 | 37 | try { |
38 | 38 | // Load environment variables from .env file |
39 | - if (file_exists($dir . '/.env')) { |
|
39 | + if (file_exists($dir.'/.env')) { |
|
40 | 40 | $dotenv = Dotenv::createMutable($dir, '.env'); |
41 | 41 | $dotenv->load(); |
42 | 42 | } else { |
43 | - fwrite(STDERR, 'ERROR: no existe el fichero .env' . PHP_EOL); |
|
43 | + fwrite(STDERR, 'ERROR: no existe el fichero .env'.PHP_EOL); |
|
44 | 44 | exit(1); |
45 | 45 | } |
46 | 46 | |
47 | 47 | // Overload (if they exist) with .env.docker or .env.local |
48 | - if (isset($_SERVER['DOCKER']) && file_exists($dir . '/.env.docker')) { |
|
48 | + if (isset($_SERVER['DOCKER']) && file_exists($dir.'/.env.docker')) { |
|
49 | 49 | $dotenv = Dotenv::createMutable($dir, '.env.docker'); |
50 | 50 | $dotenv->load(); |
51 | - } elseif (file_exists($dir . '/.env.local')) { |
|
51 | + } elseif (file_exists($dir.'/.env.local')) { |
|
52 | 52 | $dotenv = Dotenv::createMutable($dir, '.env.local'); |
53 | 53 | $dotenv->load(); |
54 | 54 | } |
55 | 55 | |
56 | 56 | // Requiring Variables to be set |
57 | - $dotenv->required([ 'DATABASE_NAME', 'DATABASE_USER', 'DATABASE_PASSWD', 'SERVER_VERSION' ]); |
|
58 | - $dotenv->required([ 'ENTITY_DIR' ]); |
|
57 | + $dotenv->required(['DATABASE_NAME', 'DATABASE_USER', 'DATABASE_PASSWD', 'SERVER_VERSION']); |
|
58 | + $dotenv->required(['ENTITY_DIR']); |
|
59 | 59 | } catch (Throwable $e) { |
60 | 60 | fwrite( |
61 | 61 | STDERR, |
62 | - 'EXCEPCIÓN: ' . $e->getCode() . ' - ' . $e->getMessage() |
|
62 | + 'EXCEPCIÓN: '.$e->getCode().' - '.$e->getMessage() |
|
63 | 63 | ); |
64 | 64 | exit(1); |
65 | 65 | } |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | } catch (Throwable $e) { |
83 | 83 | fwrite( |
84 | 84 | STDERR, |
85 | - 'EXCEPCIÓN: ' . $e->getCode() . ' - ' . $e->getMessage() |
|
85 | + 'EXCEPCIÓN: '.$e->getCode().' - '.$e->getMessage() |
|
86 | 86 | ); |
87 | 87 | exit(1); |
88 | 88 | } |