2017 © Pedro Peláez
 

package fcphp-request

Package to manage requests

image

00f100/fcphp-request

Package to manage requests

  • Saturday, June 30, 2018
  • by 00F100
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

FcPhp Request

Package to manage requests, (*1)

Build Status codecov Total Downloads, (*2)

How to install

Composer:, (*3)

$ composer require 00f100/fcphp-request

or add in composer.json, (*4)

{
    "require": {
        "00f100/fcphp-request": "*"
    }
}

How to use

<?php

use FcPhp\Request\Request;

$request = new Request($_SERVER);

if($request->isConsole()) {
    /*

    Console Request


    $request->console = [
        'path' => $_SERVER['PWD'],
        'script-name' => $_SERVER['SCRIPT_NAME'],
        'home' => $_SERVER['HOME'],
        'lang' => $_SERVER['LANG'],
        'shell' => $_SERVER['SHELL'],
        'user' => $_SERVER['USER'],
        'username' => $_SERVER['USERNAME'],
        'params' => $_SERVER['argv'],
    ];
    */
    // Print: $request->console['path'] => $_SERVER['PWD']
    echo $request->get('path');

} else {
    /*

    Web Request


    $request->http = [
        'path' => $_SERVER['DOCUMENT_ROOT'],
        'script-name' => $_SERVER['SCRIPT_NAME'],
        'ip-client' => $_SERVER['REMOTE_ADDR'],
        'software' => $_SERVER['SERVER_SOFTWARE'],
        'server-name' => $_SERVER['SERVER_NAME'],
        'method' => $_SERVER['REQUEST_METHOD'],
        'host' => $_SERVER['HTTP_HOST'],
        'port' => $_SERVER['SERVER_PORT'],
        'uri' => $_SERVER['REQUEST_URI'],
        'user-agent' => $_SERVER['HTTP_USER_AGENT'],
        'content-type' => $_SERVER['HTTP_CONTENT_TYPE'],
        'query' => [],
        'headers' => [],
    ];
    */
    // Print: $request->http['method'] => $_SERVER['REQUEST_METHOD']
    echo $request->get('method');
}

The Versions

30/06 2018

dev-master

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

Package to manage requests

  Sources   Download

The Requires

  • php >=7.2

 

The Development Requires

request manage php7 package fcphp

30/06 2018

0.1.0

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

Package to manage requests

  Sources   Download

The Requires

  • php >=7.2

 

The Development Requires

request manage php7 package fcphp