本文整理汇总了PHP中FileHandler::getFileHandler方法的典型用法代码示例。如果您正苦于以下问题:PHP FileHandler::getFileHandler方法的具体用法?PHP FileHandler::getFileHandler怎么用?PHP FileHandler::getFileHandler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileHandler
的用法示例。
在下文中一共展示了FileHandler::getFileHandler方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fprintf
fprintf($f, "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n");
fprintf($f, "<title>Error</title>\n");
fprintf($f, "</head>\n");
fprintf($f, "<body>\n");
fprintf($f, "<p>\n");
fprintf($f, _("File '%s' cannot be shown.") . "<br>\n%s\n", $filename, $message);
fprintf($f, "</p>\n");
fprintf($f, "</body>\n");
fprintf($f, "</html>\n");
fclose($f);
}
$targetFile = "file:///{$targetFile}";
}
// Get information of application for uploaded file.
require_once 'FileHandler.class.php';
$handler = FileHandler::getFileHandler($targetFile);
// create window object and send to nuc
$dt = new DateTime();
$date = $dt->format('Y-m-d H:i:s');
$window = array("id" => "", "win_id" => "", "name" => "", "state" => "", "file" => $targetFile, "handler" => $handler, "userid" => "", "date" => $date);
//echo "<body onLoad=\"sendToNuc('newWindow=".serialize($window)."')\" /></body>";
$serializedWindow = serialize($window);
$sw = urlencode($serializedWindow);
// Get cURL resource
$curl = curl_init();
// Set some options - we are passing in a useragent too here
curl_setopt_array($curl, array(CURLOPT_RETURNTRANSFER => 1, CURLOPT_URL => CONFIG_CONTROL_FILE . '?newWindow=' . $sw, CURLOPT_USERAGENT => 'PalMA cURL Request'));
// Send the request & save response to $resp
$resp = curl_exec($curl);
// Close request to clear up some resources
curl_close($curl);
示例2: DwbHandler
$fhandler = '/usr/bin/dwb --override-restore';
} else {
if ($ftype === 'mpg' || $ftype === 'mpeg' || $ftype === 'avi' || $ftype === 'mp3' || $ftype == "mp4") {
$fhandler = '/usr/bin/vlc --no-audio';
}
}
}
}
}
}
}
/*
alternatively with mime-types
// $ftype = mime_content_type($this->UPLOAD_PATH.$file);
// if($ftype=='application/pdf')
// if($ftype=='image/gif' || $ftype=='image/jpg' || $ftype=='image/png' )
// if($ftype=='html' || $ftype=='url' || $ftype="text/plain")
// (...)
*/
return $fhandler;
}
}
if ($unittest[__FILE__]) {
// Run unit test.
$dwbHandler = new DwbHandler();
$zathuraHandler = new ZathuraHandler();
echo "DOWNLOAD =" . FileHandler::DOWNLOAD . "\n";
echo "filehandler=" . FileHandler::getFileHandler("test.txt") . "\n";
$handler = ${'dwb' . 'Handler'};
echo "controls =" . $handler->getControls() . "\n";
}