定制 lawngnome/phpdbg-fake-request 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

lawngnome/phpdbg-fake-request

Composer 安装命令:

composer require lawngnome/phpdbg-fake-request

包简介

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

README 文档

README

This package provides an executable script that can be used with phpdbg to fake a web request.

Build Status

Installation

composer require lawngnome/phpdbg-fake-request

Usage

To fake a GET request to / with public/index.php as the entry point:

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

This will launch phpdbg. The script can then be run with phpdbg's run command:

run

Populating $_GET and $_POST

The -g and -p options allow for GET and POST variables to be sent:

./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.

Headers

Similarly, the -H option allows for HTTP headers to be sent:

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

Cookies

The -c option allows cookies to be sent:

./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.

Feedback

Please send issues and pull requests through GitHub.

Acknowledgements

This builds on top of the excellent documentation on the phpdbg site and Symfony's equally excellent console component.

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

统计信息

  • 总下载量: 42
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-05-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固