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:
Laurent Destailleur
2015-11-22 17:39:13 +01:00
parent 296e04022f
commit 73bcc3bfe3
3 changed files with 12 additions and 5 deletions

View File

@@ -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);