2017 © Pedro Peláez
 

package fcphp-shttp

package security web requests

image

00f100/fcphp-shttp

package security web requests

  • Thursday, July 19, 2018
  • by 00F100
  • Repository
  • 1 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

FcPhp Security HTTP

Library to manipulate auth of user into HTTP env, (*1)

Build Status codecov Total Downloads, (*2)

How to install

Composer:, (*3)

$ composer require 00f100/fcphp-shttp

or add in composer.json, (*4)

{
    "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();

The Versions

19/07 2018

dev-master

9999999-dev https://github.com/00f100/fcphp-shttp

package security web requests

  Sources   Download

The Requires

 

The Development Requires

security requests web package

19/07 2018

0.1.0

0.1.0.0 https://github.com/00f100/fcphp-shttp

package security web requests

  Sources   Download

The Requires

 

The Development Requires

security requests web package