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:
parent
296e04022f
commit
73bcc3bfe3
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
use Luracast\Restler\Restler;
|
use Luracast\Restler\Restler;
|
||||||
use Luracast\Restler\RestException;
|
use Luracast\Restler\RestException;
|
||||||
|
use Luracast\Restler\Defaults;
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
||||||
|
|
||||||
@ -41,9 +42,15 @@ class DolibarrApi
|
|||||||
* Constructor
|
* 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;
|
global $conf;
|
||||||
|
|
||||||
|
if (empty($cachedir)) $cachedir = $conf->api->dir_temp;
|
||||||
|
Defaults::$cacheDirectory = $cachedir;
|
||||||
|
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$production_mode = ( empty($conf->global->API_PRODUCTION_MODE) ? false : true );
|
$production_mode = ( empty($conf->global->API_PRODUCTION_MODE) ? false : true );
|
||||||
$this->r = new Restler($production_mode);
|
$this->r = new Restler($production_mode);
|
||||||
|
|||||||
@ -57,7 +57,7 @@ class modApi extends DolibarrModules
|
|||||||
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
|
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
|
||||||
$this->description = "REST interface";
|
$this->description = "REST interface";
|
||||||
// Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version
|
// Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version
|
||||||
$this->version = 'development';
|
$this->version = 'dolibarr';
|
||||||
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
|
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
|
||||||
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
|
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
|
||||||
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
|
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
|
||||||
@ -72,7 +72,7 @@ class modApi extends DolibarrModules
|
|||||||
|
|
||||||
// Data directories to create when module is enabled.
|
// Data directories to create when module is enabled.
|
||||||
// Example: this->dirs = array("/api/temp");
|
// Example: this->dirs = array("/api/temp");
|
||||||
$this->dirs = array();
|
$this->dirs = array('/api/temp');
|
||||||
|
|
||||||
// Config pages. Put here list of php page, stored into api/admin directory, to use to setup module.
|
// Config pages. Put here list of php page, stored into api/admin directory, to use to setup module.
|
||||||
$this->config_page_url = array("index.php@api");
|
$this->config_page_url = array("index.php@api");
|
||||||
|
|||||||
@ -1596,7 +1596,7 @@ EndPointIs=SOAP clients must send their requests to the Dolibarr endpoint availa
|
|||||||
ApiSetup=API module setup
|
ApiSetup=API module setup
|
||||||
ApiDesc=By enabling this module, Dolibarr become a REST server to provide miscellaneous web services.
|
ApiDesc=By enabling this module, Dolibarr become a REST server to provide miscellaneous web services.
|
||||||
KeyForApiAccess=Key to use API (parameter "api_key")
|
KeyForApiAccess=Key to use API (parameter "api_key")
|
||||||
ApiProductionMode=Enable production mode
|
ApiProductionMode=Enable production mode (this will activate use of a caches for services management)
|
||||||
ApiEndPointIs=You can access to the API at url
|
ApiEndPointIs=You can access to the API at url
|
||||||
ApiExporerIs=You can explore the API at url
|
ApiExporerIs=You can explore the API at url
|
||||||
OnlyActiveElementsAreExposed=Only elements from enabled modules are exposed
|
OnlyActiveElementsAreExposed=Only elements from enabled modules are exposed
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user