svnno****@sourc*****
svnno****@sourc*****
2011年 6月 10日 (金) 01:40:52 JST
Revision: 581 http://sourceforge.jp/projects/swfed/svn/view?view=rev&revision=581 Author: yoya Date: 2011-06-10 01:40:52 +0900 (Fri, 10 Jun 2011) Log Message: ----------- replaceActionString のテストスクリプト Added Paths: ----------- trunk/sample/swfreplaceactionstring.php -------------- next part -------------- Added: trunk/sample/swfreplaceactionstring.php =================================================================== --- trunk/sample/swfreplaceactionstring.php (rev 0) +++ trunk/sample/swfreplaceactionstring.php 2011-06-09 16:40:52 UTC (rev 581) @@ -0,0 +1,31 @@ +<?php + +if (($argc < 4) || ($argc%2 != 0)) { + fprintf(STDERR, "Usage: swfreplaceactionstring <swf_file> <from_str> <to_str> [<from_str2> <to_str2> [...]]\n"); + exit(1); +} + +$swf_filename = $argv[1]; + +$swfdata = file_get_contents($swf_filename); +$obj = new SWFEditor(); + +if ($obj->input($swfdata) == false) { + fprintf(STDERR, "input failed\n"); + exit(1); +} + +$params = array(); +for ($i=2 ; $i < $argc ; $i+=2) { + $from_str = $argv[$i]; + $to_str = $argv[$i+1]; + $params[$from_str] = $to_str; +} + +if ($obj->replaceActionString($params) == false) { + fprintf(STDERR, "replaceActionString(params) failed\n"); + exit(1); +} + + +echo $obj->output();