SlideShare une entreprise Scribd logo
1  sur  100
Télécharger pour lire hors ligne
Faster	and	Smarter
Development	with	Drupal
Console
Jesus	Manuel	Olivas
Drupal	8	Solutions	Engineer
	|	
	
I	work	for	FFW
(and	you	should	too)
About	me
@jmolivas @drupalconsole
@drupodcast
What	is	the	Drupal	Console?
It	is	a	suite	of	tools	that	you	run	on	a
command	line	interface	(CLI)	to	generate
boilerplate	code	and	interact	with	a	Drupal	8
installation.
David	Flores	|	@dmouse
Eduardo	García	|	@enzolutions
Jesús	Manuel	Olivas	|	@jmolivas
Omar	Aguirre	|	@omers
Who	maintain	this	project?
Supporting	organizations
Why	should	you	care	about	it?
Drupal	is	more	tehcnically	advanced
How	does	Drupal	Console	help?
Topics
Where	to	find	and	how	to	Download	Drupal
Console
Generate	code/files	required	by	a	Drupal	8	module.
Interact	with	your	Drupal	8	installation.
Learn	Drupal	8.
Write	an	integration.
Automate	command	execution.
Remote	command	execution.
Contribute	to	the	project	and	Roadmap.
Where	do	you	 nd	the	project?
Landing	Page
Documentation
Support
http://drupalconsole.com/
http://bit.ly/console-book
http://bit.ly/console-support
Download	Drupal	Console
Using	the	Installer
Install	the	Console	locally	by	running	the	installer	
in	your	project	directory:
$ curl http://drupalconsole.com/installer | php
$ mv console.phar /usr/local/bin/drupal
$ drupal
Using	Composer
$ composer global require drupal/console:@stable
# download at:
# ~/.composer/vendor/drupal/console
# run it using:
$ ~/.composer/vendor/bin/console
Gitbook	-	Using	Composer
Using	Drupal	Composer
$ composer create-project
drupal-composer/drupal-project:8.x-dev
drupal8.dev
--stability dev
--no-interaction
https://github.com/drupal-composer/drupal-project
Using	a	Virtual	Machine
DrupalVM
A	VM	for	local	Drupal	development
Drupal	8	Sprint	Box
Simple	Drupal	8	Development	Environment
http://www.drupalvm.com/
https://github.com/thom8/drupal8-vagrant
Updating	the	project
Depending	on	the	download	method:
$ drupal self-update
$ console self-update
$ php console.phar self-update
Copy	con guration	 les
$ drupal init
# ~/.console/config.yml
# ~/.console/chain/sample.yml
Generate	the	code	and	 les
required	by	a	Drupal	8	module.
generate:module
generate:controller
generate:form:con g
example.routing.yml
src/Form/ExampleForm.php
src/Form/ExampleForm.php
src/Form/ExampleForm.php
generate:plugin:block
$ drupal generate:plugin:block
--module="example"
--class-name="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
Other	generators
generate:authentication:provider
generate:entity:config
generate:event:subscriber
generate:permissions
generate:plugin:field
generate:plugin:fieldformatter
generate:plugin:fieldtype
generate:plugin:fieldwidget
generate:plugin:imageeffect
generate:plugin:rest:resource
generate:plugin:rulesaction
generate:plugin:type:annotation
generate:plugin:type:yaml
generate:service
generate:theme
Interact	with	your	Drupal
installation.
site:new
site:install
container:debug
router:debug
router:debug
site:mode
site
site
site:maintenance [ON/OFF]
site:status
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
user
user
user:login:clear:attempts
user:login:url
user:password:hash
user:password:reset
Learn	Drupal	8.
Use	--learning	option
$ drupal generate:controller
--module="example"
--class-name="ExampleController"
--method-name="hello"
--route="/hello/{name}"
--learning
--no-interaction
Write	an	integration
generate:command
$ drupal generate:command
--module="example"
--class-name="HelloCommand"
--command="example:hello"
--no-interaction
webpro ler
	
https://www.drupal.org/project/webpro ler
webpro ler:benchmark
webpro ler
webprofiler:benchmark
webprofiler:export
webprofiler:list
Automate	command	execution
chain
$ drupal chain
--file=~/path/to/start-project.yml
Remote	command	execution
site:debug
$ drupal site:debug
$ drupal site:debug sample.dev
# Sites configuration files at:
# ~/.console/sites/
--target
$ drupal --target=sample.dev c:r all
Tips
#Protip	1
Use	--root	option
$ drupal --root=/var/www/drupal8.dev
#Protip	2
Use	multilanguage	feature
# ~/.console/config.yml
application:
environment: 'prod'
language: en #available: en,es,fr,hu,pt,ro
editor: vim
temp: /tmp
#Protip	3
Use	default	values
# ~/.console/config.yml
application:
...
default:
commands:
generate:
controller:
options:
module: my_current_project
#Protip	4
Disable	contributed	commands
# ~/.console/config.yml
application:
...
disable:
modules:
- broken_module_name_one
- broken_module_name_two
#Protip	5
Use	command	alias
$ drupal cache:rebuild all
$ drupal c:r all
#Protip	6
Use	--help	option
$ drupal generate:module --help
#Protip	7
Use	--generate-inline
$ drupal generate:entity:config --generate-inline
#Protip	8
Use	--generate-chain
$ drupal generate:module --generate-chain
#Protip	9
Use	--generate-doc
$ drupal webprofiler:benchmark --generate-doc
#Protip	10
Use	peco	command
$ drupal router:debug
| peco | awk -F ' ' '{print $1}' |
xargs drupal router:debug
https://github.com/peco/peco
How	to	contribute?
Getting	the	project
Fork	your	own	copy	of	the	Console	repository
Clone	your	forked	repository.
$ git clone git@github.com:[github-user]/DrupalConsole.git
Download	dependencies	using	componser.
$ cd /path/to/DrupalConsole
$ composer install
http://bit.ly/console-fork
Before	commiting	your	code
Project	code	is	PSR-2	Coding	Style.
Generated	code	is	Drupal	Coding	Style.
http://www.php-fig.org/psr/psr-2/
https://www.drupal.org/coding-standards
Code	analysis
http://bit.ly/console-insight
http://bit.ly/console-travis
PHPQA	all-in-one	Analyzer	CLI	tool
PHP	Parallel	Lint
PHP_CodeSniffer
PHPLOC
PHP	Mess	Detector
PHPUnit
https://github.com/jmolivas/phpqa
Running	PHPQA	manually
$ cd /path/to/DrupalConsole
$ phpqa analyze --files=src/
Running	PHPQA	automatically
$ vim .git/hooks/pre-commit
# Paste this:
phpqa analyze --git
jmolivas dmouse enzolutions omero danielnv18 vacho esod cordoval Sutharsan chipkaye hugronaphor
kgaut webflo czettnersandor fluxsauce greg-1-anderson lucasmingarro Crell martinfrances107 bojanz danielrose28
MiguelC301 azarzag Jaesin rpayanm iadyax alexweber mimioc revagomes Chi-teck egulias heilop
LowellMontgomery mmenavas sethfischer emacoti jeqq benjy carlosroh edutrul albertvolkman jjcarrion dasjo
joshuataylor kendallsv kostajh lussoluca stevector ysramirez brantwynn langelhc
Contributors
Spread	the	word	and	love.
@drupalconsole	|	#drupalconsole
/~drupalconsole
Roadmap
Increase	code	coverage.
Multi-site	support.
Improve	documentation	and	translations.
Improve	verbose	code-output.
Dummy	content	generation.
Milestones
https://github.com/hechoendrupal/DrupalConsole/milestones
Upcomming	implementations
Meta	tag
Rules
[Your	module	here]
Let's	work	together	to	make	
awesome	tools	even	better.
Drush	integration
https://github.com/drush-ops/drush/pull/1337
One	more	thing...
GUI	for	the	CLI.
http://drupalgenerator.com/
Questions	&	Feedback
Feel	free	to	stalk	me	or	ask	any	question	at:
@jmolivas	|	@drupalconsole

Contenu connexe

Similaire à Faster and Smarter Development with Drupal Console

From Drupal 7 to Drupal 8 - Drupal Intensive Course Overview
From Drupal 7 to Drupal 8 - Drupal Intensive Course OverviewFrom Drupal 7 to Drupal 8 - Drupal Intensive Course Overview
From Drupal 7 to Drupal 8 - Drupal Intensive Course Overview
Italo Mairo
 
Drupal Community Involvement – Drupal 社区参与
Drupal Community Involvement – Drupal 社区参与Drupal Community Involvement – Drupal 社区参与
Drupal Community Involvement – Drupal 社区参与
Johanna Lindh
 
5 Important Tools for Drupal Development
5 Important Tools for Drupal Development5 Important Tools for Drupal Development
5 Important Tools for Drupal Development
jcarrig
 

Similaire à Faster and Smarter Development with Drupal Console (20)

Console presentation
Console presentationConsole presentation
Console presentation
 
Drupal A non technical Introduction
Drupal A non technical IntroductionDrupal A non technical Introduction
Drupal A non technical Introduction
 
From Drupal 7 to Drupal 8 - Drupal Intensive Course Overview
From Drupal 7 to Drupal 8 - Drupal Intensive Course OverviewFrom Drupal 7 to Drupal 8 - Drupal Intensive Course Overview
From Drupal 7 to Drupal 8 - Drupal Intensive Course Overview
 
Why and When to use Drupal by Luc Bezier - Drupalcamp Cebu 2018
Why and When to use Drupal by Luc Bezier - Drupalcamp Cebu 2018Why and When to use Drupal by Luc Bezier - Drupalcamp Cebu 2018
Why and When to use Drupal by Luc Bezier - Drupalcamp Cebu 2018
 
Drupal 8 cli
Drupal 8 cliDrupal 8 cli
Drupal 8 cli
 
Drupal Development.pdf
Drupal Development.pdfDrupal Development.pdf
Drupal Development.pdf
 
20120314 voipdrupal-hands-on-webinar
20120314 voipdrupal-hands-on-webinar20120314 voipdrupal-hands-on-webinar
20120314 voipdrupal-hands-on-webinar
 
Drupal for beginners - Global Training Days - Cebu 2016
Drupal for beginners - Global Training Days - Cebu 2016Drupal for beginners - Global Training Days - Cebu 2016
Drupal for beginners - Global Training Days - Cebu 2016
 
Drupal in 5
Drupal in 5Drupal in 5
Drupal in 5
 
Drupal by Gaurav Boudh
Drupal by Gaurav BoudhDrupal by Gaurav Boudh
Drupal by Gaurav Boudh
 
[Srijan Wednesday Webinar] Mastering Drupal 8 Development with Drupal Console
[Srijan Wednesday Webinar] Mastering Drupal 8 Development with Drupal Console[Srijan Wednesday Webinar] Mastering Drupal 8 Development with Drupal Console
[Srijan Wednesday Webinar] Mastering Drupal 8 Development with Drupal Console
 
[HKDUG] #20151017 - BarCamp 2015 - Drupal 8 is Coming! Are You Ready?
[HKDUG] #20151017 - BarCamp 2015 - Drupal 8 is Coming! Are You Ready?[HKDUG] #20151017 - BarCamp 2015 - Drupal 8 is Coming! Are You Ready?
[HKDUG] #20151017 - BarCamp 2015 - Drupal 8 is Coming! Are You Ready?
 
Drupal Continuous Integration (European Drupal Days 2015)
Drupal Continuous Integration (European Drupal Days 2015)Drupal Continuous Integration (European Drupal Days 2015)
Drupal Continuous Integration (European Drupal Days 2015)
 
Face your fears: Drush and Aegir
Face your fears: Drush and AegirFace your fears: Drush and Aegir
Face your fears: Drush and Aegir
 
Hacking core
Hacking coreHacking core
Hacking core
 
Drupal 8 and Pantheon
Drupal 8 and PantheonDrupal 8 and Pantheon
Drupal 8 and Pantheon
 
Choosing Drupal as your Content Management Framework
Choosing Drupal as your Content Management FrameworkChoosing Drupal as your Content Management Framework
Choosing Drupal as your Content Management Framework
 
Making The Drupal Pill Easier To Swallow
Making The Drupal Pill Easier To SwallowMaking The Drupal Pill Easier To Swallow
Making The Drupal Pill Easier To Swallow
 
Drupal Community Involvement – Drupal 社区参与
Drupal Community Involvement – Drupal 社区参与Drupal Community Involvement – Drupal 社区参与
Drupal Community Involvement – Drupal 社区参与
 
5 Important Tools for Drupal Development
5 Important Tools for Drupal Development5 Important Tools for Drupal Development
5 Important Tools for Drupal Development
 

Dernier

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Dernier (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

Faster and Smarter Development with Drupal Console