05/07
2018
It creates a new shell command with a handful of M2 tools
$ composer require hammer/wh:dev-master
'wh' => array ( 'company_name' => 'CompanyName', // required, where you place your modules (app/code/[CompanyName] or extensions/[CompanyName]) 'default_theme' => 'CompanyName/ThemeName', // required, theme you're currently working on 'default_store' => 'Default Store View', // required, store you're currently working on 'localization' => 'en_US', // default localization code 'composer_files' => 1, // 1 or 0, 1 creates a composer.json on new modules 'module_version' => '0.0.1', // default version of new modules 'dummy_categories' => 1, // default qty of dummy categories 'dummy_products' => 1, // default qty of dummy products 'view_product_link' => 1, // 1 or 0, 1 shows 'View Product' link on Admin 'ask_if_multistore' => 0, // 1 or 0, 1 asks for desired theme/store if multistore 'save_db_folder' => 'var/dump', // folder to save the database dump 'display_handles' => 0, // display all layout handles at the top of all pages 'admin_credentials' => 'username::password', // display credentials on the admin login page 'magento_cloud' => 0, // 1 or 0, 1 if using Magento Cloud 'magento_cloud_project_id' => '', // magento cloud project ID, if any 'magento_command' => 'bin/magento' // magento command line )
Notes for faster development 1) We recommend creating a system alias for "bin/magento". Example: "bm" 2) If multistore, we recommend setting the "default_theme" config along with "ask_if_multistore=0", (*1)
$ bin/magento module:enable Hammer_WH $ bin/magento s:up $ bin/magento c:f
$ bin/magento wh
$ composer update hammer/wh
Note: remember to always develop in Developer mode, (*2)
$ bin/magento wh --help
$ bin/magento wh options (alias op)
$ bin/magento wh info:m2 (alias i:m2)
$ bin/magento wh info:store (alias i:s)
$ bin/magento wh info:modules (alias i:m)
$ bin/magento wh cache:templates (alias c:t)
$ bin/magento wh cache:layouts (alias c:l)
$ bin/magento wh cache:config (alias c:c)
$ bin/magento wh cache:layouts (alias c:v)
$ bin/magento wh cache:generated (alias c:g)
$ bin/magento wh cache:styles (alias c:s)
$ bin/magento wh cache:all (alias c:a)
$ bin/magento wh cache:custom (alias c:cu)
$ bin/magento wh cache:admin (alias c:ad)
$ bin/magento wh create:module (alias cr:m)
$ bin/magento wh create:theme (alias cr:t)
$ bin/magento wh create:dummy (alias cr:d)
$ bin/magento wh customer:create (alias c:cr)
$ bin/magento wh customer:password (alias c:p)
$ bin/magento wh admin:create (alias a:cr)
$ bin/magento wh admin:password (alias a:p)
$ bin/magento wh tools:static (alias t:s)
$ bin/magento wh override:template (alias o:t)
$ bin/magento wh hints:on (alias h:on)
$ bin/magento wh hints:off (alias h:off)
$ bin/magento wh cloud Select a Magento Cloud command for the project: [0 ] See project info [1 ] See your account info [2 ] See all users [3 ] See all envs [4 ] See env info [5 ] See env URLs [6 ] See env logs [7 ] See env activity (last 10) [8 ] Create branch [9 ] Activate env [10] Download dump of env database [11] Get command to connect to env through SSH
$ bin/magento wh dump
(useful after changing branches) * (string) Name of the existing module, (*3)
$ bin/magento wh module:downgrade (alias m:d)
$ bin/magento wh tools:regenerate (alias t:r)
$ bin/magento wh deploy:mode (alias d:m)
$ bin/magento wh snippets (alias sn)
:email: wh@magento.com.ar, (*4)
, (*5)