27 ini_set(
'memory_limit', -1);
28 error_reporting(E_ALL);
31 if ((php_sapi_name() ==
'cli')) {
32 if (isset($_SERVER[
'argv'][1])) {
33 $SYSTEM_ROOT = $_SERVER[
'argv'][1];
36 $err_msg =
"ERROR: You need to supply the path to the System Root as the first argument.\n";
39 if (isset($_GET[
'SYSTEM_ROOT'])) {
40 $SYSTEM_ROOT = $_GET[
'SYSTEM_ROOT'];
44 <div style="background-color: red; color: white; font-weight: bold;">
45 You need to supply the path to the System Root as a query string variable called SYSTEM_ROOT
50 if (empty($SYSTEM_ROOT)) {
51 $err_msg .=
"Usage: php install/step_01.php <PATH_TO_MATRIX>\n";
56 if (!is_dir($SYSTEM_ROOT) || !is_readable($SYSTEM_ROOT.
'/core/include/init.inc')) {
57 $err_msg =
"ERROR: Path provided doesn't point to a Matrix installation's System Root. Please provide correct path and try again.\n";
58 $err_msg .=
"Usage: php install/step_01.php <PATH_TO_MATRIX>\n";
63 define(
'SQ_SYSTEM_ROOT', $SYSTEM_ROOT);
64 define(
'SQ_INCLUDE_PATH', SQ_SYSTEM_ROOT.
'/core/include');
65 define(
'SQ_LIB_PATH', SQ_SYSTEM_ROOT.
'/core/lib');
66 define(
'SQ_DATA_PATH', SQ_SYSTEM_ROOT.
'/data');
67 define(
'SQ_FUDGE_PATH', SQ_SYSTEM_ROOT.
'/fudge');
68 define(
'SQ_PHP_CLI', (php_sapi_name() ==
'cli'));
70 require_once SQ_INCLUDE_PATH.
'/mysource_object.inc';
71 require_once SQ_INCLUDE_PATH.
'/system_config.inc';
74 define(
'SQ_CONF_PEAR_PATH', SQ_SYSTEM_ROOT.
'/php_includes');
77 $cfg->save(Array(), TRUE);
81 if (!file_exists(SQ_DATA_PATH.
'/private/conf/db.inc')) {
82 copy(dirname(__FILE__).
'/db-inc.sample', SQ_DATA_PATH.
'/private/conf/db.inc');
86 if (!file_exists(SQ_DATA_PATH.
'/private/conf/memcache.inc')) {
87 copy(dirname(__FILE__).
'/memcache-inc.sample', SQ_DATA_PATH.
'/private/conf/memcache.inc');
91 echo
'Remember to give your system\'s Apache user write access to'.
"\n";
92 echo
'the cache and data directories of your Matrix install...'.
"\n";