27 ini_set(
'memory_limit', -1);
30 if ((php_sapi_name() ==
'cli')) {
31 if (isset($_SERVER[
'argv'][1])) {
32 $SYSTEM_ROOT = $_SERVER[
'argv'][1];
35 $err_msg =
"ERROR: You need to supply the path to the System Root as the first argument\n";
38 if (isset($_GET[
'SYSTEM_ROOT'])) {
39 $SYSTEM_ROOT = $_GET[
'SYSTEM_ROOT'];
43 <div style="background-color: red; color: white; font-weight: bold;">
44 You need to supply the path to the System Root as a query string variable called SYSTEM_ROOT
49 if (empty($SYSTEM_ROOT)) {
50 $err_msg .=
"Usage: php install/step_02.php <PATH_TO_MATRIX>\n";
55 if (!is_dir($SYSTEM_ROOT) || !is_readable($SYSTEM_ROOT.
'/core/include/init.inc')) {
56 $err_msg =
"ERROR: Path provided doesn't point to a Matrix installation's System Root. Please provide correct path and try again.\n";
57 $err_msg .=
"Usage: php install/step_02.php <PATH_TO_MATRIX>\n";
62 if (!defined(
'SQ_SYSTEM_ROOT')) {
63 define(
'SQ_SYSTEM_ROOT', $SYSTEM_ROOT);
65 require_once $SYSTEM_ROOT.
'/core/include/init.inc';
66 require_once $SYSTEM_ROOT.
'/install/install.inc';
67 require_once SQ_FUDGE_PATH.
'/general/file_system.inc';
69 echo
'Generating install key...'.
"\n";
71 $GLOBALS[
'SQ_SYSTEM']->setRunLevel(SQ_RUN_LEVEL_FORCED);
72 $install_key = generate_install_key(TRUE);
73 $GLOBALS[
'SQ_SYSTEM']->restoreRunLevel();
75 if (is_null($install_key)) {
76 echo
'Could not generate an install key because the main.inc file was not found or is not accessible'.
"\n";
78 echo
'Your system\'s install key is [ '.$install_key.
' ]'.
"\n";