batchInstall() public method

All required parameters must be passed in as an associative array. See $requiredParams for a list of them. This creates the necessary files, loads the database, configures the site settings, and creates the admin account. If it fails, an exception is thrown. It does not check any of the requirements as the multiple step web installer does. If the settings.php file exists, it will use that rather than the parameters passed to this function.
public batchInstall ( array $params, boolean $createHtaccess = FALSE ) : void
$params array Array of key value pairs
$createHtaccess boolean Should .htaccess be created
return void
コード例 #1
0
ファイル: sample_installer.php プロジェクト: redvabel/Vabelgg
<?php

/**
 * Sample cli installer script
 */
require_once dirname(dirname(__FILE__)) . "/ElggInstaller.php";
$installer = new ElggInstaller();
$params = array('dbuser' => '', 'dbpassword' => '', 'dbname' => '', 'sitename' => '', 'wwwroot' => '', 'dataroot' => '', 'displayname' => '', 'email' => '', 'username' => '', 'password' => '');
// install and create the .htaccess file
$installer->batchInstall($params, TRUE);
コード例 #2
0
/**
 * Docker CLI Elgg installer script 
 */
$autoload_path = '/var/www/html/vendor/autoload.php';
$autoload_available = (include_once $autoload_path);
if (!$autoload_available) {
    die("Couldn't include '{$autoload_path}'. Did you run `composer install`?");
}
$params = array('dbuser' => getenv('ELGG_DB_USER'), 'dbpassword' => getenv('ELGG_DB_PASS'), 'dbname' => getenv('ELGG_DB_NAME'), 'dbhost' => getenv('ELGG_DB_HOST'), 'dbprefix' => getenv('ELGG_DB_PREFIX'), 'sitename' => getenv('ELGG_SITE_NAME'), 'siteemail' => getenv('ELGG_SITE_EMAIL'), 'wwwroot' => getenv('ELGG_WWW_ROOT'), 'dataroot' => getenv('ELGG_DATA_ROOT'), 'displayname' => getenv('ELGG_DISPLAY_NAME'), 'email' => getenv('ELGG_EMAIL'), 'username' => getenv('ELGG_USERNAME'), 'password' => getenv('ELGG_PASSWORD'), 'path' => getenv('ELGG_PATH'));
if (strlen($params['password']) < 6) {
    echo "Elgg Admin password ({$params['password']}) must be at least 6 characters long.\n";
    exit(1);
}
$createHtaccess = file_exists($params['path'] . '.htaccess') ? false : true;
$installer = new ElggInstaller();
$installer->batchInstall($params, $createHtaccess);
/**
 * Elgg create symbolic links on instalation with composer 
 * See "post-install-cmd": "\\Elgg\\Composer\\PostInstall::execute", for details.
 * Links are created on your local machine.
 * The links need to be changed to the container directories
 */
$path_mod_root = getenv('ELGG_PATH') . 'mod/';
$mods = scandir($path_mod_root);
foreach ($mods as $key => $folder) {
    if (is_link($path_mod_root . $folder)) {
        unlink($path_mod_root . $folder);
    }
}
$path_mod_vendor = getenv('ELGG_PATH') . 'vendor/elgg/elgg/mod/';
$mods = scandir($path_mod_vendor);