[Swfed-svn] swfed-svn [459] getHeaderInfo のサンプルスクリプト

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2011年 3月 24日 (木) 20:42:47 JST


Revision: 459
          http://sourceforge.jp/projects/swfed/svn/view?view=rev&revision=459
Author:   yoya
Date:     2011-03-24 20:42:46 +0900 (Thu, 24 Mar 2011)

Log Message:
-----------
getHeaderInfo のサンプルスクリプト

Added Paths:
-----------
    trunk/sample/swfgetheaderinfo.php


-------------- next part --------------
Added: trunk/sample/swfgetheaderinfo.php
===================================================================
--- trunk/sample/swfgetheaderinfo.php	                        (rev 0)
+++ trunk/sample/swfgetheaderinfo.php	2011-03-24 11:42:46 UTC (rev 459)
@@ -0,0 +1,29 @@
+<?php
+
+if ($argc != 2) {
+	fprintf(STDERR, "Usage: swfgetheaderinfo <swf_file>\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);
+}
+
+$info = $obj->getHeaderInfo();
+
+foreach ($info as $key => $value) {
+	if (is_bool($value)) {
+	   if ($value === true) {
+	      $value = 'true';
+	   } else {
+	      $value = 'false';
+	   }
+	}
+	echo "$key: $value\n";
+}



Swfed-svn メーリングリストの案内
Back to archive index