22 include_once (
'WHAT/Lib.Prefix.php');
27 while ((
$file = readdir($dh)) !==
false) {
37 include_once (
'WHAT/Lib.Prefix.php');
44 include_once (
'WHAT/Lib.Prefix.php');
45 if (file_exists(
DEFAULT_PUBDIR .
"/context/" . $freedomctx .
"/dbaccess.php"))
return true;
51 include_once (
'WHAT/Lib.Prefix.php');
53 if (file_exists($vdir .
"/dbaccess.php")) $env = $vdir .
"/dbaccess.php";
54 else $env = $vdir .
"/dbaccess.php";
60 error_log(
"Deprecated call to getShEnv()");
63 include_once (
'WHAT/Lib.Prefix.php');
65 if (file_exists($vdir .
"/dbaccess.sh")) $env = $vdir .
"/dbaccess.sh";
66 else $env = $vdir .
"/dbaccess.sh";
72 error_log(
"Deprecated call to setCurrentDb() in " . __FILE__ .
" : use setCurrentContext(ctxName)");
78 include_once (
'WHAT/Lib.Prefix.php');
80 fprintf($fcur, $freedomctx);
83 system(sprintf(
"ln -sf %s/dbaccess.sh %s/.freedom.sh", escapeshellarg($dpath) , escapeshellarg(
DEFAULT_PUBDIR)));
88 error_log(
"Deprecated call to getCurrentDb in " . __FILE___ .
" : use getCurrentContext()");
100 include_once (
'WHAT/Lib.Prefix.php');
106 $dbfphp =
"$vdir/dbaccess.php";
107 $dbfsh =
"$vdir/dbaccess.sh";
109 if (!is_dir($vdir)) mkdir($vdir, 0755,
true);
111 if (file_exists($dbf))
return false;
113 $httpu = getenv(
"httpuser");
114 $httpconf = getenv(
"httpconf");
116 $sed_1 = sprintf(
's/@PGSERVICE_CORE@/%s/g', str_replace(
'/',
'\/',
$pgservice_core));
117 $sed_2 = sprintf(
's/@PGSERVICE_FREEDOM@/%s/g', str_replace(
'/',
'\/',
$pgservice_freedom));
118 $sed_3 = sprintf(
's/@FREEDOM_CONTEXT@/%s/g', str_replace(
'/',
'\/', $freedomctx));
120 $command = sprintf(
"sed -e %s -e %s -e %s", escapeshellarg($sed_1) , escapeshellarg($sed_2) , escapeshellarg($sed_3));
122 system(sprintf(
"cat %s | $command > %s", escapeshellarg($inphpfile) , escapeshellarg($dbfphp)));
123 system(sprintf(
"cat %s | $command > %s", escapeshellarg($inshfile) , escapeshellarg($dbfsh)));