3 namespace Friendica\Test\src\Core\Console;
5 use Friendica\Core\Config\Cache\ConfigCache;
6 use Friendica\Core\Console\AutomaticInstallation;
7 use Friendica\Core\Installer;
8 use Friendica\Core\Logger;
9 use Friendica\Test\Util\DBAMockTrait;
10 use Friendica\Test\Util\DBStructureMockTrait;
11 use Friendica\Test\Util\L10nMockTrait;
12 use Friendica\Test\Util\RendererMockTrait;
13 use Friendica\Util\Logger\VoidLogger;
14 use org\bovigo\vfs\vfsStream;
15 use org\bovigo\vfs\vfsStreamFile;
18 * @runTestsInSeparateProcesses
19 * @preserveGlobalState disabled
22 class AutomaticInstallationConsoleTest extends ConsoleTest
26 use DBStructureMockTrait;
27 use RendererMockTrait;
36 * @var vfsStreamFile Assert file without DB credentials
40 * @var vfsStreamFile Assert file with DB credentials
42 private $assertFileDb;
44 public function setUp()
48 if ($this->root->hasChild('config' . DIRECTORY_SEPARATOR . 'local.config.php')) {
49 $this->root->getChild('config')
50 ->removeChild('local.config.php');
53 $this->db_host = getenv('MYSQL_HOST');
54 $this->db_port = !empty(getenv('MYSQL_PORT')) ? getenv('MYSQL_PORT') : null;
55 $this->db_data = getenv('MYSQL_DATABASE');
56 $this->db_user = getenv('MYSQL_USERNAME') . getenv('MYSQL_USER');
57 $this->db_pass = getenv('MYSQL_PASSWORD');
63 * Returns the dataset for each automatic installation test
65 * @return array the dataset
67 public function dataInstaller()
89 'default_timezone' => '',
97 'hostname' => getenv('MYSQL_HOST'),
98 'port' =>!empty(getenv('MYSQL_PORT')) ? getenv('MYSQL_PORT') : null,
99 'username' => getenv('MYSQL_USERNAME'),
100 'password' => getenv('MYSQL_PASSWORD'),
101 'database' => getenv('MYSQL_DATABASE'),
105 'hostname' => 'friendica.local',
106 'admin_email' => 'admin@philipp.info',
109 'urlpath' => 'test/it',
110 'url' => 'friendica.local/test/it',
113 'default_timezone' => 'en',
114 'language' => 'Europe/Berlin',
121 private function assertFinished($txt, $withconfig = false, $copyfile = false)
129 Creating config file...
139 Copying config file...
146 Initializing setup...
151 Checking environment...
153 NOTICE: Not checking .htaccess/URL-Rewrite during CLI installation.
164 Inserting data into database...
175 Installation is finished
179 $this->assertEquals($finished, $txt);
182 private function assertStuckDB($txt)
185 Initializing setup...
190 Checking environment...
192 NOTICE: Not checking .htaccess/URL-Rewrite during CLI installation.
197 Creating config file...
205 Could not connect to database.:
210 $this->assertEquals($finished, $txt);
214 * Test the automatic installation without any parameter/setting
216 public function testEmpty()
218 $configCache = new ConfigCache();
219 $configCache->set('system', 'basepath', $this->root->url());
220 $configCache->set('config', 'php_path', trim(shell_exec('which php')));
222 $this->mockApp($this->root, null, true);
224 $this->configMock->shouldReceive('set')->andReturnUsing(function ($cat, $key, $value) use ($configCache) {
225 if ($key !== 'basepath') {
226 return $configCache->set($cat, $key, $value);
231 $this->configMock->shouldReceive('has')->andReturn(true);
232 $this->configMock->shouldReceive('get')->andReturnUsing(function ($cat, $key) use ($configCache) {
233 return $configCache->get($cat, $key);
236 $this->mockConnect(true, 1);
237 $this->mockConnected(true, 1);
238 $this->mockExistsTable('user', false, 1);
239 $this->mockUpdate([$this->root->url(), false, true, true], null, 1);
241 $this->mockGetMarkupTemplate('local.config.tpl', 'testTemplate', 1);
242 $this->mockReplaceMacros('testTemplate', \Mockery::any(), '', 1);
244 $console = new AutomaticInstallation($this->consoleArgv);
246 $txt = $this->dumpExecute($console);
248 $this->assertFinished($txt, true, false);
249 $this->assertTrue($this->root->hasChild('config' . DIRECTORY_SEPARATOR . 'local.config.php'));
251 // Assert the default values without any config
252 $this->assertEquals(Installer::DEFAULT_HOST, $configCache->get('database', 'hostname'));
253 $this->assertEmpty($configCache->get('database', 'username'));
254 $this->assertEmpty($configCache->get('database', 'password'));
255 $this->assertEmpty($configCache->get('database', 'database'));
257 $this->assertEmpty($configCache->get('config', 'hostname'), $configCache->get('config', 'hostname'));
258 $this->assertEmpty($configCache->get('config', 'admin_email'), $configCache->get('config', 'admin_email'));
259 $this->assertEquals(trim(shell_exec('which php')), $configCache->get('config', 'php_path'));
261 $this->assertEquals(Installer::DEFAULT_TZ, $configCache->get('system', 'default_timezone'));
262 $this->assertEquals(Installer::DEFAULT_LANG, $configCache->get('system', 'language'));
263 $this->assertEquals(SSL_POLICY_NONE, $configCache->get('system', 'ssl_policy'));
264 $this->assertEmpty($configCache->get('system', 'urlpath'), $configCache->get('system', 'urlpath'));
265 $this->assertEquals($this->root->url(), $configCache->get('system', 'basepath'));
269 * Test the automatic installation with a prepared config file
270 * @dataProvider dataInstaller
272 public function testWithConfig(array $data)
274 $configCache = new ConfigCache();
275 $configCache->load($data);
276 $configCache->set('system', 'basepath', $this->root->url());
277 $configCache->set('config', 'php_path', trim(shell_exec('which php')));
279 $this->mockApp($this->root, $configCache, true);
280 $this->mode->shouldReceive('isInstall')->andReturn(false);
281 Logger::init(new VoidLogger());
283 $this->mockConnect(true, 1);
284 $this->mockConnected(true, 1);
285 $this->mockExistsTable('user', false, 1);
286 $this->mockUpdate([$this->root->url(), false, true, true], null, 1);
288 $conf = function ($cat, $key) use ($configCache) {
289 return $configCache->get($cat, $key);
295 // Local configuration
297 // If you're unsure about what any of the config keys below do, please check the config/defaults.config.php for detailed
298 // documentation of their data type and behavior.
302 'hostname' => '{$conf('database','hostname')}',
303 'username' => '{$conf('database', 'username')}',
304 'password' => '{$conf('database', 'password')}',
305 'database' => '{$conf('database', 'database')}',
306 'charset' => 'utf8mb4',
309 // ****************************************************************
310 // The configuration below will be overruled by the admin panel.
311 // Changes made below will only have an effect if the database does
312 // not contain any configuration for the friendica system.
313 // ****************************************************************
316 'admin_email' => '{$conf('config', 'admin_email')}',
317 'hostname' => '{$conf('config', 'hostname')}',
318 'sitename' => 'Friendica Social Network',
319 'register_policy' => \Friendica\Module\Register::OPEN,
320 'register_text' => '',
323 'basepath => '{$conf('system', 'basepath')}',
324 'urlpath => '{$conf('system', 'urlpath')}',
325 'url' => '{$conf('system', 'url')}',
326 'default_timezone' => '{$conf('system', 'default_timezone')}',
327 'language' => '{$conf('system', 'language')}',
332 vfsStream::newFile('prepared.config.php')
334 ->setContent($config);
336 $console = new AutomaticInstallation($this->consoleArgv);
337 $console->setOption('f', 'prepared.config.php');
339 $txt = $this->dumpExecute($console);
341 $this->assertFinished($txt, false, true);
343 $this->assertTrue($this->root->hasChild('config' . DIRECTORY_SEPARATOR . 'local.config.php'));
344 $this->assertEquals($config, file_get_contents($this->root->getChild('config' . DIRECTORY_SEPARATOR . 'local.config.php')->url()));
348 * Test the automatic installation with environment variables
349 * Includes saving the DB credentials to the file
350 * @dataProvider dataInstaller
352 public function testWithEnvironmentAndSave(array $data)
354 $configCache = new ConfigCache();
355 $configCache->set('system', 'basepath', $this->root->url());
356 $configCache->set('config', 'php_path', trim(shell_exec('which php')));
358 $this->mockApp($this->root, null, true);
360 $this->configMock->shouldReceive('set')->andReturnUsing(function ($cat, $key, $value) use ($configCache) {
361 if ($key !== 'basepath') {
362 return $configCache->set($cat, $key, $value);
367 $this->configMock->shouldReceive('has')->andReturn(true);
368 $this->configMock->shouldReceive('get')->andReturnUsing(function ($cat, $key) use ($configCache) {
369 return $configCache->get($cat, $key);
372 $this->mockConnect(true, 1);
373 $this->mockConnected(true, 1);
374 $this->mockExistsTable('user', false, 1);
375 $this->mockUpdate([$this->root->url(), false, true, true], null, 1);
377 $this->mockGetMarkupTemplate('local.config.tpl', 'testTemplate', 1);
378 $this->mockReplaceMacros('testTemplate', \Mockery::any(), '', 1);
380 $this->assertTrue(putenv('MYSQL_HOST=' . $data['database']['hostname']));
381 $this->assertTrue(putenv('MYSQL_PORT=' . $data['database']['port']));
382 $this->assertTrue(putenv('MYSQL_DATABASE=' . $data['database']['database']));
383 $this->assertTrue(putenv('MYSQL_USERNAME=' . $data['database']['username']));
384 $this->assertTrue(putenv('MYSQL_PASSWORD=' . $data['database']['password']));
386 $this->assertTrue(putenv('FRIENDICA_URL_PATH=' . $data['system']['urlpath']));
387 $this->assertTrue(putenv('FRIENDICA_BASE_PATH=' . $data['system']['basepath']));
388 $this->assertTrue(putenv('FRIENDICA_PHP_PATH=' . $data['config']['php_path']));
389 $this->assertTrue(putenv('FRIENDICA_SSL_POLICY=' . $data['system']['ssl_policy']));
390 $this->assertTrue(putenv('FRIENDICA_HOSTNAME=' . $data['config']['hostname']));
391 $this->assertTrue(putenv('FRIENDICA_ADMIN_MAIL=' . $data['config']['admin_email']));
392 $this->assertTrue(putenv('FRIENDICA_TZ=' . $data['system']['default_timezone']));
393 $this->assertTrue(putenv('FRIENDICA_LANG=' . $data['system']['language']));
395 $console = new AutomaticInstallation($this->consoleArgv);
396 $console->setOption('savedb', true);
398 $txt = $this->dumpExecute($console);
400 // Assert the default values without any config
401 $dbhost = $data['database']['hostname'] . (!empty($data['database']['port']) ? ':' . $data['database']['port'] : '');
402 $this->assertEquals($dbhost, $configCache->get('database', 'hostname'));
403 $this->assertEquals($data['database']['username'], $configCache->get('database', 'username'));
404 $this->assertEquals($data['database']['database'], $configCache->get('database', 'database'));
405 $this->assertEquals($data['database']['password'], $configCache->get('database', 'password'));
407 $this->assertEquals($data['config']['hostname'], $configCache->get('config', 'hostname'));
408 $this->assertEquals($data['config']['admin_email'], $configCache->get('config', 'admin_email'));
409 $this->assertEquals(trim(shell_exec('which php')), $configCache->get('config', 'php_path'));
411 $this->assertEquals((!empty($data['system']['default_timezone']) ? $data['system']['default_timezone'] : Installer::DEFAULT_TZ),
412 $configCache->get('system', 'default_timezone'));
413 $this->assertEquals((!empty($data['system']['language']) ? $data['system']['language'] : Installer::DEFAULT_LANG),
414 $configCache->get('system', 'language'));
415 $this->assertEquals((!empty($data['system']['ssl_policy']) ? $data['system']['ssl_policy'] : SSL_POLICY_NONE),
416 $configCache->get('system', 'ssl_policy'));
417 $this->assertEquals((!empty($data['system']['urlpath']) ? $data['system']['urlpath'] : null),
418 $configCache->get('system', 'urlpath'));
420 $this->assertFinished($txt, true);
424 * Test the automatic installation with environment variables
425 * Don't save the db credentials to the file
426 * @dataProvider dataInstaller
428 public function testWithEnvironmentWithoutSave(array $data)
430 $configCache = new ConfigCache();
431 $configCache->set('system', 'basepath', $this->root->url());
432 $configCache->set('config', 'php_path', trim(shell_exec('which php')));
434 $this->mockApp($this->root, null, true);
436 $this->configMock->shouldReceive('set')->andReturnUsing(function ($cat, $key, $value) use ($configCache) {
437 if ($key !== 'basepath') {
438 return $configCache->set($cat, $key, $value);
443 $this->configMock->shouldReceive('has')->andReturn(true);
444 $this->configMock->shouldReceive('get')->andReturnUsing(function ($cat, $key) use ($configCache) {
445 return $configCache->get($cat, $key);
448 $this->mockConnect(true, 1);
449 $this->mockConnected(true, 1);
450 $this->mockExistsTable('user', false, 1);
451 $this->mockUpdate([$this->root->url(), false, true, true], null, 1);
453 $this->mockGetMarkupTemplate('local.config.tpl', 'testTemplate', 1);
454 $this->mockReplaceMacros('testTemplate', \Mockery::any(), '', 1);
456 $this->assertTrue(putenv('MYSQL_HOST=' . $data['database']['hostname']));
457 $this->assertTrue(putenv('MYSQL_PORT=' . $data['database']['port']));
458 $this->assertTrue(putenv('MYSQL_DATABASE=' . $data['database']['database']));
459 $this->assertTrue(putenv('MYSQL_USERNAME=' . $data['database']['username']));
460 $this->assertTrue(putenv('MYSQL_PASSWORD=' . $data['database']['password']));
462 $this->assertTrue(putenv('FRIENDICA_URL_PATH=' . $data['system']['urlpath']));
463 $this->assertTrue(putenv('FRIENDICA_BASE_PATH=' . $data['system']['basepath']));
464 $this->assertTrue(putenv('FRIENDICA_PHP_PATH=' . $data['config']['php_path']));
465 $this->assertTrue(putenv('FRIENDICA_SSL_POLICY=' . $data['system']['ssl_policy']));
466 $this->assertTrue(putenv('FRIENDICA_HOSTNAME=' . $data['config']['hostname']));
467 $this->assertTrue(putenv('FRIENDICA_ADMIN_MAIL=' . $data['config']['admin_email']));
468 $this->assertTrue(putenv('FRIENDICA_TZ=' . $data['system']['default_timezone']));
469 $this->assertTrue(putenv('FRIENDICA_LANG=' . $data['system']['language']));
471 $console = new AutomaticInstallation($this->consoleArgv);
473 $txt = $this->dumpExecute($console);
475 $this->assertEquals(Installer::DEFAULT_HOST, $configCache->get('database', 'hostname'));
476 $this->assertEmpty($configCache->get('database', 'username'), $configCache->get('database', 'username'));
477 $this->assertEmpty($configCache->get('database', 'password'), $configCache->get('database', 'password'));
478 $this->assertEmpty($configCache->get('database', 'database'), $configCache->get('database', 'database'));
480 $this->assertEquals($data['config']['hostname'], $configCache->get('config', 'hostname'));
481 $this->assertEquals($data['config']['admin_email'], $configCache->get('config', 'admin_email'));
482 $this->assertEquals(trim(shell_exec('which php')), $configCache->get('config', 'php_path'));
484 $this->assertEquals((!empty($data['system']['default_timezone']) ? $data['system']['default_timezone'] : Installer::DEFAULT_TZ),
485 $configCache->get('system', 'default_timezone'));
486 $this->assertEquals((!empty($data['system']['language']) ? $data['system']['language'] : Installer::DEFAULT_LANG),
487 $configCache->get('system', 'language'));
488 $this->assertEquals((!empty($data['system']['ssl_policy']) ? $data['system']['ssl_policy'] : SSL_POLICY_NONE),
489 $configCache->get('system', 'ssl_policy'));
490 $this->assertEquals((!empty($data['system']['urlpath']) ? $data['system']['urlpath'] : null),
491 $configCache->get('system', 'urlpath'));
493 $this->assertFinished($txt, true);
497 * Test the automatic installation with arguments
498 * @dataProvider dataInstaller
500 public function testWithArguments(array $data)
502 $configCache = new ConfigCache();
503 $configCache->set('system', 'basepath', $this->root->url());
504 $configCache->set('config', 'php_path', trim(shell_exec('which php')));
506 $this->mockApp($this->root, null, true);
508 $this->configMock->shouldReceive('set')->andReturnUsing(function ($cat, $key, $value) use ($configCache) {
509 if ($key !== 'basepath') {
510 return $configCache->set($cat, $key, $value);
515 $this->configMock->shouldReceive('has')->andReturn(true);
516 $this->configMock->shouldReceive('get')->andReturnUsing(function ($cat, $key) use ($configCache) {
517 return $configCache->get($cat, $key);
520 $this->mockConnect(true, 1);
521 $this->mockConnected(true, 1);
522 $this->mockExistsTable('user', false, 1);
523 $this->mockUpdate([$this->root->url(), false, true, true], null, 1);
525 $this->mockGetMarkupTemplate('local.config.tpl', 'testTemplate', 1);
526 $this->mockReplaceMacros('testTemplate', \Mockery::any(), '', 1);
528 $console = new AutomaticInstallation($this->consoleArgv);
530 if (!empty($data['database']['hostname'])) {
531 $console->setOption('dbhost', $data['database']['hostname']);
533 if (!empty($data['database']['port'])) {
534 $console->setOption('dbport', $data['database']['port']);
536 if (!empty($data['database']['username'])) {
537 $console->setOption('dbuser', $data['database']['username']);
539 if (!empty($data['database']['password'])) {
540 $console->setOption('dbpass', $data['database']['password']);
542 if (!empty($data['database']['database'])) {
543 $console->setOption('dbdata', $data['database']['database']);
545 if (!empty($data['system']['urlpath'])) {
546 $console->setOption('urlpath', $data['system']['urlpath']);
548 if (!empty($data['system']['basepath'])) {
549 $console->setOption('basepath', $data['system']['basepath']);
551 if (!empty($data['config']['php_path'])) {
552 $console->setOption('phppath', $data['config']['php_path']);
554 if (!empty($data['system']['ssl_policy'])) {
555 $console->setOption('sslpolicy', $data['system']['ssl_policy']);
557 if (!empty($data['config']['hostname'])) {
558 $console->setOption('hostname', $data['config']['hostname']);
560 if (!empty($data['config']['admin_email'])) {
561 $console->setOption('admin', $data['config']['admin_email']);
563 if (!empty($data['system']['default_timezone'])) {
564 $console->setOption('tz', $data['system']['default_timezone']);
566 if (!empty($data['system']['language'])) {
567 $console->setOption('lang', $data['system']['language']);
570 $txt = $this->dumpExecute($console);
572 $dbhost = (!empty($data['database']['hostname'])) ? $data['database']['hostname'] : Installer::DEFAULT_HOST;
573 $dbhost .= (!empty($data['database']['port']) ? ':' . $data['database']['port'] : '');
574 $this->assertEquals($dbhost, $configCache->get('database', 'hostname'));
575 $this->assertEquals($data['database']['username'], $configCache->get('database', 'username'));
576 $this->assertEquals($data['database']['database'], $configCache->get('database', 'database'));
577 $this->assertEquals($data['database']['password'], $configCache->get('database', 'password'));
579 $this->assertEquals($data['config']['hostname'], $configCache->get('config', 'hostname'));
580 $this->assertEquals($data['config']['admin_email'], $configCache->get('config', 'admin_email'));
581 $this->assertEquals(trim(shell_exec('which php')), $configCache->get('config', 'php_path'));
583 $this->assertEquals((!empty($data['system']['default_timezone']) ? $data['system']['default_timezone'] : Installer::DEFAULT_TZ),
584 $configCache->get('system', 'default_timezone'));
585 $this->assertEquals((!empty($data['system']['language']) ? $data['system']['language'] : Installer::DEFAULT_LANG),
586 $configCache->get('system', 'language'));
587 $this->assertEquals((!empty($data['system']['ssl_policy']) ? $data['system']['ssl_policy'] : SSL_POLICY_NONE),
588 $configCache->get('system', 'ssl_policy'));
589 $this->assertEquals((!empty($data['system']['urlpath']) ? $data['system']['urlpath'] : null),
590 $configCache->get('system', 'urlpath'));
592 $this->assertFinished($txt, true);
596 * Test the automatic installation with a wrong database connection
598 public function testNoDatabaseConnection()
600 $configCache = new ConfigCache();
601 $configCache->set('system', 'basepath', $this->root->url());
602 $configCache->set('config', 'php_path', trim(shell_exec('which php')));
604 $this->mockApp($this->root, null, true);
606 $this->configMock->shouldReceive('set')->andReturnUsing(function ($cat, $key, $value) use ($configCache) {
607 if ($key !== 'basepath') {
608 return $configCache->set($cat, $key, $value);
613 $this->configMock->shouldReceive('has')->andReturn(true);
614 $this->configMock->shouldReceive('get')->andReturnUsing(function ($cat, $key) use ($configCache) {
615 return $configCache->get($cat, $key);
618 $this->mockConnect(false, 1);
620 $this->mockGetMarkupTemplate('local.config.tpl', 'testTemplate', 1);
621 $this->mockReplaceMacros('testTemplate', \Mockery::any(), '', 1);
623 $console = new AutomaticInstallation($this->consoleArgv);
625 $txt = $this->dumpExecute($console);
627 $this->assertStuckDB($txt);
628 $this->assertTrue($this->root->hasChild('config' . DIRECTORY_SEPARATOR . 'local.config.php'));
630 // Assert the default values without any config
631 $this->assertEquals(Installer::DEFAULT_HOST, $configCache->get('database', 'hostname'));
632 $this->assertEmpty($configCache->get('database', 'username'));
633 $this->assertEmpty($configCache->get('database', 'password'));
634 $this->assertEmpty($configCache->get('database', 'database'));
636 $this->assertEmpty($configCache->get('config', 'hostname'), $configCache->get('config', 'hostname'));
637 $this->assertEmpty($configCache->get('config', 'admin_email'), $configCache->get('config', 'admin_email'));
638 $this->assertEquals(trim(shell_exec('which php')), $configCache->get('config', 'php_path'));
640 $this->assertEquals(Installer::DEFAULT_TZ, $configCache->get('system', 'default_timezone'));
641 $this->assertEquals(Installer::DEFAULT_LANG, $configCache->get('system', 'language'));
642 $this->assertEquals(SSL_POLICY_NONE, $configCache->get('system', 'ssl_policy'));
643 $this->assertEmpty($configCache->get('system', 'urlpath'), $configCache->get('system', 'urlpath'));
644 $this->assertEquals($this->root->url(), $configCache->get('system', 'basepath'));
647 public function testGetHelp()
649 // Usable to purposely fail if new commands are added without taking tests into account
651 Installation - Install Friendica automatically
653 bin/console autoinstall [-h|--help|-?] [-v] [-a] [-f]
656 Installs Friendica with data based on the local.config.php file or environment variables
659 Not checking .htaccess/URL-Rewrite during CLI installation.
662 -h|--help|-? Show help information
663 -v Show more debug information.
664 -a All setup checks are required (except .htaccess)
665 -f|--file <config> prepared config file (e.g. "config/local.config.php" itself) which will override every other config option - except the environment variables)
666 -s|--savedb Save the DB credentials to the file (if environment variables is used)
667 -H|--dbhost <host> The host of the mysql/mariadb database (env MYSQL_HOST)
668 -p|--dbport <port> The port of the mysql/mariadb database (env MYSQL_PORT)
669 -d|--dbdata <database> The name of the mysql/mariadb database (env MYSQL_DATABASE)
670 -U|--dbuser <username> The username of the mysql/mariadb database login (env MYSQL_USER or MYSQL_USERNAME)
671 -P|--dbpass <password> The password of the mysql/mariadb database login (env MYSQL_PASSWORD)
672 -U|--urlpath <url_path> The URL path of Friendica - f.e. '/friendica' (env FRIENDICA_URL_PATH)
673 -B|--phppath <php_path> The path of the PHP binary (env FRIENDICA_PHP_PATH)
674 -b|--basepath <base_path> The basepath of Friendica(env FRIENDICA_BASE_PATH)
675 -S|--sslpolicy <ssl_policy> The SSL policy of Friendica (env FRIENDICA_SSL_POLICY)
676 -n|--hostname <hostname> The hostname of Friendica (env FRIENDICA_PHP_HOSTNAME)
677 -t|--tz <timezone> The timezone of Friendica (env FRIENDICA_TZ)
678 -L|--lang <language> The language of Friendica (env FRIENDICA_LANG)
680 Environment variables
681 MYSQL_HOST The host of the mysql/mariadb database (mandatory if mysql and environment is used)
682 MYSQL_PORT The port of the mysql/mariadb database
683 MYSQL_USERNAME|MYSQL_USER The username of the mysql/mariadb database login (MYSQL_USERNAME is for mysql, MYSQL_USER for mariadb)
684 MYSQL_PASSWORD The password of the mysql/mariadb database login
685 MYSQL_DATABASE The name of the mysql/mariadb database
686 FRIENDICA_URL_PATH The URL path of Friendica (f.e. '/friendica') - leave empty for auto detection
687 FRIENDICA_PHP_PATH The path of the PHP binary - leave empty for auto detection
688 FRIENDICA_BASE_PATH The basepath of Friendica - leave empty for auto detection
689 FRIENDICA_ADMIN_MAIL The admin email address of Friendica (this email will be used for admin access)
690 FRIENDICA_SSL_POLICY The SSL policy of Friendica (default is NO SSL)
691 FRIENDICA_HOSTNAME The hostname of Friendica - leave empty for auto detection
692 FRIENDICA_TZ The timezone of Friendica
693 FRIENDICA_LANG The langauge of Friendica
696 bin/console autoinstall -f 'input.config.php
697 Installs Friendica with the prepared 'input.config.php' file
699 bin/console autoinstall --savedb
700 Installs Friendica with environment variables and saves them to the 'config/local.config.php' file
702 bin/console autoinstall -h localhost -p 3365 -U user -P passwort1234 -d friendica
703 Installs Friendica with a local mysql database with credentials
707 $console = new AutomaticInstallation($this->consoleArgv);
708 $console->setOption('help', true);
710 $txt = $this->dumpExecute($console);
712 $this->assertEquals($txt, $theHelp);