10 print "WIFF_ROOT environment variable is not set!\n";
16 print "WIFF_CONTEXT_ROOT environment variable not set!\n";
20 set_include_path(get_include_path() . PATH_SEPARATOR .
$WIFF_CONTEXT_ROOT . PATH_SEPARATOR .
"$WIFF_ROOT/include");
22 require_once (
'WHAT/Lib.Common.php');
23 require_once (
'WHAT/Class.Log.php');
33 $me <'check'|'reconfigure'> <
'CORE_TMMPDIR'|
'FREEDOM_UPLOADDIR'>
43 $me = array_shift($argv);
44 if (count($argv) != 2) {
48 $cmd = array_shift($argv);
49 $paramName = array_shift($argv);
72 $log->warning(sprintf(
"Parameter '%s' references a directory outside the context's root: '%s'.",
$WIFF_CONTEXT_ROOT, $paramName, $paramValue));
84 $log->warning(sprintf(
"Restoring default value for parameter '%s'.", $paramName));
85 $err =
simpleQuery(
'', sprintf(
'UPDATE paramv SET val = %s WHERE name = %s', pg_escape_literal(
'./var/tmp') , pg_escape_literal($paramName)));
87 $msg = sprintf(
"Error setting '%s' to '%s': %s", $paramName,
'./var/tmp',
$err);
97 $realPath = realpath($contextRoot);
98 if ($realPath ===
false) {
99 printf(
"Error: could not get realpath from context root '%s'!\n", $contextRoot);
102 $contextRoot = $realPath;
103 if (!file_exists(
$path)) {
104 printf(
"Warning: path '%s' does not exists!\n",
$path);
107 $realPath = realpath(
$path);
108 if ($realPath ===
false) {
109 printf(
"Error: could not get realpath from path '%s'!\n",
$path);
113 return (strpos(
$path, $contextRoot) === 0);
foreach($argv as $arg) $cmd
simpleQuery($dbaccess, $query, &$result=array(), $singlecolumn=false, $singleresult=false, $useStrict=null)
if($file) if($subject==""&&$file) if($subject=="") $err
getCoreParam($name, $def="")
must be in core or global type