本文整理汇总了PHP中PluginManager::isInstalled方法的典型用法代码示例。如果您正苦于以下问题:PHP PluginManager::isInstalled方法的具体用法?PHP PluginManager::isInstalled怎么用?PHP PluginManager::isInstalled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PluginManager
的用法示例。
在下文中一共展示了PluginManager::isInstalled方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFile
function getFile($pPath)
{
$pPath = urldecode($pPath);
$filetype = $this->getFileType($pPath);
if (substr($pPath, 0, strlen(FileManager::FILESYSTEM_PLUGIN_DOWNLOAD)) === FileManager::FILESYSTEM_PLUGIN_DOWNLOAD) {
$path = substr($pPath, strlen(FileManager::FILESYSTEM_PLUGIN_DOWNLOAD) + 3);
$path = explode('/', $path);
$plugin = $path[0];
unset($path[0]);
$path = implode('/', $path);
require_once dirname(__FILE__) . '/PluginManager.php';
$pluginManager = new PluginManager($plugin);
if ($pluginManager->isInstalled($plugin)) {
$pluginManager->getView('download', $path);
}
} else {
if (substr($pPath, 0, strlen(FileManager::FILESYSTEM_PLUGIN_PUBLIC)) === FileManager::FILESYSTEM_PLUGIN_PUBLIC) {
$path = substr($pPath, strlen(FileManager::FILESYSTEM_PLUGIN_PUBLIC) + 3);
$path = dirname(dirname(__FILE__)) . '/data/' . $path;
} else {
if (substr($pPath, 0, strlen(FileManager::FILESYSTEM_PLUGIN_PRIVATE)) === FileManager::FILESYSTEM_PLUGIN_PRIVATE) {
$path = substr($pPath, strlen(FileManager::FILESYSTEM_PLUGIN_PRIVATE) + 3);
$path = $this->userFolder . '.userfiles/' . $path;
} else {
if ($this->userFiles != null) {
$path = $this->userFiles . $pPath;
} else {
die('noright');
}
}
}
if (is_dir($path)) {
ini_set("max_execution_time", 300);
$uniquid = uniqid();
$filename = $path . '_' . $uniquid . '.zip.tmpdl';
shell_exec('cd ' . $path . ' && zip -r ' . $filename . ' . -x .\\* "*/\\.*"');
header('Content-Type: application/octet-stream');
header('Content-Transfer-Encoding: Binary');
header('Content-disposition: attachment; filename="' . basename($path) . '.zip"');
if (file_exists($filename)) {
readfile($filename);
unlink($filename);
}
}
if (file_exists($path)) {
if ($filetype == "music") {
header('Content-Disposition: inline; filename="' . basename($path) . '"');
header("Content-type: audio/mpeg");
header("Content-Transfer-Encoding: binary");
//header("Content-Length: ".filesize($path).""); // Probleme mit Android App
//header('X-Pad: avoid browser bug');
header('Accept-Ranges: bytes');
// It's there to move forward/backwards in track
//header("Cache-Control: no-store, no-cache, must-revalidate");
//header("Cache-Control: post-check=0, pre-check=0", false);
//header("Pragma: no-cache");
//header("Content-Type: audio/mpeg, audio/x-mpeg, audio/x-mpeg-3, audio/mpeg3");
header("X-Sendfile: {$path}");
//readfile($path);
} else {
if ($filetype == "video") {
header('Content-Disposition: inline; filename="' . basename($path) . '"');
header("Content-Transfer-Encoding: binary");
header("X-Sendfile: {$path}");
header("Content-type: video/mp4");
header('Accept-Ranges: bytes');
// It's there to move forward/backwards in track
} else {
header('Content-Type: application/octet-stream');
header('Content-Transfer-Encoding: Binary');
header('Content-disposition: attachment; filename="' . basename($path) . '"');
readfile($path);
}
}
}
}
}