Skip to content

Commit e6bdca0

Browse files
committed
ACMS-3658: README file updated.
1 parent 7a2e07d commit e6bdca0

File tree

1 file changed

+4
-58
lines changed

1 file changed

+4
-58
lines changed

README.md

+4-58
Original file line numberDiff line numberDiff line change
@@ -30,68 +30,14 @@ on when these events are triggered. You can find the examples of such
3030
implementations from [here](examples).
3131

3232
# Quick examples
33-
## Generate settings for a given site
33+
### Generate settings with default credentials for the default site:
3434
```
35-
<?php
36-
37-
/**
38-
* @file
39-
* Include DRS settings.
40-
*/
41-
42-
use Acquia\Drupal\RecommendedSettings\Exceptions\SettingsException;
43-
use Acquia\Drupal\RecommendedSettings\Settings;
44-
45-
// Create settings object.
46-
$siteUri = "site1";
47-
$settings = new Settings(DRUPAL_ROOT, $siteUri);
48-
49-
try {
50-
// Call generate method.
51-
$settings->generate();
52-
}
53-
catch (SettingsException $e) {
54-
echo $e->getMessage();
55-
}
35+
./vendor/bin/drush init:settings
5636
```
5737

58-
## Generate settings for a given site passing database credentials
59-
38+
### Set up a new site with custom credentials for the local environment:
6039
```
61-
<?php
62-
63-
/**
64-
* @file
65-
* Include DRS settings.
66-
*/
67-
68-
use Acquia\Drupal\RecommendedSettings\Exceptions\SettingsException;
69-
use Acquia\Drupal\RecommendedSettings\Settings;
70-
71-
// Create settings object.
72-
$siteUri = "site1";
73-
$settings = new Settings(DRUPAL_ROOT, $siteUri);
74-
75-
// Database details.
76-
$dbSpec = [
77-
'drupal' => [
78-
'db' => [
79-
'database' => 'drupal', // In case of multi-site database name is replaced with the site name.
80-
'username' => 'drupal',
81-
'password' => 'drupal',
82-
'host' => 'localhost',
83-
'port' => '3306',
84-
],
85-
],
86-
];
87-
88-
try {
89-
// Call generate method passing database details.
90-
$settings->generate($dbSpec);
91-
}
92-
catch (SettingsException $e) {
93-
echo $e->getMessage();
94-
}
40+
./vendor/bin/drush init:settings --database=site1 --username=myuser --password=mypass --host=127.0.0.1 --port=1234 --uri=site1
9541
```
9642

9743
# License

0 commit comments

Comments
 (0)