2017 © Pedro Peláez
 

library phpdbg-fake-request

A CLI script that will fake a HTTP request before delegating control to another PHP script

image

lawngnome/phpdbg-fake-request

A CLI script that will fake a HTTP request before delegating control to another PHP script

  • Thursday, May 26, 2016
  • by LawnGnome
  • Repository
  • 0 Watchers
  • 2 Stars
  • 19 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 4 Versions
  • 6 % Grown

The README.md

phpdbg request faker

This package provides an executable script that can be used with phpdbg to fake a web request., (*1)

Build Status, (*2)

Installation

composer require lawngnome/phpdbg-fake-request

Usage

To fake a GET request to / with public/index.php as the entry point:, (*3)

./vendor/bin/fake-request GET / public/index.php

This will launch phpdbg. The script can then be run with phpdbg's run command:, (*4)

run

Populating $_GET and $_POST

The -g and -p options allow for GET and POST variables to be sent:, (*5)

./vendor/bin/fake-request GET / public/index.php -g 'page=2'
./vendor/bin/fake-request POST / public/index.php -p 'page=2'

Values do not need to be URL encoded., (*6)

Headers

Similarly, the -H option allows for HTTP headers to be sent:, (*7)

./vendor/bin/fake-request GET / public/index.php -H 'X-Foo: bar'

Cookies

The -c option allows cookies to be sent:, (*8)

./vendor/bin/fake-request GET / public/index.php -c 'PHPSESSID=foo'

Known issues

Arbitrary POST data is unsupported

It is impossible at present to set the php://input stream up at runtime, so non-form POST data is not supported., (*9)

Feedback

Please send issues and pull requests through GitHub., (*10)

Acknowledgements

This builds on top of the excellent documentation on the phpdbg site and Symfony's equally excellent console component., (*11)

You can also e-mail me at aharvey@php.net, if you feel so inclined., (*12)

The Versions

26/05 2016

0.1.2

0.1.2.0

A CLI script that will fake a HTTP request before delegating control to another PHP script

  Sources   Download

MIT

The Requires

 

The Development Requires

26/05 2016

0.1.1

0.1.1.0

A CLI script that will fake a HTTP request before delegating control to another PHP script

  Sources   Download

MIT

The Requires

 

The Development Requires

26/05 2016

dev-master

9999999-dev

A CLI script that will fake a HTTP request before delegating control to another PHP script

  Sources   Download

MIT

The Requires

 

The Development Requires

26/05 2016

0.1.0

0.1.0.0

A CLI script that will fake a HTTP request before delegating control to another PHP script

  Sources   Download

MIT

The Requires

 

The Development Requires