Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ Drush is built by people like you! Please [join us](https://github.com/drush-ops
* Test before you push. Get familiar with Unish, our test suite. See the test-specific [README.md](tests/README.md). Optionally run tests in the provided Docker containers.
* We maintain branches named 9.x, 8.x, etc. These are release branches. From these branches, we make new tags for patch and minor versions.

## Development Environment
* You may choose to use the docker-compose file in root directory for an optimized environment.
* See `composer run-script -l` for a list of helper scripts.

## Coding style
* Do write comments. You don't have to comment every line, but if you come up with something thats a bit complex/weird, just leave a comment. Bear in mind that you will probably leave the project at some point and that other people will read your code. Undocumented huge amounts of code are nearly worthless!
* We use [PSR-2](http://www.php-fig.org/psr/psr-2/) in the /src directory. [Drupal's coding standards](https://drupal.org/coding-standards) are still used in the includes directory (deprecated code).
Expand Down
11 changes: 7 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@
"webflo/drupal-core-strict": "8.6.x-dev",
"drupal/empty_theme": "1.0",
"drupal/devel": "^1.0@RC",
"drupal/alinks": "1.0.0"
"drupal/alinks": "1.0.0",
"vlucas/phpdotenv": "^2.4"
},
"autoload": {
"psr-4": {
Expand All @@ -75,7 +76,8 @@
"autoload-dev": {
"psr-4": {
"Drush\\": "isolation/src/"
}
},
"files": ["tests/load.environment.php"]
},
"config": {
"optimize-autoloader": true,
Expand Down Expand Up @@ -103,11 +105,12 @@
"api": "PATH=$HOME/bin:$PATH sami.phar --ansi update sami-config.php",
"sami-install": "mkdir -p $HOME/bin && curl --output $HOME/bin/sami.phar http://get.sensiolabs.org/sami.phar && chmod +x $HOME/bin/sami.phar",
"scenario": "scenarios/install",
"si-unish": "./drush site:install testing --uri=dev --sites-subdir=dev --db-url=mysql://root:password@mariadb/unish_dev -v",
"sut": "./drush --uri=dev",
"sut:si": "./drush site:install testing --uri=dev --sites-subdir=dev --db-url=mysql://root:password@mariadb/unish_dev -v",
"unit": "phpunit --colors=always",
"functional": "phpunit --colors=always --configuration tests",
"post-update-cmd": [
"create-scenario isolation --autoload-dir isolation --autoload-dir internal-copy --keep '\\(psr/log\\|consolidation/config\\|site-alias\\|var-dumper\\|symfony/finder\\|drupal-finder\\|path-util\\|sebastian/version\\|xhprof\\)' 'phpunit/phpunit:^5.5.4'",
"create-scenario isolation --autoload-dir isolation --autoload-dir internal-copy --keep '\\(psr/log\\|consolidation/config\\|site-alias\\|var-dumper\\|symfony/finder\\|drupal-finder\\|path-util\\|vlucas/phpdotenv\\|xhprof\\)' 'phpunit/phpunit:^5.5.4'",
"create-scenario isolation-phpunit4 --base isolation --autoload-dir isolation --autoload-dir internal-copy 'phpunit/phpunit:^4.8.36'"
]
},
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ services:

# More info at https://github.com/wodby/php
# We don't want their drupal-php image as that ships with a Drush inside.
php:
drupal:
image: wodby/php:${PHP_TAG-7.2-dev}
container_name: ${PROJECT_NAME-unish}_php
container_name: ${PROJECT_NAME-unish}_drupal
environment:
PHP_SENDMAIL_PATH: /dev/null
UNISH_DB_URL: ${UNISH_DB_URL-mysql://root:password@mariadb}
Expand Down
14 changes: 9 additions & 5 deletions scenarios/isolation-phpunit4/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
},
"require-dev": {
"lox/xhprof": "dev-master",
"phpunit/phpunit": "^4.8.36"
"phpunit/phpunit": "^4.8.36",
"vlucas/phpdotenv": "^2.4"
},
"autoload": {
"psr-4": {
Expand All @@ -54,7 +55,8 @@
"autoload-dev": {
"psr-4": {
"Drush\\": "isolation/src/"
}
},
"files": ["tests/load.environment.php"]
},
"config": {
"optimize-autoloader": true,
Expand All @@ -67,8 +69,8 @@
"vendor-dir": "../../vendor"
},
"scripts": {
"cs": "phpcs -n --standard=PSR2 src tests examples",
"cbf": "phpcbf -n --standard=PSR2 src tests examples",
"cs": "phpcs",
"cbf": "phpcbf",
"lint": [
"find includes -name '*.inc' -print0 | xargs -0 -n1 php -l",
"find src -name '*.php' -print0 | xargs -0 -n1 php -l",
Expand All @@ -83,10 +85,12 @@
"api": "PATH=$HOME/bin:$PATH sami.phar --ansi update sami-config.php",
"sami-install": "mkdir -p $HOME/bin && curl --output $HOME/bin/sami.phar http://get.sensiolabs.org/sami.phar && chmod +x $HOME/bin/sami.phar",
"scenario": "scenarios/install",
"sut": "./drush --uri=dev",
"sut:si": "./drush site:install testing --uri=dev --sites-subdir=dev --db-url=mysql://root:password@mariadb/unish_dev -v",
"unit": "phpunit --colors=always",
"functional": "phpunit --colors=always --configuration tests",
"post-update-cmd": [
"create-scenario isolation --autoload-dir isolation --autoload-dir internal-copy --keep '\\(psr/log\\|consolidation/config\\|site-alias\\|var-dumper\\|symfony/finder\\|drupal-finder\\|path-util\\|sebastian/version\\|xhprof\\)' 'phpunit/phpunit:^5.5.4'",
"create-scenario isolation --autoload-dir isolation --autoload-dir internal-copy --keep '\\(psr/log\\|consolidation/config\\|site-alias\\|var-dumper\\|symfony/finder\\|drupal-finder\\|path-util\\|vlucas/phpdotenv\\|xhprof\\)' 'phpunit/phpunit:^5.5.4'",
"create-scenario isolation-phpunit4 --base isolation --autoload-dir isolation --autoload-dir internal-copy 'phpunit/phpunit:^4.8.36'"
]
},
Expand Down
14 changes: 9 additions & 5 deletions scenarios/isolation/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
},
"require-dev": {
"lox/xhprof": "dev-master",
"phpunit/phpunit": "^5.5.4"
"phpunit/phpunit": "^5.5.4",
"vlucas/phpdotenv": "^2.4"
},
"autoload": {
"psr-4": {
Expand All @@ -54,7 +55,8 @@
"autoload-dev": {
"psr-4": {
"Drush\\": "isolation/src/"
}
},
"files": ["tests/load.environment.php"]
},
"config": {
"optimize-autoloader": true,
Expand All @@ -67,8 +69,8 @@
"vendor-dir": "../../vendor"
},
"scripts": {
"cs": "phpcs -n --standard=PSR2 src tests examples",
"cbf": "phpcbf -n --standard=PSR2 src tests examples",
"cs": "phpcs",
"cbf": "phpcbf",
"lint": [
"find includes -name '*.inc' -print0 | xargs -0 -n1 php -l",
"find src -name '*.php' -print0 | xargs -0 -n1 php -l",
Expand All @@ -83,10 +85,12 @@
"api": "PATH=$HOME/bin:$PATH sami.phar --ansi update sami-config.php",
"sami-install": "mkdir -p $HOME/bin && curl --output $HOME/bin/sami.phar http://get.sensiolabs.org/sami.phar && chmod +x $HOME/bin/sami.phar",
"scenario": "scenarios/install",
"sut": "./drush --uri=dev",
"sut:si": "./drush site:install testing --uri=dev --sites-subdir=dev --db-url=mysql://root:password@mariadb/unish_dev -v",
"unit": "phpunit --colors=always",
"functional": "phpunit --colors=always --configuration tests",
"post-update-cmd": [
"create-scenario isolation --autoload-dir isolation --autoload-dir internal-copy --keep '\\(psr/log\\|consolidation/config\\|site-alias\\|var-dumper\\|symfony/finder\\|drupal-finder\\|path-util\\|sebastian/version\\|xhprof\\)' 'phpunit/phpunit:^5.5.4'",
"create-scenario isolation --autoload-dir isolation --autoload-dir internal-copy --keep '\\(psr/log\\|consolidation/config\\|site-alias\\|var-dumper\\|symfony/finder\\|drupal-finder\\|path-util\\|vlucas/phpdotenv\\|xhprof\\)' 'phpunit/phpunit:^5.5.4'",
"create-scenario isolation-phpunit4 --base isolation --autoload-dir isolation --autoload-dir internal-copy 'phpunit/phpunit:^4.8.36'"
]
},
Expand Down
3 changes: 0 additions & 3 deletions src/Commands/core/SiteInstallCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,6 @@ public function install(array $profile, $options = ['db-url' => self::REQ, 'db-p
}

$msg = 'Starting Drupal installation. This takes a while.';
if (is_null($options['notify'])) {
$msg .= ' Consider using the --notify global option.';
}
$this->logger()->notice(dt($msg));

// Define some functions which alter away the install_finished task.
Expand Down
19 changes: 19 additions & 0 deletions tests/load.environment.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

/**
* This file is included very early. See autoload.files in composer.json and
* https://getcomposer.org/doc/04-schema.md#files
*/

use Dotenv\Dotenv;
use Dotenv\Exception\InvalidPathException;

/**
* Load any .env file. See /.env.example.
*/
$dotenv = new Dotenv(__DIR__);
try {
$dotenv->load();
} catch (InvalidPathException $e) {
// Do nothing. Production environments rarely use .env files.
}