Re: Debugging custom streams

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jared Williams wrote:

Hi,
	Short version, is there any way of listing all open resources from within a PHP script? Think I may have a problem relating
to the object/resource shutdown order within PHP, but cant see which custom stream handler still has an open resource.

	Long version...

	I've been attempting to write a Zip archive class, which uses streams for providing the individual files within the archive.
Gotten to the point where this code works as expected, producing a valid zip file, with 1 deflated file named digits.txt with
1234567890 as contents.

$zip = new ZipArchive('test.zip', 'w+');

$stream = $zip->create('digits.txt');
fputs($stream, '1234567890');
fclose($stream);

$zip->close();
unset($zip);

	The problem is once go beyond 1 file per zip, as in

$zip = new ZipArchive('test.zip', 'w+');

$stream = $zip->create('digits.txt');
fputs($stream, '1234567890');
fclose($stream);

$stream = $zip->create('alpha.txt');
fputs($stream, 'abcdefghijklmnopqrstuvwxyz');
fclose($stream);

$zip->close();


I don't suppose that your closing a stream twice?
[ once with fclose() and one inside $zip->close() ]

unset($zip); I get an application exception on PHP shutdown, though the zip file is valid with 2 files.

what exactly is the exception?


Jared

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux