explode when datadir is not configure, mkdir datadir if not existent

This commit is contained in:
<bdauvergne@entrouvert.com> 1206962159 +0200 0001-01-01 00:00:00 +00:00
parent fbf4835ae0
commit cf5c82d67f
1 changed files with 7 additions and 3 deletions

View File

@ -4,7 +4,11 @@
* in an unique directory with you application, you can just make it return "../data".
*/
function lassospkit_datadir() {
return '/var/lib/spkitlasso/' . $_SERVER['HTTP_HOST'];
//return "/home/bdauvergne/public_html/data";
// return $_SERVER['DOCUMENT_ROOT'] . '/data';
throw new Exception('You need to configure the datadir path');
// $path = '/var/lib/spkitlasso/' . $_SERVER['HTTP_HOST'];
// $path = "/home/bdauvergne/public_html/data";
// $path = $_SERVER['DOCUMENT_ROOT'] . '/data';
if (! file_exists($path)) {
@mkdir($path,755,1)
}
}