gzuncompress无法在Wordpress中运行

I'm trying to create a Wordpress site where I can place SWF files ready for QC, and I would like SWF header information displayed beside the banner.

I'm using this PHP Class

EDIT: (Code can also be found here).

It works fine out of the box and stand alone, however when I'm trying to using on a custom post type in wordpress, it gets to a call to gzuncompress and stops.

And I can't figure out why I can't use gzuncompress within wordpress.

DEBUG: Data values initialized
DEBUG: Opened http://localhost:8888/previewer/wp-content/uploads/2013/08/test.swf
DEBUG: Read MAGIC signature: CWS
DEBUG: Read VERSION: 9
DEBUG: Partial SIZE read: 177
DEBUG: Partial SIZE read: 2560
DEBUG: Partial SIZE read: 65536
DEBUG: Partial SIZE read: 0
DEBUG: Total SIZE: 68273
We need to uncompress this
This didn't uncompress
DEBUG: RECT field size: 0 bits
DEBUG: RECT binary value: (0)
DEBUG: RECT binary value: (0)
DEBUG: RECT binary value: (0)
DEBUG: RECT binary value: (0)
DEBUG: Frame rate: 0.0
DEBUG: Frames: 0
DEBUG: Finished processing http://localhost:8888/previewer/wp-content/uploads/2013/08/test.swf

Where as if I create a index.php with:

<?php

    require ("swfheader.class.edit.php") ;
    $header = "test.swf";

$swf = new swfheader(true) ;
    // Open the swf file...
    // Replace filename accordingly to your test environment...
    $swf->loadswf($header) ;
    // Show data as a block... you can also access data within the object
    $swf->show() ;
?>

My output is the following:

DEBUG: Data values initialized
DEBUG: Opened test.swf
DEBUG: Read MAGIC signature: CWS
DEBUG: Read VERSION: 9
DEBUG: Partial SIZE read: 164
DEBUG: Partial SIZE read: 3840
DEBUG: Partial SIZE read: 65536
DEBUG: Partial SIZE read: 0
DEBUG: Total SIZE: 69540
We need to uncompress this
Uncompressing....
DEBUG: RECT field size: 14 bits
DEBUG: RECT binary value: 00000000000000 (0)
DEBUG: RECT binary value: 01011101110000 (300)
DEBUG: RECT binary value: 00000000000000 (0)
DEBUG: RECT binary value: 01001110001000 (250)
DEBUG: Frame rate: 24.0
DEBUG: Frames: 1
DEBUG: Finished processing test.swf

The code seems to fall down when it gets to the gzuncompress.


From what I've managed to narrow down, is that I cannot use a URL with gzuncompress, so I need a way of working around this. :/

Sending a HTTP URL into gzuncompress would not work, as it doesn't allow remote files.

The result is that I took the $website_url and removed that from the $swf_file_location using str_replace and ran that through the swfheader.class.php

$website_url = "http://example.com/";
$swf_file = "http://example.com/test_file.swf";

$swf_test = str_replace($website_url, "", $swf_file);

$swf->loadswf($swf_test) ;

$swf->show();