如何運行Magento 2命令行工具

如果瀏覽不順暢請到原文章出處:https://www.sky8g.com/technology/1012/

請注意可能會提示風險,這是csdn官網如果不是他們的網址,其他的網址都會提示有風險,這是CSDN網站設置的問題,請放心訪問,無需擔心。謝謝。

原文章出處官網:https://www.sky8g.com/technology/1012/

 

php bin/magento

下面的文章包含一個命令列表(magento help ),其中包含所有可能的用例和參數。像Admin這樣的命令組沒有任何擴展信息,因爲這是沒有意義的,因爲命令本身會顯示一些信息,並且沒有要傳遞的參數。

詳情請看官網:

 

php bin/magento

下面的文章包含一個命令列表(magento help ),其中包含所有可能的用例和參數。像Admin這樣的命令組沒有任何擴展信息,因爲這是沒有意義的,因爲命令本身會顯示一些信息,並且沒有要傳遞的參數。

vagrant@mage2:/vagrant/data/magento2/bin$ php magento

Magento CLI版本1.0.0-beta

Usage:

1

command [options] [arguments]

Options:

1

2

3

4

5

6

7

8

9

10

11

12

--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 debugging

--version (-V)        Display an application version

--ansi                Force ANSI output

--no-ansi             Disable ANSI output

--no-interaction (-n) Do not ask any interactive question

Available commands:

1

2

3

help                                      Displays help for a command

 

list                                      Lists commands

admin

1

admin:user:create                         Creates an administrator

cache

1

2

3

4

5

6

7

8

9

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

1

catalog:images:resize                     Creates resized product images

cron

1

cron:run                                  Runs jobs by schedule

dev

1

2

3

4

5

dev:css:deploy                            Collects, processes and publishes source LESS files

 

dev:tests:run                             Runs tests

 

dev:xml:convert                           Converts XML file using XSL style sheets

i18n

1

2

3

4

5

i18n:collect-phrases                      Discovers phrases in the codebase

 

i18n:pack                                 Saves language package

 

i18n:uninstall                            Uninstalls language packages

indexer

1

2

3

4

5

6

7

8

9

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

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

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-Magento 2 modules            Shows number of dependencies between Magento 2 modules

 

info:dependencies:show-Magento 2 modules-circular   Shows number of circular dependencies between Magento 2 modules

 

info:language:list                        Displays the list of available language locales

 

info:timezone:list                        Displays the list of available timezones

maintenance

1

2

3

4

5

6

7

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

1

2

3

4

5

6

7

module:disable                            Disables specified Magento 2 modules

 

module:enable                             Enables specified Magento 2 modules

 

module:status                             Displays status of Magento 2 modules

 

module:uninstall                          Uninstalls Magento 2 modules installed by composer

setup

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

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:store-config:set                    Installs the store configuration

 

setup:uninstall                           Uninstalls the Magento application

 

setup:upgrade                             Upgrades the Magento application, DB data, and schema

theme

 

1

theme:uninstall                           Uninstalls theme

管理 admin Magento 2 CLI命令

admin:user:create

創建Magento管理員用戶帳戶

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

Usage:

 

admin:user:create [--admin-user="..."] [--admin-password="..."] [--admin-email="..."] [--admin-firstname="..."] [--admin-lastname="..."] [--magento-init-params="..."]

 

Options:

 

--admin-user           (Required) Admin user

 

--admin-password       (Required) Admin password

 

--admin-email          (Required) Admin email

 

--admin-firstname      (Required) Admin first name

 

--admin-lastname       (Required) Admin last name

 

--magento-init-params  Add to any command to customize Magento initialization parameters

 

                       For example: "MAGE_MODE=developer&MAGE_DIRS[base][path]=/var/www/example.com&MAGE_DIRS[cache][path]=/var/tmp/cache"

 

--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

緩存Magento 2 CLI命令

cache:status

通過這個命令,您可以看到所有Magento 2緩存的列表,其中每個緩存都可以用於諸如clean或disable之類的緩存管理命令。

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

Current status:

 

                       config: 1

 

                       layout: 1

 

                   block_html: 1

 

          view_files_fallback: 1

 

     viewfiles_preprocessing: 1

 

                  collections: 1

 

                       db_ddl: 1

 

                          eav: 1

 

                    full_page: 1

 

                    translate: 1

 

           config_integration: 1

 

       config_integration_api: 1

 

            config_webservice: 1

 

cache:clean

按類型或全部緩存完成清除Magento 2緩存。

1

2

3

4

5

6

7

8

9

10

11

12

13

Usage:

 

cache:clean [--all] [--bootstrap="..."] [types1] ... [typesN]

 

Arguments:

 

types                 List of cache types, space separated. If omitted, all caches will be affected

 

Options:

 

--all                 All cache types

 

--bootstrap           add or override parameters of the bootstrap

 

cache:disable

禁用Magento 2種特定緩存類型或全部緩存完成。

1

2

3

4

5

6

7

8

9

10

11

12

13

Usage:

 

cache:disable [--all] [--bootstrap="..."] [types1] ... [typesN]

 

Arguments:

 

types                 List of cache types, space separated. If omitted, all caches will be affected

 

Options:

 

--all                 All cache types

 

--bootstrap           add or override parameters of the bootstrap

 

cache:flush

刷新Magento 2緩存存儲

1

2

3

4

5

6

7

8

9

10

11

12

13

Usage:

 

cache:flush [--all] [--bootstrap="..."] [types1] ... [typesN]

 

Arguments:

 

types                 List of cache types, space separated. If omitted, all caches will be affected

 

Options:

 

--all                 All cache types

 

--bootstrap           add or override parameters of the bootstrap

 

 

如果有不懂的地方請留言,SKY8G網站編輯者專注於研究IT源代碼研究與開發。希望你下次光臨,你的認可和留言是對我們最大的支持,謝謝!

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章