mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-11 18:32:32 +01:00
The temp dir for cache used by rester is correctly managed: No temp or
data files must be stored outside of documents directory.
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
|
||||
use Luracast\Restler\Restler;
|
||||
use Luracast\Restler\RestException;
|
||||
use Luracast\Restler\Defaults;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
||||
|
||||
@@ -40,10 +41,16 @@ class DolibarrApi
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDb $db Database handler
|
||||
* @param DoliDb $db Database handler
|
||||
* @param string $cachedir Cache dir
|
||||
*/
|
||||
function __construct($db) {
|
||||
function __construct($db, $cachedir='')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
if (empty($cachedir)) $cachedir = $conf->api->dir_temp;
|
||||
Defaults::$cacheDirectory = $cachedir;
|
||||
|
||||
$this->db = $db;
|
||||
$production_mode = ( empty($conf->global->API_PRODUCTION_MODE) ? false : true );
|
||||
$this->r = new Restler($production_mode);
|
||||
|
||||
Reference in New Issue
Block a user