evolution7/craft-console

CraftCMS 的命令行界面。

0.2 2017-01-10 03:49 UTC

This package is not auto-updated.

Last update: 2024-09-14 17:42:58 UTC


README

#Craft Console

Craft CMS 的命令/任务运行器。这使您可以从命令行运行 Craft 的命令。

安装

此插件可以轻松添加到任何由 composer 管理的 Craft 项目中。

composer require evolution7/craft-console

##使用方法

从项目根目录运行

vendor/bin/console

或者,您可以在 composer.json 中指定一个 bin 文件夹,并从那里调用可执行文件($projectRoot/bin/console)。

    "config": {
        "bin-dir": "bin"
    },

这将列出可用的命令。

Yii command runner (based on Yii v1.1.16)
Usage: bin/console <command-name> [parameters...]

The following commands are available:
 - base
 - migrate
 - querygen
 - shell
 - sync

To see individual command help, use the following:
   bin/console help <command-name>

同步部署之间的插件

此插件包含一个示例 sync 任务,用于激活您想要在部署时运行的插件

bin/console sync plugin

此任务读取 craft/config/plugins.php 的内容,并相应地激活/停用插件

<?php
//craft/config/plugins.php
return [
    'activePlugins' => [
        'Project',
        'ArtVandelay',
        'Bugsnag',
        'Console',
        'SproutForms',
        'SproutSeo',
    ]
];

输出

$ php bin/console sync plugin
Synchronizing plugins
Plugin ArtVandelay is already active.
Installing Bugsnag plugin.
Plugin Console is already active.
Enabling Project plugin.
Plugin SproutForms is already active.
Plugin SproutSeo is already active.