jasny/auth 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jasny/auth

Composer 安装命令:

composer require jasny/auth

包简介

Authentication, authorization and access control for Slim Framework and other PHP micro-frameworks

README 文档

README

jasny-banner

Jasny Auth

PHP Scrutinizer Code Quality Code Coverage Packagist Stable Version Packagist License

Authentication, authorization and access control for Slim Framework and other PHP micro-frameworks.

Features

Installation

Install using composer

composer require jasny/auth

Usage

Auth is a composition class. It takes an authz, storage, and optionally a confirmation service.

use Jasny\Auth\Auth;
use Jasny\Auth\Authz\Levels;

$levels = new Levels(['user' => 1, 'moderator' => 10, 'admin' => 100]);
$auth = new Auth($levels, new AuthStorage());

session_start();
$auth->initialize();

// Later...
if (!$auth->is('admin')) {
    http_response_code(403);
    echo "Access denied";
    exit();
}

The Auth service isn't usable until it's initialized. This should be done after the session is started.

session_start();
$auth->initialize();

Documentation

统计信息

  • 总下载量: 16.94k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 117
  • 点击次数: 17
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 113
  • Watchers: 11
  • Forks: 34
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-08-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固