官术网_书友最值得收藏!

The command-line utility

Magento 2.0 has a command-line utility to help developers manage installation and configuration tasks. The new command-line interface can do the following:

  • Install Magento
  • Manage the cache
  • Manage indexers
  • Configure and run cron
  • Compile code
  • Set the Magento mode
  • Set the URN highlighter
  • Create dependency reports
  • Translate dictionaries and language packages
  • Deploy static view files
  • Create symlinks to LESS files
  • Run unit tests
  • Convert layout into XML files
  • Generate data for performance testing
  • Create CSS from LESS (CSS real-time compilation)

To work with this tool, you will need to open a terminal (Linux, OS X) or command prompt (Windows) and access the <your Magento install dir>/bin directory. Then, enter with the php magento command to see all the available commands of the command-line utility:

Note

Remember to configure the PHP path to the system environment variable to execute the command. For further information, access http://php.net/manual/en/faq.installation.php.

Let's play a little bit with the utility by disabling your Magento system cache:

  • Run the php magento cache:status command. The cache will probably be enabled.
  • Run the php magento cache:disable command to disable any cache system.
    Note

    To know more about cache management in command-utility tools, access http://goo.gl/c5ivCY.

Now let's try to manage Magento indexing. Magento indexing transforms the data to improve the performance of your system by executing the following commands. Indexing technique optimizes the price calculations process, for example, and it has an important role to play in the Magento performance:

  • Run the php magento indexer:info command to view the lists of indexers
  • Run the php magento indexer:status command to view the real-time status
  • Run the php magento indexer:reindex command to rebuild the indexation

Magento indexing was successfully rebuilt, thanks to the command-line utility actions!

You can build cron jobs in a remote server to automate some Magento actions. For example, create an automation routine to re-index Magento periodically.

I strongly advise you to play more with the command-line utility. You can consult the online documentation available at http://goo.gl/iVnQSn.

主站蜘蛛池模板: 巴林左旗| 贺州市| 贵德县| 顺平县| 商洛市| 库尔勒市| 丹棱县| 呼图壁县| 长兴县| 年辖:市辖区| 云梦县| 乌鲁木齐市| 炎陵县| 米泉市| 额尔古纳市| 龙门县| 张家界市| 资中县| 谢通门县| 张家口市| 子长县| 东丽区| 崇明县| 娄烦县| 河源市| 城口县| 阳信县| 阳城县| 定兴县| 广昌县| 山西省| 成都市| 阳信县| 体育| 蓝田县| 泰来县| 中宁县| 栾川县| 文山县| 松桃| 九龙坡区|