RE: Debugging custom streams

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

 



 

> -----Original Message-----
> From: Jochem Maas [mailto:jochem@xxxxxxxxxxxxx] 
> Sent: 10 February 2006 14:17
> To: Jared.Williams@xxxxxxxxxxxx
> Cc: php-general@xxxxxxxxxxxxx
> Subject: Re:  Debugging custom streams
> 
> 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() ]

$zip->close() doesn't (yet) ensure that internal streams are closed. So don't think it can be that.

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

---------------------------
php.exe - Application Error
---------------------------
The instruction at "0x100ac22f" referenced memory at "0x0000004c". The memory could not be "read". 
Click on OK to terminate the program
Click on CANCEL to debug the program
---------------------------
OK   Cancel   
---------------------------

-- 
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