-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathENV.php
More file actions
38 lines (28 loc) · 1.11 KB
/
ENV.php
File metadata and controls
38 lines (28 loc) · 1.11 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
<?php
define("debug",true);
$debugMask[]="ERROR";
// $debugMask[]="INFOS";
$debugMask[]="WARNS";
if (debug && in_array("INFOS",$debugMask)) {
print "ENV SETUP\r\n\r\n";
}
$env_ = json_decode(file_get_contents("env.json"), true);
define("appInfosPath","appInfos.json");
define("environnementPrefix",$env_["EnvOutputPrefix"]);
if (debug && in_array("INFOS",$debugMask)) {
print environnementPrefix."ENV Name: ".$env_["Name"]."\r\n";
print environnementPrefix."ENV Version: ".$env_["Version"]."\r\n";
print environnementPrefix."ENV Authors: "."\r\n";
print_r($env_["Authors"]);
print environnementPrefix."ENV PackageID: ".$env_["PackageID"]."\r\n";
print "\r\n\r\n";
}
$appInfos = json_decode(file_get_contents(appInfosPath));
$autoLoad = require('autoload.php');
if ($autoLoad) {
$application = require('application.php');
} else {
print "\033[0;31mFATAL ERROR: AUTOLOAD FAILED [0X2000]\r\nABORTING\r\n\033[m";
return 1;
}
print "program ended with output code $application\r\n";