|
Notes |
|
|
(0005091)
|
|
jamesdlow
|
|
03-01-11 09:42
|
|
I've been fiddling around trying to make this work. It should possible with some kind of buffered input/output stream. But I actually run out of memory on my computer when I try to compile Quercus.
I've been trying with Pipes (see attached file PhpTemp.java) along with following changes to com.caucho.quercus.lib.file.PhpProtocolWrapper
if (path.equals("php://output")) [^]
return new PhpBinaryOutput(env);
else if (path.equals("php://input")) [^]
return new PhpBinaryInput(env);
else if (path.equals("php://stdout")) [^]
return new PhpStdout();
else if (path.equals("php://stderr")) [^]
return new PhpStderr();
else if (path.equals("php://stdin")) [^]
return new PhpStdin(env);
else if (path.equals("php://temp")) [^]
return new PhpTemp(env); |
|
|
|
(0005092)
|
|
jamesdlow
|
|
03-01-11 09:44
|
|
|
|
|
(0005096)
|
|
jamesdlow
|
|
03-01-11 19:43
|
|
Ok managed to get it compile without the memory errors, by compiling against the old resin.jar, and just compiling the two classes I changed. I've uploaded them, but had to rename the file PhpTemp2.java, change it back to PhpTemp.java if you download it and compile it. Though I'm not sure if its fully working or the best way to do this.
It seemed to work for the most basic of cases, but I'm still having some trouble getting my library all the time. Trying to track down if that's the same issue, or something else. |
|
|
|
(0005108)
|
|
jamesdlow
|
|
03-02-11 19:55
|
|
|
Ok, I've had a bit more of a try with my code and it seems it doesn't work. I'll keep trying, but if someone at Caucho know's how to implement this really easily do let me know. |
|
|
|
(0005117)
|
|
jamesdlow
|
|
03-04-11 00:03
|
|
Ok PhpTemp2.java seems to work, but I also had to make a change to com.caucho.vfs.WriteStream (see attached file).
in writeStream(InputStream source) I had to change the loop to include source.available() because otherwise read calls on some streams (like the PipedOutputStream I'm using) are blocking until there is date:
while (source.available() > 0 && (len = source.read(_writeBuffer,
_writeLength,
length - _writeLength)) >= 0) { |
|
|
|
(0005119)
|
|
jamesdlow
|
|
03-04-11 11:25
|
|
Hi,
I ended up using the circular buffer mentioned here (see PhpTemp3.java), because 1K with the pipeinput buffer size was too small. Please note that the modification to WriteStream.java is still required to stop read blocking when there is no more data.
http://ostermiller.org/convert_java_outputstream_inputstream.html [^]
I'm not sure if you could make something work with your existing TempInputStream/TempOutputStream classes, but I wasn't confident enough in how these work to try.
Thanks,
James |
|
|
|
(0005941)
|
|
nam
|
|
06-23-12 00:38
|
|
php/167k
php/167l
Fixed for 4.0.29. |
|