- Added config option to display all layout handles at the top of the page
- Added the {tools:regenerate} command
- Refactored code and added several options to the {create:module} command
- Added the {cloud} command
- Go to your Magento root folder and run:
$ composer require hammer/wh:dev-master
- Enter your Company name, theme, store and other optional parameters in the following array, and add it to the app/etc/env.php file:
'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
- We recommend creating a system alias for "bin/magento". Example: "bm"
- If multistore, we recommend setting the "default_theme" config along with "ask_if_multistore=0"
- Enable the WH module:
$ bin/magento module:enable Hammer_WH
$ bin/magento s:up
$ bin/magento c:f
- You are good to go! You can check it was installed correctly by running:
$ bin/magento wh
- Go to your Magento root folder and run:
$ composer update hammer/wh
Note: remember to always develop in Developer mode
$ bin/magento wh --help
$ bin/magento wh options (alias op)
Show information of your Magento instance (Edition, Version, Mode, Session, Crypt Key and Install Date)
$ bin/magento wh info:m2 (alias i:m2)
$ bin/magento wh info:store (alias i:s)
- (multiselect) Type of modules
$ 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)
- (string) Name of the theme
$ bin/magento wh cache:styles (alias c:s)
$ bin/magento wh cache:all (alias c:a)
- (multiselect) Folders to remove (example: 1,3,5)
$ bin/magento wh cache:custom (alias c:cu)
$ bin/magento wh cache:admin (alias c:ad)
- (string) Name of the module
- (multiselect) Setup files (example: 1,3 to create InstallData.php and InstallSchema.php)
- (select) Feature
- Extend Block/Model class
- Create Plugin for a method
- Create frontend page to display template
- Create frontend page to display template using view_model
- Create frontend page to return JSON
- Attach Observer to Event
- Replace constructor argument
- Create new Command line
- Create REST API with ACL
- (other options) Based on the Feature selected
$ bin/magento wh create:module (alias cr:m)
- (string) Name of the theme
- (int) Theme to extend from: blank, Luma (beta) or custom
$ bin/magento wh create:theme (alias cr:t)
- (int) Quantity of categories
- (int) Quantity of products
$ bin/magento wh create:dummy (alias cr:d)
- (string) First name
- (string) Last name
- (string) Email
- (string) Password
$ bin/magento wh customer:create (alias c:cr)
- (string) Email of existing customer (autocomplete)
- (string) New password
$ bin/magento wh customer:password (alias c:p)
- (string) Email
- (string) Username
- (string) Password
$ bin/magento wh admin:create (alias a:cr)
- (string) Email of existing admin user (autocomplete)
- (string) New password
$ bin/magento wh admin:password (alias a:p)
- (string) Name of the theme
$ bin/magento wh tools:static (alias t:s)
- (string) Name of the theme
- (string) Path to the existing template (example: vendor/magento/module-checkout/view/frontend/templates/cart.phtml)
$ 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
$ bin/magento wh module:downgrade (alias m:d)
- (multiselect) Store
$ bin/magento wh tools:regenerate (alias t:r)
- (select) Name of the mode (show, developer or production)
$ bin/magento wh deploy:mode (alias d:m)
- (select) Snippet to show
$ bin/magento wh snippets (alias sn)
π§ wh@magento.com.ar