Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
travis_installer.php
Go to the documentation of this file.
1 <?php
8 $enabled = getenv('TRAVIS') != ''; //are we on Travis?
9 
10 if (!$enabled) {
11  echo "This script should be run only in Travis CI test environment.\n";
12  exit(1);
13 }
14 
15 if (PHP_SAPI !== 'cli') {
16  echo "You must use the command line to run this script.\n";
17  exit(2);
18 }
19 
20 require_once __DIR__ . "/../../autoloader.php";
21 
23 
24 // none of the following may be empty
25 $params = array(
26  // database parameters
27  'dbuser' => 'root',
28  'dbpassword' => 'password',
29  'dbname' => 'elgg',
30 
31  // We use a wonky dbprefix to catch any cases where folks hardcode "elgg_"
32  // instead of using config->dbprefix
33  'dbprefix' => 't_i_elgg_',
34 
35  // site settings
36  'sitename' => 'Elgg Travis Site',
37  'siteemail' => 'no_reply@travis.elgg.org',
38  'wwwroot' => 'http://localhost:8888/',
39  'dataroot' => getenv('HOME') . '/elgg_data/',
40 
41  // admin account
42  'displayname' => 'Administrator',
43  'email' => 'admin@travis.elgg.org',
44  'username' => 'admin',
45  'password' => 'fancypassword',
46 
47  // timezone
48  'timezone' => 'UTC'
49 );
50 
51 // install and create the .htaccess file
52 $installer->batchInstall($params, TRUE);
53 
54 // at this point installation has completed (otherwise an exception halted execution).
55 echo "Elgg CLI install successful. wwwroot: " . elgg_get_config('wwwroot') . "\n";
56 
elgg_get_config($name, $site_guid=0)
Get an Elgg configuration value.
$installer
$enabled
Travis CI CLI installer script.
exit
Definition: autoloader.php:34