Modern Magento Development Workflow
-
Setup
-
Development
-
Debug
-
Test
-
Bonus Tools
Setup
N98 Magerun
$ curl -o n98-magerun.phar \
https://raw.githubusercontent.com/netz98/n98-magerun/master/n98-magerun.phar
$ chmod +x ./n98-magerun.phar
$ sudo mv ./n98-magerun.phar /usr/local/bin/n98-magerun
The n98 magerun cli tools provides some handy tools to work with Magento from command line.
How to install:
Dump Database

n98-magerun db:dump
Dump Media Folder

n98-magerun media:dump
Down the Dumps

scp user@host:/path/to/the/file /local/path
Use *.dev for local sites
Dynamic Virtual Host
set $basepath "/Users/roc/Sites";
set $domain $host;
# check one name domain for simple application
if ($domain ~ "(.*\.dev$)") {
set $domain $1;
set $rootpath "${domain}";
set $servername "${domain}";
}
server_name $hostname;
root $basepath/$rootpath;
Configure Nginx / Apache to simply map domain to web root directory, so you won't need configure the web server any more when adding a new Magento site.
Check Site Configuration
n98-magerun sys:check

Development
Magento API Doc for Dash
Chrome Live Edit & Live Reload

AOE Advanced Template Hint
with Remote Call for PHPStrom
modgit add aoe_templatehhints git@github.com:AOEpeople/Aoe_TemplateHints.git

Magicento

Magicento is a PHPStorm plugin for Magento developers. Features include:
Goto for factories and template paths, autocomplete for factories, xml files and class names, documentation for xml nodes, evaluation of PHP code inside Magento environment, and much more!
Integrate Jira to PHPStorm


Code Glance for PHPStorm

Debug
AWAYS ENABLE PHP ERRORS AND TURN ON MAGENTO DEVELOPER MODE !!!
Enable PHP errors in php.ini: display_startup_errors = On; display_errors = On; html_errors = On; log_errors = On; error_log = /your/preffered/log/path/system.log; Enable Magento Developer Mode: Nginx: fastcgi_param MAGE_IS_DEVELOPER_MODE "true"; Apache: SetEnv MAGE_IS_DEVELOPER_MODE "1"
How ?
XDebug Helper for Chrome

Edit xdebug.ini:
[xdebug]
zend_extension="/usr/local/opt/php54-xdebug/xdebug.so"
xdebug.profiler_enable=0
xdebug.remote_autostart=0
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.remote_port = 9000
xdebug.idekey = "PHPSTORM"
xdebug.max_nesting_level=200
Flush Cache and Reindex
- The Fast Way
n98-magerun.phar cache:clean
n98-magerun.phar cache:flush
n98-magerun.phar index:reindex:all

Test
Virtual Machine for IE Testing
Bonus: Time Tracking
Toggl
Wakatime

Rescue Time

Modern Magento Development
By Roc Wang
Modern Magento Development
- 2,584