j'ai ajoute un message d'erreur pour le cas ou la base n'est pas ouverte en ecriture...
[bazdig.git] / ini.php
blobd1fb15462a6da8724de823a7a069c711059aa838
1 <?php
2 define('WARAQ_CLASSPATH', realpath(WARAQ_ROOT) . "/lib");
3 set_include_path(get_include_path() . PATH_SEPARATOR . WARAQ_CLASSPATH);
4 ini_set("session.save_path", realpath(WARAQ_ROOT));
6 require_once "waraqservice.php";
8 $url = "http://". $_SERVER['SERVER_NAME'] ."/". str_trunkate($_SERVER['REQUEST_URI'], '?');
9 $file = dirname($_SERVER['SCRIPT_FILENAME']);
11 $requestedService = new LocalResource($url, $file);
12 $bazdigService = $requestedService->get(WARAQ_ROOT . '/bazdig');
14 $GLOBALS['bazdig'] = new WaraqService($bazdigService->url, $bazdigService->file);
15 $bazdig =& $GLOBALS['bazdig'];
16 $bazdig->setparam("db", $bazdig->get('bazdig.db'));
18 function firstWord($string)
20 $string = trim($string);
21 return str_trunkate($string, ' ');
24 function str_trunkate($haystack, $needle)
26 if (!$pos = strpos($haystack, $needle)) return $haystack;
27 return substr($haystack, 0, $pos);