当前位置: 首页>>代码示例>>PHP>>正文


PHP PluginManager::getView方法代码示例

本文整理汇总了PHP中PluginManager::getView方法的典型用法代码示例。如果您正苦于以下问题:PHP PluginManager::getView方法的具体用法?PHP PluginManager::getView怎么用?PHP PluginManager::getView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PluginManager的用法示例。


在下文中一共展示了PluginManager::getView方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
                 }
             }
         }
     }
 }
开发者ID:michaelsoftware1997,项目名称:vision-server,代码行数:77,代码来源:FileManager.php

示例2: dirname

require dirname(dirname(__FILE__)) . '/includes/LoginManager.php';
if (!empty($_GET['plugin'])) {
    if (!empty($_GET['page'])) {
        $page = $_GET['page'];
    } else {
        $page = 'home';
    }
    if (!empty($_GET['cmd'])) {
        $cmd = $_GET['cmd'];
    } else {
        $cmd = '';
    }
    if (empty($loginManager->getShareManager()) || $loginManager->getShareManager()->isAllowed($_GET['plugin'], $page, $cmd)) {
        ob_start();
        $pluginManager = new PluginManager($_GET['plugin']);
        $pluginManager->getView($page);
        $out = ob_get_contents();
        ob_end_clean();
        $out = str_replace("\r\n", "", $out);
        $out = str_replace("\t", "", $out);
        $out = str_replace(" :", ":", $out);
        $out = str_replace(": ", ":", $out);
        $out = str_replace(" ,", ",", $out);
        $out = str_replace(", ", ",", $out);
        $out = str_replace(" }", "}", $out);
        $out = str_replace("} ", "}", $out);
        $out = str_replace(" {", "{", $out);
        $out = str_replace("{ ", "{", $out);
        echo $out;
    }
    if (!$loginManager->getShareManager()->isShared()) {
开发者ID:michaelsoftware1997,项目名称:vision-server,代码行数:31,代码来源:plugin.php


注:本文中的PluginManager::getView方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。