added okapi update script
This commit is contained in:
@@ -8,6 +8,10 @@
|
|||||||
/*
|
/*
|
||||||
* Database Structure Versioning - update DB structure to current version;
|
* Database Structure Versioning - update DB structure to current version;
|
||||||
* used for developer & production system
|
* 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']))
|
if (!isset($opt['rootpath']))
|
||||||
|
@@ -14,19 +14,22 @@
|
|||||||
chdir($rootpath);
|
chdir($rootpath);
|
||||||
require_once('lib2/cli.inc.php');
|
require_once('lib2/cli.inc.php');
|
||||||
|
|
||||||
echo "updating db structure ...\n";
|
echo "updating db structure\n";
|
||||||
require('dbsv-update.php');
|
require('dbsv-update.php');
|
||||||
|
|
||||||
echo "importing data.sql ...\n";
|
echo "importing data.sql\n";
|
||||||
system('cat ' . $rootpath . 'doc/sql/static-data/data.sql |' .
|
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']);
|
' 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');
|
chdir ($rootpath . 'doc/sql/stored-proc');
|
||||||
system('php maintain.php');
|
system('php maintain.php');
|
||||||
|
|
||||||
echo "resettings webcache ...\n";
|
echo "updating OKAPI database\n";
|
||||||
chdir ($rootpath . '../bin');
|
chdir ($rootpath . '../bin');
|
||||||
|
system('php okapi-update.php | grep -i -e mutation');
|
||||||
|
|
||||||
|
echo "resetting webcache:\n";
|
||||||
system('php clear-webcache.php');
|
system('php clear-webcache.php');
|
||||||
|
|
||||||
?>
|
?>
|
27
bin/okapi-update.php
Normal file
27
bin/okapi-update.php
Normal 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();
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
Reference in New Issue
Block a user