Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* @file
* Contains \Drupal\Console\Develop\Example.
*/
namespace Drupal\Console\Command\Develop;
use Symfony\Component\Console\Input\InputInterface;

DrupalVM + DrupalConsole

Instructions to execute DrupalConsole commands remotely using site alias against a DrupalVM site.

NOTE: make sure you make changes according to your DrupalVM custom configuration.

Allow paswordless ssh connection

Execute this instruction:

cat ~/.ssh/id_rsa.pub | ssh [email protected] "mkdir -p ~/.ssh &amp;&amp; cat &gt;&gt; ~/.ssh/authorized_keys"
@jmolivas
jmolivas / generate-command.sh
Last active May 2, 2016 22:47
Writing modern CLI Commands for Drupal 8 blog post
drupal generate:command --module="example" --class="HelloCommand"
--name="say:hello" --no-interaction
@jmolivas
jmolivas / installer.sh
Last active April 21, 2016 09:04
Drupal Console alpha1 is now available
# Download the latest Drupal Console release.
curl https://drupalconsole.com/installer -L -o drupal.phar
# Move to a global accesible place on the system.
mv drupal.phar /usr/local/bin/drupal
# Apply executable permissions on the downloaded file.
chmod +x /usr/local/bin/drupal
@jmolivas
jmolivas / drupal-chain-create-data.sh
Last active August 8, 2016 04:24
Drupal Console an overview of the new Drupal CLI
drupal chain --file=/Users/jmolivas/.console/chain/create-data.yml
@jmolivas
jmolivas / instructions.bash
Last active March 30, 2016 02:23
Drupal Consol, install + setup instructions
# Run this in your terminal to get the latest project version:
curl https://drupalconsole.com/installer -L -o drupal.phar
# Or if you don't have curl:
php -r "readfile('https://drupalconsole.com/installer');" > drupal.phar
# Accessing from anywhere on your system:
mv drupal.phar /usr/local/bin/drupal
# Apply executable permissions on the downloaded file:
@jmolivas
jmolivas / chain-mysql.sh
Last active January 22, 2018 21:37
How to download and install Drupal 8 using Drupal Console
drupal chain --file=~/.console/chain/quick-start-mysql.yml
<?php
/**
* @file
* Contains \Drupal\my_module\Plugin\rest\resource\MyRestResource.
*/
namespace Drupal\my_module\Plugin\rest\resource;
use Drupal\Core\Session\AccountProxyInterface;
@jmolivas
jmolivas / autocomplete.sh
Last active August 20, 2018 14:37
install Drupal Console
#Bash or Zsh: Add this line to your shell configuration file:
source "$HOME/.console/console.rc" 2>/dev/null
#Fish: Create a symbolic link
ln -s ~/.console/drupal.fish ~/.config/fish/completions/drupal.fish
@jmolivas
jmolivas / HelloController.php
Last active February 4, 2016 22:47
Module of the week
<?php
/**
* @file
* Contains \Drupal\example\Controller\HelloController.
*/
namespace Drupal\example\Controller;
use Drupal\Core\Controller\ControllerBase;