nyx-solutions/nyx-mercurius

NYX Mercurius WP-CLI 项目管理器

1.1.3 2022-07-02 13:25 UTC

This package is auto-updated.

Last update: 2024-08-30 01:43:50 UTC


README

NYX Mercurius 是一个用于管理 WP-CLI 项目的库。

Latest Stable Version Total Downloads Latest Unstable Version License Monthly Downloads Daily Downloads composer.lock

安装

推荐的安装方法是使用 composer

运行

php composer.phar require --prefer-dist nyx-solutions/nyx-mercurius "*"

或在您的 composer.json 文件的 require 部分添加以下内容:

"nyx-solutions/nyx-mercurius": "*"

nyx-solutions/nyx-mercurius

Mercurius 命令

全局

要使用此库中的命令,请将以下内容添加到您的 wp-config.php 文件中的常量定义之后(如果使用 use nyx\mercurius\wp\cli\Mercurius 在文件开头,则忽略 /** @noinspection PhpFullyQualifiedNameUsageInspection */):

<?php

    \nyx\mercurius\wp\cli\Mercurius::init(
        __DIR__,
        __DIR__.'/wp-project',
        'https://plugins.wpsite.tmp.br',
        'nyx',
        'passwd'
    );

最后三个参数是指向一个插件专用仓库的链接(在配置中如本例所示:%PLUGINS_REPOSITORY%/my-plugin.zip)。该仓库必须使用 BASIC 认证,并且应提供用户名和密码,分别在第二个和第三个参数中。

项目

版本

显示当前 nyx project 的版本,例如

wp nyx project version

配置

根据配置文件(wp-project/environments.json)和特定环境配置项目。基础配置文件应具有以下结构

{
  "global": {
    "update_core": true,
    "update_languages": true,
    "update_themes": true,
    "update_plugins": true,
    "default_plugins": {
      "my-plugin": "%PLUGINS_REPOSITORY%/my-plugin.zip",
      "better-wp-security": true,
      "wp-crontrol": true
    },
    "default_themes": {
      "twentytwentyone": true
    }
  },
  "development": {
    "host": "site.wpsite.tmp.br",
    "disabled_plugins": [
      "wp-crontrol"
    ]
  },
  "staging": {
    "host": "staging.wpsite.com.br",
    "disabled_plugins": [
      "wp-crontrol"
    ]
  },
  "production": {
    "host": "www.wpsite.com.br",
    "disabled_plugins": [
      "wp-crontrol"
    ]
  }
}

命令执行示例

wp nyx project configure --env=development

变更日志

1.1.3

  • ProjectCommand:对命令加载和执行的改进。
  • Mercurius:对命令加载和执行的改进。

1.1.2

  • ProjectCommand:代码中的各种修正。

1.1.1

  • ProjectCommand:在执行 plugin uninstall 命令之前,会检查插件是否已安装。

1.1.0

  • 第一个稳定版本。

许可证

nyx-mercurius 根据 BSD 3-Clause 许可证分发。有关详细信息,请参阅 LICENSE.md 文件。