Google Flix Engine Linux Reference Manual User Manual

Page 433

Advertising
background image

7.13 CGI

427

HTML_END;

if($incret == FALSE) {

echo "<p><b>".

"ERROR: include(’flixengine2.php’) failed.<br>".

"ERROR: This include file loads the PHP bindings for the Flix Engine.<br>".

"ERROR: Without them this sample will be unable to contact the encoding daemon.<br>".

"ERROR: See the server error log for more information.".

"</b></p>";

echo "</body></html>";

error_log("[flix2_sample.php] include(’flix2_engine.php’) failed, see ’PHP Notice’s’ above");

die;

}

echo <<<HTML_END

<p><small>flix2_sample.cgi version 1.9</small></p>

<h4>Instructions</h4>

<ul>

<li>In this sample you must choose a source file and an output file.<br>

If you leave all the other options blank then the sample will not call

the corresponding Flix Engine function and the default will be used.<br>

When done please press the "Start Encode" button at the bottom of the page.<br>

<li>Mouse over a function name to see its default, if applicable.

<li>Current source file directory: $indir

</ul>

<p>

<label><input type="checkbox" id=’showall’ onclick=’showall(this.checked)’>Show all</label>

</p>

<form action="process_sample.php" method="post">

<!-- ##SOURCE FILE########################################################### -->

<hr>

<fieldset class=’expanded’ id="srcfile">

<legend onclick=’toggle_expand(this)’>Source File</legend>

<table>

<tr>

<td>

HTML_END;

if(is_dir($indir)) {

$first= TRUE;

#let glob sort the directory contents for us

$files= glob($indir.’*’);
echo "<select name=’Flix2_SetInputFile’ size=’".(count($files)-1<15?count($files)-1:15)."’>\n";

foreach($files as $f) {

if(!is_dir($f)) {

echo "<option ";

if($first) { echo "selected "; $first=FALSE; };

echo "value=\"$f\">".str_replace($indir,’’,$f)."</option>\n";

}

}

echo "</select>";

} else {

echo "WARNING couldn’t open $indir: is_dir() returned FALSE<br>\n";

}

echo <<<HTML_END

</td>

</tr>

</table>

</fieldset>

Generated on Tue Jul 20 17:39:03 2010 for Flix Engine Linux by Doxygen

Advertising