Magento 2 命令行

Magento Alan 5年前 (2016-08-17) 4141次浏览 0个评论 扫描二维码

在Magento 2中可通过命令行来进行相当一部分的操作,如清除缓存、重新索引页面等。进入安装路径的bin目录下,输入php magento –list即可看到相对应的命令:

 command [options] [arguments]

 --help (-h)           Display this help message
 --quiet (-q)          Do not output any message
 --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
 --version (-V)        Display this application version
 --ansi                Force ANSI output
 --no-ansi             Disable ANSI output
 --no-interaction (-n) Do not ask any interactive question

Available commands:
 help                                      Displays help for a command
 list                                      Lists commands
 admin:user:create                         Creates an administrator
 admin:user:unlock                         Unlock Admin Account
 cache:clean                               Cleans cache type(s)
 cache:disable                             Disables cache type(s)
 cache:enable                              Enables cache type(s)
 cache:flush                               Flushes cache storage used by cache type(s)
 cache:status                              Checks cache status
 catalog:images:resize                     Creates resized product images
 cron:run                                  Runs jobs by schedule
 customer:hash:upgrade                     Upgrade customer's hash according to the latest algorithm
 deploy:mode:set                           Set application mode.
 deploy:mode:show                          Displays current application mode.
 dev:source-theme:deploy                   Collects and publishes source files for theme.
 dev:tests:run                             Runs tests
 dev:urn-catalog:generate                  Generates the catalog of URNs to *.xsd mappings for the IDE to highlight xml.
 dev:xml:convert                           Converts XML file using XSL style sheets
 i18n:collect-phrases                      Discovers phrases in the codebase
 i18n:pack                                 Saves language package
 i18n:uninstall                            Uninstalls language packages
 indexer:info                              Shows allowed Indexers
 indexer:reindex                           Reindexes Data
 indexer:set-mode                          Sets index mode type
 indexer:show-mode                         Shows Index Mode
 indexer:status                            Shows status of Indexer
 info:adminuri                             Displays the Magento Admin URI
 info:backups:list                         Prints list of available backup files
 info:currency:list                        Displays the list of available currencies
 info:dependencies:show-framework          Shows number of dependencies on Magento framework
 info:dependencies:show-modules            Shows number of dependencies between modules
 info:dependencies:show-modules-circular   Shows number of circular dependencies between modules
 info:language:list                        Displays the list of available language locales
 info:timezone:list                        Displays the list of available timezones
 maintenance:allow-ips                     Sets maintenance mode exempt IPs
 maintenance:disable                       Disables maintenance mode
 maintenance:enable                        Enables maintenance mode
 maintenance:status                        Displays maintenance mode status
 module:disable                            Disables specified modules
 module:enable                             Enables specified modules
 module:status                             Displays status of modules
 module:uninstall                          Uninstalls modules installed by composer
 sampledata:deploy                         Deploy sample data modules
 sampledata:remove                         Remove all sample data packages from composer.json
 sampledata:reset                          Reset all sample data modules for re-installation
 setup:backup                              Takes backup of Magento Application code base, media and database
 setup:config:set                          Creates or modifies the deployment configuration
 setup:cron:run                            Runs cron job scheduled for setup application
 setup:db-data:upgrade                     Installs and upgrades data in the DB
 setup:db-schema:upgrade                   Installs and upgrades the DB schema
 setup:db:status                           Checks if DB schema or data requires upgrade
 setup:di:compile                          Generates DI configuration and all non-existing interceptors and factories
 setup:di:compile-multi-tenant             Generates all non-existing proxies and factories, and pre-compile class definitions, inheritance information and plugin definitions
 setup:install                             Installs the Magento application
 setup:performance:generate-fixtures       Generates fixtures
 setup:rollback                            Rolls back Magento Application codebase, media and database
 setup:static-content:deploy               Deploys static view files
 setup:store-config:set                    Installs the store configuration
 setup:uninstall                           Uninstalls the Magento application
 setup:upgrade                             Upgrades the Magento application, DB data, and schema
 theme:uninstall                           Uninstalls theme

如查看缓存状态,仅需输入php magento cache:status

Magento 2 命令行

喜欢 (1)
分享 (0)

表情 贴图 加粗 删除线 居中 斜体 签到


  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址