解决方案-web/gatekeeper-utils

此包已废弃,不再维护。作者建议使用bertptrs/gatekeeper-utils包。

Mako PHP框架中门卫模块的命令、过滤器和其他实用工具的集合。

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

This package is not auto-updated.

Last update: 2022-02-01 12:49:12 UTC


README

此包包含用于Mako框架认证插件门卫的工具和命令。

目前,该包包含一些命令和过滤器,如有需要,将添加更多。如有缺失功能,请随意分支并提交问题。

安装

安装使用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)激活用户账户。
  • 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     |
----------------------------------------------------------------