made dbupdate.php independend from cwd

This commit is contained in:
following
2012-08-24 18:15:53 +02:00
parent 96861820ca
commit 038719fa3c

View File

@@ -12,18 +12,18 @@
* Tables must be updated manually, see htdocs/doc/sql/db-changes.txt
*/
require('htdocs/lib/settings.inc.php');
$rootpath = dirname(__FILE__) . '/..';
require($rootpath . '/htdocs/lib/settings.inc.php');
echo "importing data.sql ...\n";
chdir ('htdocs/doc/sql');
system('cat static-data/data.sql | mysql -u' . $dbusername . ' --password=' . $dbpasswd . ' ' . $dbname);
system('cat ' . $rootpath . '/htdocs/doc/sql/static-data/data.sql | mysql -u' . $dbusername . ' --password=' . $dbpasswd . ' ' . $dbname);
echo "importing triggers ...\n";
chdir('stored-proc');
chdir ($rootpath . '/htdocs/doc/sql/stored-proc');
system('php maintain.php');
echo "resettings webcache ...\n";
chdir('../../../../bin');
chdir ($rootpath . "/bin");
system('php clear-webcache.php');
?>