24 error_reporting(E_ALL);
25 if ((php_sapi_name() !=
'cli')) trigger_error(
"You can only run this script from the command line\n", E_USER_ERROR);
27 $SYSTEM_ROOT = (isset($_SERVER[
'argv'][1])) ? $_SERVER[
'argv'][1] :
'';
28 if (empty($SYSTEM_ROOT)) {
29 echo
"ERROR: You need to supply the path to the System Root as the first argument\n";
33 if (!is_dir($SYSTEM_ROOT) || !is_readable($SYSTEM_ROOT.
'/core/include/init.inc')) {
34 echo
"ERROR: Path provided doesn't point to a Matrix installation's System Root. Please provide correct path and try again.\n";
38 require_once $SYSTEM_ROOT.
'/core/include/init.inc';
39 require_once $SYSTEM_ROOT.
'/core/lib/db_install/db_install.inc';
40 require $SYSTEM_ROOT.
'/data/private/db/table_columns.inc';
42 $GLOBALS[
'SQ_SYSTEM']->changeDatabaseConnection(
'db2');
43 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'BEGIN');
45 install_rollback_triggers($tables,
true,
true);
47 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'COMMIT');
48 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();