Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F11723222
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/composer.json b/composer.json
index 5d59493..9ab229e 100644
--- a/composer.json
+++ b/composer.json
@@ -1,34 +1,34 @@
{
"name": "nasqueron/saas-mediawiki",
"description": "SaaS configuration entry point for MediaWiki",
"keywords": [
"nasqueron",
"SAAS",
"mediawiki",
"farm"
],
"type": "project",
"license": "BSD-2-Clause",
"authors": [
{
"name": "Sébastien Santoro",
"email": "dereckson@espace-win.org"
}
],
"require": {
- "vlucas/phpdotenv": "dev-master",
+ "vlucas/phpdotenv": "^5.5.0",
"nasqueron/saas-service": "^0.0.1",
"keruald/commands": "^0.0.1"
},
"require-dev": {
"squizlabs/php_codesniffer": "3.*",
"nasqueron/codestyle": "^0.0.1"
},
"autoload": {
"psr-4": {
"Nasqueron\\SAAS\\MediaWiki\\": "src/",
"Nasqueron\\SAAS\\MediaWiki\\Configuration\\": "config/",
"Nasqueron\\SAAS\\MediaWiki\\Tests\\": "tests/"
}
}
}
diff --git a/src/Environment.php b/src/Environment.php
index 0ebe73c..de95174 100644
--- a/src/Environment.php
+++ b/src/Environment.php
@@ -1,59 +1,59 @@
<?php
namespace Nasqueron\SAAS\MediaWiki;
use Dotenv\Dotenv;
use Dotenv\Exception\ValidationException;
class Environment {
/**
* @var bool
*/
static private $isLoaded = false;
/**
* Loads the environment, if it hasn't been loaded before.
*/
public static function load () : void {
if (!self::$isLoaded) {
$directory = self::getDirectory();
- $dotenv = new Dotenv($directory);
+ $dotenv = Dotenv::createImmutable($directory);
$dotenv->safeLoad();
try {
$dotenv->required(self::getRequiredVariables());
} catch (ValidationException $exception) {
Service::serveInternalErrorResponse($exception);
}
self::$isLoaded = true;
}
}
public static function isLoaded () : bool {
return self::$isLoaded;
}
public static function get ($variableName, $defaultValue = "") : string {
return $_ENV[$variableName] ?? $defaultValue;
}
private static function getDirectory () : string {
return dirname(__DIR__);
}
private static function getRequiredVariables () : array {
return [
'MEDIAWIKI_ENTRY_POINT',
'MEDIAWIKI_SECRET_KEY',
'DB_HOST',
'DB_USER',
'DB_PASS',
];
}
public static function isBSD () : bool {
static $system;
$system = php_uname("s");
return substr($system, -3) === "BSD" || $system === "DragonFly";
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Thu, Sep 18, 09:00 (11 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2990284
Default Alt Text
(2 KB)
Attached To
Mode
rSAASMW SaaS MediaWiki
Attached
Detach File
Event Timeline
Log In to Comment