12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <?php
- $enabled = false;
- $params = array(
-
- 'dbuser' => '',
- 'dbpassword' => '',
- 'dbname' => '',
-
- 'sitename' => '',
- 'siteemail' => '',
- 'wwwroot' => '',
- 'dataroot' => '',
-
- 'displayname' => '',
- 'email' => '',
- 'username' => '',
- 'password' => '',
- );
- if (!$enabled) {
- echo "To enable this script, change \$enabled to true.\n";
- echo "You *must* disable this script after a successful installation.\n";
- exit;
- }
- if (PHP_SAPI !== 'cli') {
- echo "You must use the command line to run this script.";
- exit;
- }
- $elggRoot = dirname(dirname(__DIR__));
- require_once "$elggRoot/vendor/autoload.php";
- $installer = new ElggInstaller();
- $installer->batchInstall($params, TRUE);
- if (is_writable(__FILE__)) {
- $code = file_get_contents(__FILE__);
- if (preg_match('~\\$enabled\\s*=\\s*(true|1)\\s*;~i', $code)) {
-
- $code = preg_replace('~\\$enabled\\s*=\\s*(true|1)\\s*;~i', '$enabled = false;', $code);
- file_put_contents(__FILE__, $code);
- echo "\nNote: This script has been disabled for your safety.\n";
- exit;
- }
- }
- echo "\nWarning: You *must* disable this script by setting \$enabled = false;.\n";
- echo "Leaving this script enabled could endanger your installation.\n";
|