query($sql); while ($data = $query->fetch_assoc()) { $sha1_name = sha1($data['file_name']); $swf = $sha1_name.'.swf'; $file_loc = REPOBS.str_ireplace('/', DS, $data['file_dir']).DS.$data['file_name']; $file_loc = preg_replace("/\/\//i", "/", $file_loc); echo 'Processing ...'."\n\n"; echo $data['file_id'].'-'.$data['file_name'].' - '.$sha1_name."\n"; echo $file_loc."\n"; if (!file_exists('../../files/swfs/'.$swf.'')) { if (stripos(PHP_OS, 'Darwin') !== false) { @exec('../swftools/bin/darwin/pdf2swf -o ../../files/swfs/'.$swf.' '.$file_loc.''); } else if (stripos(PHP_OS, 'Linux') !== false) { if (PHP_INT_SIZE === 8) { // 64-bit mode @exec('../swftools/bin/linux/pdf2swf64 -o files/swfs/'.$swf.' "'.$file_loc.'"'); } else { @exec('../swftools/bin/linux/pdf2swf -o ../../files/swfs/'.$swf.' '.$file_loc.''); } } else { @exec('..\swftools\bin\windows\pdf2swf.exe -o ../../files/swfs/'.$swf.' '.$file_loc.''); } } else { echo "\n".'SWF File is already exist. Skipped.'."\n"; } echo "\n".'---------------------------------------'."\n"; } } else { header ("location:index.php"); }