added okapi update script

This commit is contained in:
following
2013-05-08 16:11:27 +02:00
parent 2b66c4178b
commit 0c5261f5e8
3 changed files with 38 additions and 4 deletions

View File

@@ -8,6 +8,10 @@
/*
* Database Structure Versioning - update DB structure to current version;
* used for developer & production system
*
* You should normally NOT call this script directly, but via dbupdate.php
* (or something similar on a production system). This ensures that
* everything takes place in the right order.
*/
if (!isset($opt['rootpath']))

View File

@@ -14,19 +14,22 @@
chdir($rootpath);
require_once('lib2/cli.inc.php');
echo "updating db structure ...\n";
echo "updating db structure\n";
require('dbsv-update.php');
echo "importing data.sql ...\n";
echo "importing data.sql\n";
system('cat ' . $rootpath . 'doc/sql/static-data/data.sql |' .
' mysql -h' . $opt['db']['servername'] . ' -u' . $opt['db']['username'] . ' --password=' . $opt['db']['password'] . ' ' . $opt['db']['placeholder']['db']);
echo "importing triggers ...\n";
echo "importing triggers\n";
chdir ($rootpath . 'doc/sql/stored-proc');
system('php maintain.php');
echo "resettings webcache ...\n";
echo "updating OKAPI database\n";
chdir ($rootpath . '../bin');
system('php okapi-update.php | grep -i -e mutation');
echo "resetting webcache:\n";
system('php clear-webcache.php');
?>

27
bin/okapi-update.php Normal file
View File

@@ -0,0 +1,27 @@
<?php
/***************************************************************************
* For license information see doc/license.txt
*
* Unicode Reminder メモ
***************************************************************************/
/*
* run okapi database update
* needs 'short_open_tag = Off' in php.ini
*
* You should normally NOT call this script directly, but via dbupdate.php
* (or something similar on a production system). This ensures that
* everything takes place in the right order.
*/
okapi_update();
function okapi_update()
{
$GLOBALS['rootpath'] = dirname(__FILE__) . '/../htdocs/';
require_once($GLOBALS['rootpath']."okapi/facade.php");
okapi\Facade::database_update();
}
?>