我正在尝试创建一个Wordpress网站,我可以在其中放置准备好QC的SWF文件,我希望横幅旁边显示SWF标题信息。
我正在使用this PHP Class
编辑:(也可以找到代码here)。
它开箱即用并且独立运行,但是当我尝试在wordpress中使用自定义帖子类型时,它会调用gzuncompress并停止。
我无法弄清楚为什么我不能在wordpress中使用gzuncompress。
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
我好像创建了一个index.php:
<?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() ;
?>
我的输出如下:
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
当它到达gzuncompress时,代码似乎会掉下来。
从我设法缩小的范围来看,我不能使用带有gzuncompress的URL,所以我需要一种解决方法。 :/
答案 0 :(得分:1)
将HTTP URL发送到gzuncompress是行不通的,因为它不允许使用远程文件。
结果是我使用了$ website_url并使用str_replace从$ swf_file_location中删除了它并通过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();