try okapi update only if okapi is installed

This commit is contained in:
following
2013-05-22 00:22:25 +02:00
parent c756af040c
commit bed5306c88
3 changed files with 81 additions and 65 deletions
+15 -3
View File
@@ -25,11 +25,23 @@
chdir ($rootpath . 'doc/sql/stored-proc');
system('php maintain.php');
echo "updating OKAPI database\n";
chdir ($rootpath . '../bin');
system('php okapi-update.php | grep -i -e mutation');
// We do *two* tests for OKAPI presence to get some robustness agains internal OKAPI changes.
// This should be replaced by a facade function call.
$okapi_vars = sql_table_exists('okapi_vars');
$okapi_syncbase = sql_field_exists('caches','okapi_syncbase');
if ($okapi_vars != $okapi_syncbase)
{
echo "!! unknown OKAPI configuration; either dbupdate.php needs an update or your database configuration is wrong\n";
}
else if ($okapi_vars)
{
echo "updating OKAPI database\n";
chdir ($rootpath . '../bin');
system('php okapi-update.php | grep -i -e mutation');
}
echo "resetting webcache:\n";
chdir ($rootpath . '../bin');
system('php clear-webcache.php');
?>