Download - Prepara tu entorno para Magento 2
@osrecio@osrecio 07/11/2017
Prepara tu entorno para Magento 2
@osrecio 07/11/2017
2
@osrecio 07/11/2017
Óscar RecioMagento Lead Developer
Mi previsión de #eCommerce para 2018 es: "Deshazte de todo lo que NO venda"
@osrecio
osrecio
osrecio
osrecio.com@osrecio
@osrecio
3
07/11/2017
Interactiv4
@osrecio 07/11/2017
4
@osrecio 07/11/2017
Environment Development
Summary
and
@osrecio
5
07/11/2017
Environment
● Setup● Tools
PHPPHP-FPM
ApacheNginx
MysqlPerconaMariaDb
PHP HTTP Mysql
@osrecio
6
07/11/2017
Environment
@osrecio
7
07/11/2017
Environment
@osrecio
8
07/11/2017
Environment
@osrecio
9
07/11/2017
Environment
10
@osrecio 07/11/2017
My EnvEnvironment
11
@osrecio 07/11/2017
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew tap caskroom/cask
brew update
brew cask install iterm2
brew cask install phpstorm
brew cask info sequel-pro
brew cask install google-chrome
Tools
Terminal1 IDE ~ PHPStorm 2 DBMS3 Browser4Photoshop / Gimp / Pixelmator
Tower / Sourcetree / GitKraken
Postman / Boomerang / Soap UI
Sublime / Atom / Vim
git / tig / ssg / htop / ncdu
Environment
@osrecio
12
07/11/2017
Development
● PhpStorm● Code quality● Tools● Debug Plugins
PhpStorm CodeQuality
Tools DebugPlugins
13
@osrecio 07/11/2017
PhpStorm
Urn Catalogbin/magento dev:urn-catalog:generate .idea/misc.xml1
2
Remote PHP CLI interpreterPreferences > Languages & Frameworks > PHP : PHP Language Level and CLI Interpreter3
Code StylePreferences > Editor > Code Style > PHP : Set From PSR1,PSR24
Development
Exclude and Source Directories/bin/,/generated/, /pub/, /setup/, /var/cache/, /var/log/, /var/page_cache, /var/view_processed/vendor/, /app/code/
Basic
14
@osrecio 07/11/2017
PhpStorm
Import/Export SettingsFile > Import or Export Settings. And Repository Settings (all devs with Same config)1
2
Pluginsmagicentomagento2
3
External ToolsPreferences > Tools > External tools4
Development
Live Templatesmagento2-phpstorm-templatesphpstorm-live-templates-magento-2
Advanced
15
@osrecio 07/11/2017
PhpStormDevelopment
External Tools
16
@osrecio 07/11/2017
Development
$ composer global require phpmd/phpmd
$ composer config -g repositories.magento composer https://repo.magento.com
$ composer global require magento-ecg/coding-standard
$ composer global require magento/marketplace-eqp
$ export PATH="$PATH:$HOME/.composer/vendor/bin" #Add to .zshrc .bashrc etc
$ phpcs --config-set installed_paths $HOME/.composer/vendor/magento-ecg/coding-standard/,$HOME/.composer/vendor/magento/marketplace-eqp/
$ phpcs -i
The installed coding standards are MySource, PEAR, PHPCS, PSR1, PSR2, Squiz, Zend, Ecg, EcgM2, MEQP1 and MEQP2
PHPStormphpcsPreferences > Languages & Frameworks > PHP > Code Sniffer : ~/.composer/vendor/bin/phpcsPreferences > Editor > Inspections > PHP > PHP Code Sniffer validation: select standard from list phpmdPreferences > Languages & Frameworks > PHP > Mess Detector : ~/.composer/vendor/bin/phpmdPreferences > Editor > Inspections > PHP > PHP Code Mess Detector validation: {magento_root}/dev/tests/static/testsuite/Magento/Test/Php/_files/phpmd/ruleset.xml
Configure PHPCS / PHPMD
Code quality
17
@osrecio 07/11/2017
Development
$ vendor/bin/static-review.php hook:install dev/tools/Magento/Tools/StaticReview/pre-commit .git/hooks/pre-commit
$ composer require --dev phppro/grumphp
$ #Create grumphp.yml with your config e.g:
parameters:
git_dir: ../
tasks:
phpcs:
standard: "vendor/magento-ecg/coding-standard/EcgMg2/"
show_warnings: true
tab_width: 4
ignore_patterns: [test]
sniffs: []
phpcsfixer:
config_file: .
config: default
fixers: [-psr0]
level: psr2
verbose: true
Configure preCommits Hooks
Code quality
18
@osrecio 07/11/2017
Tools
Bash Completionmagento2-bash-completion
Development
pestleMage2gen
magento2-code-generator
Code Generation
Know more
n98-magerun2
n98-magerun
Magento Security Scan ToolMageReport
Security
19
@osrecio 07/11/2017
PluginsBefore Launch your Store
Magento2 QuickDevBar
This debug toolbar can speed up Magento2
development module
Mirasvit Profiler
Magento 2 Code Profiler and Database Profiler
Magento2 Dev Toolbar
The toolbar provides the Magento developer with four debug panels: info, layout, handles &
queries
Magento2 Zray
The Z-Ray tool from Zend Server adds to
your instance a toolbar with features for
profiling your PHP files.
Mage Chrome Toolbar
Magento Chrome Toolbar is a chrome extension to be used with MSP_DevTools for M1 or M2
Mgt Developer Toolbar
The Mgt Developer Toolbar is a must have
for Magento 2 developers and frontend guys
20
@osrecio 07/11/2017
Tips
21
@osrecio 07/11/2017
Tips and Tricks
1 Use hirak/prestissimo to parallelize downloads with composer
2 Disable the module: Magento_Version
3 Patch Magento through composer. James Cowie explains you how
4 If you do not know where to find Magento stuff, here are a couple of resources: Awesome Magento 2 y Mageres
5 Read all the #MagentoMonday that Sherrie does if you want to be up to date. They are in the Magento forums
6 Follow me on Twitter
Tips
22
@osrecio 07/11/2017
My Tips
“Pasa algún tiempo investigando y planificando tareas para dar una
estimación precisa”
Think and then estimate
“El mal no deja de estar equivocado porque la mayoría participe en el”
The Core is not the Holy Grail
“No soy un excelente programador; Soy un buen programador con
excelentes hábitos”
Test everything you can
“Los pequeños detalles son vitales. Las pequeñas cosas hacen que sucedan grandes cosas”
Every detail matters
“La satisfacción radica en el esfuerzo, no en el logro, el pleno esfuerzo es la victoria completa”
Satisfaction
“La innovación distingue a un líder de un seguidor”
Innovate
Tips
23
@osrecio 07/11/2017
One More Thing
24
@osrecio 07/11/2017
M2 InstallerOne More Thing
by Interactiv4
@osrecio 07/11/2017
¿ Preguntas ?
Gracias
@osrecio