Internal: Change how the bootstrap.inc.php file is included in endpoints (This completes commit ec095896)

This commit is contained in:
Molkobain
2019-08-13 17:38:51 +02:00
parent e3995a130f
commit 947e26d864
54 changed files with 820 additions and 1032 deletions

View File

@@ -16,8 +16,6 @@
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
*
*
*/
/**
@@ -26,14 +24,15 @@
*/
// Load current environment
if (file_exists(__DIR__.'/../../bootstrap.inc.php'))
if (file_exists(__DIR__.'/../../approot.inc.php'))
{
require_once __DIR__.'/../../bootstrap.inc.php'; // When in env-xxxx folder
require_once __DIR__.'/../../approot.inc.php'; // When in env-xxxx folder
}
else
{
require_once __DIR__.'/../../../bootstrap.inc.php'; // When in datamodels/x.x folder
require_once __DIR__.'/../../../approot.inc.php'; // When in datamodels/x.x folder
}
require_once APPROOT.'/bootstrap.inc.php';
require_once APPROOT.'application/startup.inc.php';
// Load frontal

View File

@@ -16,8 +16,6 @@
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
*
*
*/
// Disable PhpUnhandledExceptionInspection as the exception handling is made by the file including this one
@@ -32,14 +30,15 @@ require_once APPROOT.'/lib/autoload.php';
// Load current environment if necessary (typically from CLI as the app is not started yet)
if (!defined('MODULESROOT'))
{
if (file_exists(__DIR__.'/../../../../bootstrap.inc.php'))
if (file_exists(__DIR__.'/../../../../approot.inc.php'))
{
require_once __DIR__.'/../../../../bootstrap.inc.php'; // When in env-xxxx folder
require_once __DIR__.'/../../../../approot.inc.php'; // When in env-xxxx folder
}
else
{
require_once __DIR__.'/../../../../../bootstrap.inc.php'; // When in datamodels/x.x folder
require_once __DIR__.'/../../../../../approot.inc.php'; // When in datamodels/x.x folder
}
require_once APPROOT.'/bootstrap.inc.php';
require_once APPROOT.'/application/startup.inc.php';
}