bolt80/stupidhttp 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

bolt80/stupidhttp

Composer 安装命令:

composer require bolt80/stupidhttp

包简介

A stupid and simple development HTTP server.

README 文档

README

As the name indicates, StupidHttp is a very simple (and not very smart) HTTP library for PHP. It only supports one client, and implements only the minimum features of the HTTP spec (and probably even less). However, it's a very helpful library to have if you want to quickly preview a static website locally, or if you want your application to feature a development web server.

Quick Start

Here's a very quick example:

require 'vendor/bolt80/stupidhttp/lib/StupidHttp/Autoloader.php';
StupidHttp_Autoloader::register();

$server = new StupidHttp_WebServer('www_root', 8080);
$server->on('GET', '/')->call(function ($r) { echo 'Hello world!'; });
$server->run(array('run_browser' => true));

What this does:

  • includes and registers the StupidHttp auto-loader
  • creates a new webserver on port 8080 with a static files root directory set to www_root (relative to the current working directory).
  • defines a route that will respond Hello world! when a client requests the website's root.
  • runs the default browser.

Examples

StupidHttp ships with a few examples, appropriately located in the examples directory. Just run the PHP file from the command-line and you should see a simple web application show up in your default browser.

Other Resources

For more information, documentation and examples, check out the StupidHttp website.

统计信息

  • 总下载量: 2.28k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 18
  • 点击次数: 1
  • 依赖项目数: 4
  • 推荐数: 0

GitHub 信息

  • Stars: 15
  • Watchers: 2
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2012-05-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固