Post on 14-Apr-2017
Who am I?Ron NorthcuttSolutions Architect, Acquia
● using Drupal since 4.7 (circa 2006)● freelance developer● small dev shop● sr. developer & tech lead● solutions architect
Find me online:
https://www.drupal.org/u/rlnorthcutt
https://www.linkedin.com/in/rlnorthcutt
https://twitter.com/rlnorthcutt
https://plus.google.com/+RonNorthcutt
Agenda● Setup all the dev tools● Review CLI commands● Create a sample module● Explore tools● Chrome extensions
DD2 and PHPStorm 1/7● Dev Desktop 2
https://www.acquia.com/products-services/dev-desktop○ full LAMP stack with configurable PHP versions○ includes drush○ includes PHPMyAdmin○ integration with Acquia Cloud
● PHPStormhttp://www.jetbrains.com/phpstorm/
○ free 30 day trial then $90, or ○ possible free license for OSS projects○ http://confluence.jetbrains.com/display/PhpStorm/Drupal+Development+using+PhpStorm
Xdebug 2/7Xdebug setup instructions: https://docs.acquia.com/dev-desktop/sites/phpstorm
1. Edit php.ini 2. Restart apache3. Configure PHPStorm to use Xdebug4. Add your site as a project5. Configure remote debug
Drupal Console 3/7Drupal console setup instructions: https://drupalconsole.com/
1. Download the latest Console version:curl https://drupalconsole.com/installer -L -o drupal.phar
2. Make it accessible anywhere on your system:mv drupal.phar /usr/local/bin/drupal
3. Apply executable permissions on the downloaded file:chmod +x /usr/local/bin/drupal
4. Copy configuration files to user home directory:drupal init [--override]
5. List all available commands:drupal list
Composer Manager 4/7Composer Manager project page:https://www.drupal.org/project/composer_manager
“Composer expects each project (Drupal installation, in our case) to have a single composer.json file listing all required packages. Composer Manager allows each contributed module to ship with its own composer.json file, listing the module-specific requirements. It then merges the requirements of all found modules into the consolidated composer.json file. This results in a single vendor/ directory shared across all modules which prevents code duplication and version mismatches.”
1. drush dl composer_manager -y2. drush en composer_manager -y3. composer drupal-update --no-dev
Devel and Webprofiler 5/7Devel project page:https://www.drupal.org/project/devel
DevelHelper functions for Drupal developers and inquisitive admins. Enable the included Kint submodule as for pretty print of
variables. kint($array) function is provided, which pretty prints arrays. Useful during development. Similarly, a
ddebug_backtrace() is offered.
WebProfiler (D8+)
Add a powerful footer to all pages of your site. There, admins can review resource utilization, cache effectiveness,
database queries, Views, and so much more.
1. drush dl devel -y2. drush en devel webprofiler -y3. optional : install additional js libraries for webprofiler (see status page)
Xhprof 6/7Xhprof setup instructions: https://docs.acquia.com/articles/xhprof-acquia-dev-desktop-mac-osx
1. Edit php.ini 2. Restart apache3. Create output directory for data4. Install and enable the xhprof module5. Configure the module
Chrome Extensions 7/7
1. Setup PHPStorm Xdebug Chrome extensionhttps://confluence.jetbrains.com/display/PhpStorm/Configure+Xdebug+Helper+for+Chrome+to+be+used+with+PhpStorm
2. Setup Acquia Log Viewer Chrome extensionhttps://dev.acquia.com/blog/announcing-the-acquia-cloud-log-streaming-chrome-extension/11/01/2016/8396
Drush● update core and contrib● download modules● enable modules● clear cache● update db● run cron● import config● export config
● create user● change password● one time login● backup drupal● restore drupal● compile twig templates
● type “drush” to get a full list● http://www.drushcommands.com/
Drupal Console● update modules and core● download modules● enable modules● clear cache● update db● run cron● import config● export config
● generate console command● generate entity● generate content type● generate module● run unit tests
● type “drupal list” for a full list● https://drupalconsole.com/docs
HomeworkThis webinar is intended to introduce you to these developer tools, and help you get them setup for your use. However, there is still plenty of work you need to do to learn how to use them. Some suggested homework to help you:
● Start using these tools in your daily work● Help to test and port modules● Create a new module or theme● Help someone else get these tools setup
● Dive into PHPStorm’s features● Learn one new CLI command a day● Blog about your experiences● Present a session at a DUG or Camp