00f100/fcphp-shttp
Composer 安装命令:
composer require 00f100/fcphp-shttp
包简介
package security web requests
README 文档
README
Library to manipulate auth of user into HTTP env
How to install
Composer:
$ composer require 00f100/fcphp-shttp
or add in composer.json
{
"require": {
"00f100/fcphp-shttp": "*"
}
}
How to use
<?php use FcPhp\SHttp\SHttp; use FcPhp\SHttp\SEntity; use FcPhp\Session\Facades\SessionFacade; $session = SessionFacade::getInstance($_COOKIE); $entity = new SEntity(); $instance = new SHttp($_POST, $_SERVER, $entity, $session); $instance->callback('authHeaderCallback', function(ISEntity $entity, $authHeader) { $entity->setName('Header Auth'); return $entity; }); $instance->callback('authSessionCallback', function(ISEntity $entity, $authSession) { $entity->setName('Session Auth'); return $entity; }); $instance->callback('authUserPassCallback', function(ISEntity $entity, $authUserPass) { $entity->setName('User Pass Auth'); return $entity; }); $entity = $instance->get(); // PRINT: // IF HEADER AUTH: Header Auth // IF SESSION AUTH: Session Auth // IF POST AUTH: User Pass Auth echo $entity->getName();
统计信息
- 总下载量: 133
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2018-07-19