bertptrs/gatekeeper-utils

Mako PHP 框架中 gatekeeper 模块的命令、过滤器工具集。

v0.3.0 2017-08-16 09:39 UTC

This package is auto-updated.

Last update: 2024-09-28 01:26:55 UTC


README

本软件包包含用于Mako 框架认证插件Gatekeeper的工具和命令。

目前,软件包包含一些命令和过滤器,如果需要,还会添加更多。如果缺少功能,欢迎分支提交问题。

安装

使用composer进行安装。软件包指定了兼容的 Mako 版本,因此您无需担心使用哪个版本。

composer require bertptrs/gatekeeper-utils:*

之后,您需要将软件包注册为可加载。这已在 app/config/application.php 文件中指定。

<?php
return [
    // The rest of your config
  'packages' => [
    "core" => [
      'solutionweb\gatekeeper\utils\GatekeeperUtilsPackage',
    ],
    "cli" => [],
    "web" => [],
  ],
  // The other rest of your config
];

我建议您在 core 软件包中注册该软件包,但如果您只使用过滤器或命令,也可以分别注册在 webcli 软件包中。

可用命令

目前,支持三个命令。这些命令在插件加载时自动注册。所有命令均以 gatekeeper:: 前缀开头,以防止命名冲突。

  • user.create 命令帮助您创建新用户。
  • user.activate (de)activates user accounts.
  • user.password 可以为用户设置新密码。
  • group.create 创建新组。
  • group.member 可以在组中添加和删除成员。
  • group.delete 删除组。

有关功能和选项的更多信息,可以使用 --help 标志,如下所示

$ php app/reactor gatekeeper::user.create --help

Command:

php reactor gatekeeper::user.create

Description:

Create a new user.

Options:

----------------------------------------------------------------
| Name       | Description                          | Optional |
----------------------------------------------------------------
| noactivate | Do not activate the user by default. | true     |
----------------------------------------------------------------