Sujet : Bienvenu à Bhoa, un petit serveur HTTP très stupide

Hey smile,

Tout à l'heure, j'ai codé un petit serveur HTTP dans Hoa. Son doux patronyme est Bhoa, en hommage à http://www.boa.org, un tout petit serveur HTTP bien pratique pour de l'embarquer par exemple.

Bhoa est stupide car il ne gère que les GET actuellement, et pas encore super bien. D'un côté, je l'ai fait en 45mn … son état n'est pas encore très avancé ! Toutefois, je voulais le faire pour supprimer la partie configuration des serveurs et réécritures côté serveur dans le manuel. On a juste à faire :

$ hoa bhoa:start

et hop, on peut accéder à notre index.php avec tout qui fonctionne déjà.

Mes besoins actuels sont de tester ça sur Linux et Windows (je n'ai testé que sur Mac pour l'instant). S'il y a des braves dans la salle qui n'ont pas peur du trunk smile.

« Un handicap est le résultat d'une rencontre entre une déficience ou différence et une incapacité de la société à répondre à celle-ci. »

Re : Bienvenu à Bhoa, un petit serveur HTTP très stupide

Salut,

Sous Seven Pro 64bits (enfin tu connais mon environnement maintenant, vivement mon retour sous Debian lol ).

C:\Program Files (x86)\Zend\Apache2\htdocs\hoa\Hoa\Data\Bin>hoa Bhoa:start
string(10) "Bhoa:start"
string(4) "Bhoa"
string(5) "start"
string(12) "StartCommand"
string(9) "Start.php"
string(27) "hoa://Data/Bin/Command/Bhoa"
string(37) "hoa://Data/Bin/Command/Bhoa/Start.php"
Server is up, on tcp://localhost:8080!
Root: hoa://Application/Public/

PHP Warning:  Invalid CRT parameters detected in C:\Program Files (x86)\Zend\Apache2\htdocs\hoa\Hoa\Framework\Library\Socket\Connection\Server.php on line 247
PHP Warning:  Invalid CRT parameters detected in C:\Program Files (x86)\Zend\Apache2\htdocs\hoa\Hoa\Framework\Library\Socket\Connection\Server.php on line 247
PHP Warning:  Invalid CRT parameters detected in C:\Program Files (x86)\Zend\Apache2\htdocs\hoa\Hoa\Framework\Library\Socket\Connection\Server.php on line 247
PHP Notice:  Undefined property: Hoa\Http\Request::$_host in C:\Program Files (x86)\Zend\Apache2\htdocs\hoa\Hoa\Framework\Library\Http\Request.php on line 414
Ôå? GET  (waitingÔǪ)PHP Notice:  Undefined variable: env in hoa://Data/Bin/Command/Bhoa/Start.php on line 175
PHP Warning:  proc_open(): CreateProcess failed, error code - 267 in hoa://Data/Bin/Command/Bhoa/Start.php on line 175
PHP Warning:  stream_get_contents() expects parameter 1 to be resource, null given in hoa://Data/Bin/Command/Bhoa/Start.php on line 176
PHP Warning:  fclose() expects parameter 1 to be resource, null given in hoa://Data/Bin/Command/Bhoa/Start.php on line 177
PHP Warning:  proc_close() expects parameter 1 to be resource, boolean given in hoa://Data/Bin/Command/Bhoa/Start.php on line 178
Ô£ô GET
PHP Warning:  Invalid CRT parameters detected in C:\Program Files (x86)\Zend\Apache2\htdocs\hoa\Hoa\Framework\Library\Socket\Connection\Server.php on line 247
PHP Warning:  Invalid CRT parameters detected in C:\Program Files (x86)\Zend\Apache2\htdocs\hoa\Hoa\Framework\Library\Socket\Connection\Server.php on line 247
Ôå? GET favicon.ico (waitingÔǪ)PHP Notice:  Undefined variable: env in hoa://Data/Bin/Command/Bhoa/Start.php on line 175
PHP Warning:  proc_open(): CreateProcess failed, error code - 267 in hoa://Data/Bin/Command/Bhoa/Start.php on line 175
PHP Warning:  stream_get_contents() expects parameter 1 to be resource, null given in hoa://Data/Bin/Command/Bhoa/Start.php on line 176
PHP Warning:  fclose() expects parameter 1 to be resource, null given in hoa://Data/Bin/Command/Bhoa/Start.php on line 177
PHP Warning:  proc_close() expects parameter 1 to be resource, boolean given in hoa://Data/Bin/Command/Bhoa/Start.php on line 178
Ô£ô GET favicon.ico
PHP Warning:  Invalid CRT parameters detected in C:\Program Files (x86)\Zend\Apache2\htdocs\hoa\Hoa\Framework\Library\Socket\Connection\Server.php on line 247
PHP Warning:  Invalid CRT parameters detected in C:\Program Files (x86)\Zend\Apache2\htdocs\hoa\Hoa\Framework\Library\Socket\Connection\Server.php on line 247
Ôå? GET favicon.ico (waitingÔǪ)PHP Notice:  Undefined variable: env in hoa://Data/Bin/Command/Bhoa/Start.php on line 175
PHP Warning:  proc_open(): CreateProcess failed, error code - 267 in hoa://Data/Bin/Command/Bhoa/Start.php on line 175
PHP Warning:  stream_get_contents() expects parameter 1 to be resource, null given in hoa://Data/Bin/Command/Bhoa/Start.php on line 176
PHP Warning:  fclose() expects parameter 1 to be resource, null given in hoa://Data/Bin/Command/Bhoa/Start.php on line 177
PHP Warning:  proc_close() expects parameter 1 to be resource, boolean given in hoa://Data/Bin/Command/Bhoa/Start.php on line 178
Ô£ô GET favicon.ico
PHP Warning:  Invalid CRT parameters detected in C:\Program Files (x86)\Zend\Apache2\htdocs\hoa\Hoa\Framework\Library\Socket\Connection\Server.php on line 247
PHP Warning:  Invalid CRT parameters detected in C:\Program Files (x86)\Zend\Apache2\htdocs\hoa\Hoa\Framework\Library\Socket\Connection\Server.php on line 247
Ôå? GET favicon.ico (waitingÔǪ)PHP Notice:  Undefined variable: env in hoa://Data/Bin/Command/Bhoa/Start.php on line 175
PHP Warning:  proc_open(): CreateProcess failed, error code - 267 in hoa://Data/Bin/Command/Bhoa/Start.php on line 175
PHP Warning:  stream_get_contents() expects parameter 1 to be resource, null given in hoa://Data/Bin/Command/Bhoa/Start.php on line 176
PHP Warning:  fclose() expects parameter 1 to be resource, null given in hoa://Data/Bin/Command/Bhoa/Start.php on line 177
PHP Warning:  proc_close() expects parameter 1 to be resource, boolean given in hoa://Data/Bin/Command/Bhoa/Start.php on line 178
Ô£ô GET favicon.ico
PHP Warning:  Invalid CRT parameters detected in C:\Program Files (x86)\Zend\Apache2\htdocs\hoa\Hoa\Framework\Library\Socket\Connection\Server.php on line 247
PHP Warning:  Invalid CRT parameters detected in C:\Program Files (x86)\Zend\Apache2\htdocs\hoa\Hoa\Framework\Library\Socket\Connection\Server.php on line 247

3

Re : Bienvenu à Bhoa, un petit serveur HTTP très stupide

Ok merci. Je vais regarder ça smile.

« Un handicap est le résultat d'une rencontre entre une déficience ou différence et une incapacité de la société à répondre à celle-ci. »

Re : Bienvenu à Bhoa, un petit serveur HTTP très stupide

Je suis sous seven Entreprise 64 bit :

En console normal :

C:\Users\Joey>hoa bhoa:start
Server is up, on tcp://localhost:8080!
Root: hoa://Application/Public/

Puis boucle sur :

PHP Warning:  Invalid CRT parameters detected in C:\wamp\www\Hoa\Framework\Library\Socket\Connection\Server.php on line 247
PHP Stack trace:
PHP   1. {main}() C:\wamp\www\Hoa\Data\Bin\Hoa.php:0
PHP   2. Hoa\Console\Console->dispatch() C:\wamp\www\Hoa\Data\Bin\Hoa.php:58
PHP   3. Hoa\Console\Dispatcher->dispatch() C:\wamp\www\Hoa\Framework\Library\Console\Console.php:248
PHP   4. StartCommand->main() C:\wamp\www\Hoa\Framework\Library\Console\Dispatcher.php:184
PHP   5. Hoa\Socket\Connection\Server->select() hoa://Data/Bin/Command/Bhoa/Start.php:140
PHP   6. stream_select() C:\wamp\www\Hoa\Framework\Library\Socket\Connection\Server.php:247


Warning: Invalid CRT parameters detected in C:\wamp\www\Hoa\Framework\Library\Socket\Connection\Server.php on line 247



Et par contre si je lance la commande sous Windows PowerShell Modules :

aucun echo dans la console par contre il me demande de choisir un programme, je prend IE par exemple.
Le navigateur se lance avec l'adresse C:\wamp\www\_iZite\Data\Bin\hoa et donc m'affiche le fichier hoa en clair.


Bon courage wink

" L'imagination est plus importante que la connaissance. La connaissance est limitée alors que l'imagination englobe le monde entier, stimule le progrès, suscite l'évolution. " - Life in the cloud :: Getting Started with Hoa - Hoa débutant

5

Re : Bienvenu à Bhoa, un petit serveur HTTP très stupide

Oui, c'est un effet de bord du non support de je-ne-sais-pas-quoi. Je vais me pencher là-dessus.

« Un handicap est le résultat d'une rencontre entre une déficience ou différence et une incapacité de la société à répondre à celle-ci. »

6

Re : Bienvenu à Bhoa, un petit serveur HTTP très stupide

Est-ce que le problème du CRT existe encore sur Windows ?
Quelle version de PHP avez-vous exactement ? Merci.

« Un handicap est le résultat d'une rencontre entre une déficience ou différence et une incapacité de la société à répondre à celle-ci. »

Re : Bienvenu à Bhoa, un petit serveur HTTP très stupide

http://msdn.microsoft.com/fr-fr/library/ws0swas0.aspx

PHP 5.3.4 (64bit) il me semble pour ma part

Dernière fois dit par Ecureuil Virtuel (11 Mar. 2011 14:32)

" L'imagination est plus importante que la connaissance. La connaissance est limitée alors que l'imagination englobe le monde entier, stimule le progrès, suscite l'évolution. " - Life in the cloud :: Getting Started with Hoa - Hoa débutant

8

Re : Bienvenu à Bhoa, un petit serveur HTTP très stupide

Un ami à tester avec Windows 7 en 64bits et le problème n'est pas apparu. Je lui ai installé PHP5.3.5.

« Un handicap est le résultat d'une rencontre entre une déficience ou différence et une incapacité de la société à répondre à celle-ci. »

9

Re : Bienvenu à Bhoa, un petit serveur HTTP très stupide

@Ecureuil Virtuel Et ça fonctionne ?

« Un handicap est le résultat d'une rencontre entre une déficience ou différence et une incapacité de la société à répondre à celle-ci. »

Re : Bienvenu à Bhoa, un petit serveur HTTP très stupide

PHP fonctionne parfaitement.
Tu veux savoir si CRT fonctionne (i don't know)

" L'imagination est plus importante que la connaissance. La connaissance est limitée alors que l'imagination englobe le monde entier, stimule le progrès, suscite l'évolution. " - Life in the cloud :: Getting Started with Hoa - Hoa débutant