當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CLI::displayHelp方法代碼示例

本文整理匯總了PHP中CLI::displayHelp方法的典型用法代碼示例。如果您正苦於以下問題:PHP CLI::displayHelp方法的具體用法?PHP CLI::displayHelp怎麽用?PHP CLI::displayHelp使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CLI的用法示例。


在下文中一共展示了CLI::displayHelp方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

$rename = false;
$showHeader = true;
$start = 0;
$update = false;
$options = array(0 => array('help' => 'displays this help', 'debug' => 'show debug output', 'delete' => 'delete fragments after processing', 'fproxy' => 'force proxy for downloading of fragments', 'play' => 'dump stream to stdout for piping to media player', 'rename' => 'rename fragments sequentially before processing', 'update' => 'update the script to current git version'), 1 => array('auth' => 'authentication string for fragment requests', 'duration' => 'stop recording after specified number of seconds', 'filesize' => 'split output file in chunks of specified size (MB)', 'fragments' => 'base filename for fragments', 'fixwindow' => 'timestamp gap between frames to consider as timeshift', 'manifest' => 'manifest file for downloading of fragments', 'maxspeed' => 'maximum bandwidth consumption (KB) for fragment downloading', 'outdir' => 'destination folder for output file', 'outfile' => 'filename to use for output file', 'parallel' => 'number of fragments to download simultaneously', 'proxy' => 'proxy for downloading of manifest', 'quality' => 'selected quality level (low|medium|high) or exact bitrate', 'referrer' => 'Referer to use for emulation of browser requests', 'start' => 'start from specified fragment', 'useragent' => 'User-Agent to use for emulation of browser requests'));
$cli = new CLI($options, true);
// Set large enough memory limit
ini_set("memory_limit", "512M");
// Check if STDOUT is available
if ($cli->getParam('play')) {
    $play = true;
    $quiet = true;
    $showHeader = false;
}
if ($cli->getParam('help')) {
    $cli->displayHelp();
    exit(0);
}
// Check for required extensions
$required_extensions = array("bcmath", "curl", "SimpleXML");
$missing_extensions = array_diff($required_extensions, get_loaded_extensions());
if ($missing_extensions) {
    $msg = "You have to install the following extension(s) to continue: '" . implode("', '", $missing_extensions) . "'";
    LogError($msg);
}
// Initialize classes
$cc = new cURL();
$f4f = new F4F();
$f4f->baseFilename =& $baseFilename;
$f4f->debug =& $debug;
$f4f->fixWindow =& $fixWindow;
開發者ID:Radicis,項目名稱:StreamFragmentDownloader,代碼行數:31,代碼來源:combine.php


注:本文中的CLI::displayHelp方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。