Skip to content

Instantly share code, notes, and snippets.

@mgeoffray
Created January 15, 2017 18:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgeoffray/a7a30b6b619400975a916ed44c65ed86 to your computer and use it in GitHub Desktop.
Save mgeoffray/a7a30b6b619400975a916ed44c65ed86 to your computer and use it in GitHub Desktop.
Magento 2 - Initialize development environment using n98-magerun2
function init_dev_env_mag2() {
n98mr2 deploy:mode:set developer
n98mr2 config:set dev/log/active 1
n98mr2 config:set dev/template/allow_symlink 1
n98mr2 config:set web/cookie/cookie_httponly 0
n98mr2 config:set web/cookie/cookie_path ""
n98mr2 config:set web/cookie/cookie_domain ""
n98mr2 config:set dev/js/merge_files 0
n98mr2 config:set dev/css/merge_files 0
n98mr2 config:set dev/css/merge_css_files 0
n98mr2 config:set admin/security/session_cookie_lifetime 7200
n98mr2 config:set google/analytics/active 0
n98mr2 config:set google/analytics/account ""
n98mr2 cache:clean
n98mr2 cache:enable
n98mr2 admin:user:delete --force ${MAGENTO_LOCAL_ADMIN_USERNAME}
n98mr2 admin:user:create --admin-user="${MAGENTO_LOCAL_ADMIN_USERNAME}" --admin-password="${MAGENTO_LOCAL_ADMIN_PWD}" --admin-email="${MAGENTO_LOCAL_ADMIN_EMAIL}" --admin-firstname="${MAGENTO_LOCAL_ADMIN_FIRSTNAME}" --admin-lastname="${MAGENTO_LOCAL_ADMIN_LASTNAME}"
bin/magento dev:urn-catalog:generate .idea/misc.xml
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment