35 echo "To enable this script, change \$enabled to true.\n";
36 echo "You *must* disable this script after a successful installation.\n";
40 if (PHP_SAPI !==
'cli') {
41 echo "You must use the command line to run this script.";
45 require_once(dirname(dirname(__FILE__)) .
"/ElggInstaller.php");
54 if (is_writable(__FILE__)) {
55 $code = file_get_contents(__FILE__);
56 if (preg_match(
'~\\$enabled\\s*=\\s*(true|1)\\s*;~i',
$code)) {
58 $code = preg_replace(
'~\\$enabled\\s*=\\s*(true|1)\\s*;~i',
'$enabled = false;',
$code);
59 file_put_contents(__FILE__,
$code);
61 echo "\nNote: This script has been disabled for your safety.\n";
66 echo "\nWarning: You *must* disable this script by setting \$enabled = false;.\n";
67 echo "Leaving this script enabled could endanger your installation.\n";
$enabled
Sample cli installer script.
elgg echo
Translates a string.