Date post: | 15-Apr-2017 |
Category: |
Technology |
Upload: | jacob-borr |
View: | 646 times |
Download: | 0 times |
JesusManuelOlivas
Drupal8SolutionsEngineer|
IworkforFFW(andyoushouldtoo)
Aboutme
@jmolivas @drupalconsole@drupodcast
Topics
DrupalConsolethewhat,whyandhow.
Generatecode/filesrequiredbyaDrupal8module.
InteractandDebugDrupal8.
LearnDrupal8.
Writeanintegration.
Automatecommandexecution.
Remotecommandexecution.
ContributetotheprojectandRoadmap.
WhatistheDrupalConsole?
ThenewCLIforDrupal.
TheDrupalConsoleisatooltogenerateboilerplatecode,interactanddebugDrupal8.
DavidFlores |@dmouse
EduardoGarcía|@enzolutions
JesúsManuelOlivas|@jmolivas
OmarAguirre|@omers
Whomaintainthisproject?
Wheredoyou ndtheproject?
LandingPage
Documentation
Support
http://drupalconsole.com/
http://bit.ly/console-book
http://bit.ly/console-support
Usingtheinstaller
# Run this in your terminal to get the latest project version:curl https://drupalconsole.com/installer -L -o drupal.phar
# Accessing from anywhere on your system:mv drupal.phar /usr/local/bin/drupal
# Apply executable permissions on the downloaded file:chmod +x /usr/local/bin/drupal
# Copy configuration files to user home directory:drupal init --override
# Check and validate system requirementsdrupal check
UsingComposer
$ composer global require drupal/console:@stable
# download path:# ~/.composer/vendor/drupal/console
# run it using:$ ~/.composer/vendor/bin/console
Gitbook-UsingComposer
UsingDrupalComposer
$ composer create-project drupal-composer/drupal-project:8.x-dev drupal8.dev --stability dev --no-interaction
https://github.com/drupal-composer/drupal-project
UsingaVirtualMachine/Container
DrupalVM
Drupal8SprintBox
DrupaldevelopmentwithDocker
Drude(DrupalDockerEnvironment)
http://www.drupalvm.com/
https://github.com/thom8/drupal8-vagrant
https://github.com/wadmiraal/docker-drupal
https://github.com/blinkreaction/drude
Updatingtheproject
$ drupal self-update
$ php console.phar self-update
$ composer global update drupal/console
ExecuteDrupalConsole
# change directory to site path$ cd /var/www/drupal8.dev$ drupal
# use --root option$ drupal --root=/var/www/drupal8.dev
Creatingamodule
Createanewdirectorynamed'example'at'modules/custom'directory.
Createan'example.info.yml'fileat'modules/custom/example'directory.
Customandcontributedmodulesmustbecreatedatmodulesfolderintherootdirectory.
CreatingaCustomPage
Createa'HelloController'Classwitha'hello'methodat'src/Controller'Directory.
Createaroutewithpathto'/hello/{name}'at'example.routing.yml'file.
MakesureyourHelloControllerclassextendsfromControllerBasecoreclass.
CreatingaCon gForm
Createa'ExampleForm.php'classat'src/Form'Directory.
Createaroutewithpathto'/admin/config/example/example'at'example.routing.yml'.
Addexample.links.menu.ymlfileandsetsystem.admin_config_systemasparent.
Makesureyouuse_forminsteadof_controlleronroutedefaults.
CreatingaBlock(Plugin)
Createa'ExampleBlock'classat'src/Plugin/Block'.
ExtendfromBlockBasecoreclass.
Add@Blockannotation.
AddblockForm,blockSubmitandbuildmethods.
Addingthe@Blockannotation,makethisblockdiscoverablebythesystem.
generate:plugin:block
$ drupal generate:plugin:block --module="example" --class="ExampleBlock" --label="example_block" --plugin-id="example_block" --no-interaction
generate:entity:content
$ drupal generate:entity:content --module="example" --entity-class="Foo" --entity-name="foo" --no-interaction
con g
config config:debug config:edit config:export config:export:content:type config:export:single config:export:view config:import config:import:single config:override
Use--learningoption
$ drupal generate:controller --module="example" --class="ExampleController" --routes="title:hello method:hello path:/hello/{name}" --test --no-interaction --learning
generate:command
$ drupal generate:command --module="example" --class-name="HelloCommand" --command="example:hello" --no-interaction
Globalcon guration~/.console/config.yml
application:
...
remote: user: root port: 22 console: /usr/local/bin/drupal keys: public: ~/.ssh/id_rsa.pub private: ~/.ssh/id_rsa passphrase: ~/.ssh/passphrase.txt
Sitecon guration~/.console/sites/sample.yml
local: root: /var/www/drupal8.dev host: localdev: root: /var/www/html/drupal host: 140.211.10.62 user: drupalprod: root: /var/www/html/docroot host: live.drupal.org user: drupal console: /var/www/html/docroot/console.phar
GettingtheprojectForkyourowncopyoftheConsolerepository
Cloneyourforkedrepository.
$ git clone [email protected]:[github-user]/DrupalConsole.git
Downloaddependenciesusingcomponser.
$ cd /path/to/DrupalConsole$ composer install
http://bit.ly/console-fork
Beforecommitingyourcode
ProjectcodeisPSR-2CodingStyle.
GeneratedcodeisDrupalCodingStyle.
http://www.php-fig.org/psr/psr-2/
https://www.drupal.org/coding-standards
Contributors
https://drupalconsole.com/contributors
Increasecodecoverage.
Improvedocumentationandtranslations.
Improveverbosecode-output.(--learning)
Improveautomatecapabilities.(chain)
Milestones
https://github.com/hechoendrupal/DrupalConsole/milestones
Currentandupcommingimplementations
Webpro ler(develsubmodule)
Metatag
DrupalCommerce
ScheduledUpdates
Rules
Casper(theme)
Liberty(theme)