Code Monkey home page Code Monkey logo

httpserver's People

Contributors

ahamid avatar grugnog avatar quartzjer avatar robloach avatar youngj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

httpserver's Issues

Dependency on PHP 5.4+ short array syntax

In a few places, short array syntax is used although the readme states PHP 5.3+. It would be great if the project remained < 5.4 as one reason to use a php web server for development is if you cannot upgrade to PHP 5.4 for some reason. I'll go ahead and submit a patch. I'm not sure if there are other PHP 5.4+ dependencies though.

[examples:master]$ git log --oneline -1
0aa0e41 allow sending the same HTTP header name multiple times in the same response (needed to set more than one cookie with Set-Cookie header)
[examples:master]$ php -v
PHP 5.3.20 (cli) (built: Dec 20 2012 06:20:32) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
[examples:master]$ php example_server.php 
PHP Parse error:  syntax error, unexpected '[' in /home/aaron/workspace/test/httpserver/httpserver.php on line 499
[examples:master]$ cd ..
[httpserver:master]$ find . -iname "*.php" -exec php -l {} \; | grep -v "No syntax errors"
PHP Parse error:  syntax error, unexpected '[' in ./httprequest.php on line 205
Errors parsing ./httprequest.php
PHP Parse error:  syntax error, unexpected '[' in ./httpserver.php on line 499
Errors parsing ./httpserver.php
PHP Parse error:  syntax error, unexpected '[' in ./httpresponse.php on line 88
Errors parsing ./httpresponse.php

HTTP status code messages are not passed through

I have been trying to get the tests for Drupal core to pass using the Drush runserver command, but the test below in error.test was failing because it was checking the HTTP status message, but httpserver was replacing it with the default one.

$this->assertTrue(strpos($this->drupalGetHeader(':status'), '500 Service unavailable (with message)'), t('Received expected HTTP status line.'));

According to http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6.1 localized messages are acceptable, and Apache passes them though, so I think that is the correct behavior. Hence I added code to parse out the message from the CGI and pass it through if non empty.

Naming convention

Class HttpRequest collides with the internal php class HttpRequest, thus throws an error when creating a new response

Fatal error: Uncaught exception 'HttpException' with message 'HttpRequest::__construct() expects parameter 1 to be string, resource given'

Can you consider namespsacing all classes?

In Windows Not Working

Hi,
I tried it on windows. In example_server.php i set following settings.
But when going to browser 127.0.0.1:8003, am getting Internal Server Error: php-cgi\php-cgi.exe was not found error.
function __construct() { parent::__construct(array( 'addr' => "127.0.0.1", 'port' => 8003, 'php_cgi' => "php-cgi\php-cgi.exe", )); }

In httpserver i changed $cgi_stream = fopen("cgi://{$this->php_cgi}", 'rb', false, $context); to $cgi_stream = fopen("$this->php_cgi", 'rb', false, $context); and am getting output somthing like binary data.

Can you please advice me how to setup it. Am using PHP 5.6 & win10

Tagging a v1.0.1 release on a specific hash

Hey @youngj, would you mind tagging a v1.0.1 release at this hash?
41dd2b7

That was, packagist.org will create the metadata for a new release, allowing depending projects like drush to clean up their composer.json files.

I'm sure others would appreciate another tag at the head of master as well, but I'm unfamiliar with those changes and not sure what version to bump.

If you wouldn't mind doing this (or tranfering the repo to another maintainer) it would really help keep those who depend on it from fragmenting the network graph any more than it needs to be :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.