Skip to content

Commit fbb7d0c

Browse files
committed
Add Drupal Quick install
1 parent 1213681 commit fbb7d0c

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

web/src/app/WebApp/Installers/Drupal/DrupalSetup.php

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,38 @@ class DrupalSetup extends BaseSetup {
1111
protected $appInfo = [
1212
'name' => 'Drupal',
1313
'group' => 'cms',
14-
'enabled' => false,
14+
'enabled' => 'yes',
1515
'version' => 'latest',
1616
'thumbnail' => 'drupal-thumb.png'
1717
];
1818

1919
protected $config = [
2020
'form' => [
21+
'username' => ['type'=>'text', 'value'=>'admin'],
22+
'password' => 'password',
23+
'email' => 'text'
2124
],
2225
'database' => true,
2326
'resources' => [
24-
27+
'composer' => [ 'src' => 'drupal/recommended-project', 'dst' => '/' ],
2528
],
2629
];
2730

2831
public function install(array $options=null) : bool
2932
{
30-
exit( "Installer missing" );
33+
parent::install($options);
34+
$this->appcontext->runComposer(["require", "-d " . $this->getDocRoot(), "drush/drush:^10"], $result);
35+
36+
$this -> appcontext -> runUser('v-run-cli-cmd', [
37+
'php',
38+
$this -> getDocRoot('/vendor/drush/drush/drush'),
39+
'site-install',
40+
'standard',
41+
'--db-url=mysql://'.$this->appcontext->user() . '_' . $options['database_user'].':' . $options['database_password'].'@localhost:3306/'.$this->appcontext->user() . '_' . $options['database_name'].'',
42+
'--account-name='.$options['username'].' --account-pass='.$options['password'],
43+
'--site-name=Drupal',
44+
'--site-mail='.$options['email']
45+
], $status);
46+
return ($status->code === 0);
3147
}
3248
}

0 commit comments

Comments
 (0)