PageRenderTime 9ms CodeModel.GetById 2ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/framework/experimental/pherver/proc_open_child_child.php

http://zoop.googlecode.com/
PHP | 30 lines | 14 code | 6 blank | 10 comment | 0 complexity | 663e7c28ca9263c5b11ba00feaee9e65 MD5 | raw file
 1#!/usr/bin/env php
 2<?php
 3define('zoop_dir', dirname(__file__) . '/../../framework');
 4define('app_dir', dirname(__file__));
 5include(zoop_dir . '/Zoop.php');
 6Zoop::loadLib('app');
 7
 8// echo "I am the child\n";
 9$stdin = STDIN;
10// $stdin = fopen('php://stdin','rb');
11// $stdout = fopen('php://stdout','wb');
12
13while(true)
14{
15//	$command = stream_get_contents($stdin);
16	// fwrite ($stdout , "the command is $command");
17	// echo "the command is $command";
18	
19	$message = trim(fgets($stdin, 4096));
20	
21	static $i = 1;
22	echo "$message : child $i\n";
23	// flush();
24	$i += 1;
25}
26
27// fclose($stdin);
28// fclose($stdout);
29
30exit(0);