mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-25 10:51:34 +01:00
Merge
This commit is contained in:
@@ -57,7 +57,20 @@ class DolibarrApi
|
||||
Defaults::$cacheDirectory = $cachedir;
|
||||
|
||||
$this->db = $db;
|
||||
$production_mode = (!getDolGlobalString('API_PRODUCTION_MODE') ? false : true);
|
||||
|
||||
$production_mode = (getDolGlobalString('API_PRODUCTION_MODE') ? true : false);
|
||||
|
||||
if ($production_mode) {
|
||||
// Create the directory Defaults::$cacheDirectory if it does not exist. If dir does not exist, using production_mode generates an error 500.
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
if (!dol_is_dir(Defaults::$cacheDirectory)) {
|
||||
dol_mkdir(Defaults::$cacheDirectory, DOL_DATA_ROOT);
|
||||
}
|
||||
if (getDolGlobalString('MAIN_API_DEBUG')) {
|
||||
dol_syslog("Debug API construct::cacheDirectory=".Defaults::$cacheDirectory, LOG_DEBUG, 0, '_api');
|
||||
}
|
||||
}
|
||||
|
||||
$this->r = new Restler($production_mode, $refreshCache);
|
||||
|
||||
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
|
||||
|
||||
Reference in New Issue
Block a user