Example #1
0
 public static function getData($file)
 {
     Trace::output(self::$traceID, "getData");
     //----------------------------------------------------------
     //init var
     //----------------------------------------------------------
     $chk = array("bool" => true, 'traceID' => "getData");
     //----------------------------------------------------------
     $swfheader = new swfheader($file);
     $file_swf = new File_SWF($file);
     //----------------------------------------------------------
     if ($file_swf->is_valid()) {
         $stat = $file_swf->stat();
         $fileSize = $stat['fileSize'][0];
         $swfheader->size = $fileSize;
         $chk['result'] = $swfheader;
     } else {
         $chk['bool'] = false;
         $chk['error'] = true;
         $chk['message'] = "swf was no valid";
     }
     //----------------------------------------------------------
     $chk['output'] = Trace::$output;
     //----------------------------------------------------------
     return $chk;
 }
Example #2
0
<?php

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//imports
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
require_once "Constants.php";
require_once Import::absolute(true) . "org/fecj/swfheader.php";
require_once Import::absolute(true) . "com/pear/File_SWF.php";
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//init
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
$swfheader = new swfheader($_POST['file']);
//-----------------------------------------------------------------------------
$file_swf = new File_SWF($_POST['file']);
//-----------------------------------------------------------------------------
if ($file_swf->is_valid()) {
    $stat = $file_swf->stat();
    $fileSize = $stat['fileSize'][0];
    $swfheader->size = $fileSize;
    echo json_encode($swfheader);
}
//-----------------------------------------------------------------------------