artox-lab/fisher

1.0.9 2016-02-19 13:05 UTC

This package is auto-updated.

Last update: 2024-08-29 04:37:31 UTC


README

通过 Composer 安装

{
    "require": {
        "artox-lab/fisher": "1.0.0"
    }
}

运行 composer update

设置数据库结构

您可以使用以下命令安装此数据库结构

php init.php

并输入数据库名称、数据库用户名和用户密码。

用法

<?php

include 'vendor/autoload.php';

// Username for DB
$username = 'root';

// Password for DB
$password = '123';

// Initial class role system
 $roleSystem = \Fisher\RoleSystem::getInstance('mysql:host=localhost;charset=utf8;dbname=fisher_database', $username, $password);

// User id for db table `re_account_user`
$userId = 95;

// check rule for user
echo $roleSystem->checkAccess($userId, 'admin/catalog/products');