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


PHP Listing::find_hash方法代码示例

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


在下文中一共展示了Listing::find_hash方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: file

<?php

# Pitchfork download script
# Accepts the mask of the file (or directory) to download
# and however it want's to be downloaded.
include 'includes/pitchfork-class-listing.php';
include 'configuration/pitchfork-configuration-user.php';
//include('pitchfork-application-authenticate.php');
$listing = new Listing();
$file_temp = $listing->find_hash($_REQUEST['item'], $Cfg_FolderLoc);
$file_path = $file_temp["current_dir"];
if ($file_path) {
    $file_mime = $listing->get_mime($file_path);
    //$file_contents = $listing -> get_contents($file_path);
    $file_bytes = $listing->get_bytes($file_path);
    # Discover the file name
    $file_PathArray = explode('/', $file_path);
    //print_r($file_PathArray);
    $file_name = end($file_PathArray);
    if ($_REQUEST['mode'] == "zip") {
        $file_name .= $Cfg_CompressExt;
    }
    # IE Compatability Hack (taken from cvs.moodle.org - so thank's to them)
    if (ini_get('zlib.output_compression')) {
        ini_set('zlib.output_compression', 'Off');
    }
    # Do some headers and stuff...
    header("Accept-Ranges:bytes");
    header("Content-Length:" . $file_bytes);
    header("Content-Type:" . $file_mime);
    header("Cache-Control: public");
开发者ID:rtownsend,项目名称:pitchfork,代码行数:31,代码来源:pitchfork-application-download.php

示例2: Profile

include 'configuration/pitchfork-configuration-user.php';
include 'includes/particletree-class-profile.php';
$Profiler = new Profile();
$index_UI = new UserInterface();
include 'includes/pitchfork-class-listing.php';
$recurse = true;
if ($_REQUEST['view'] != "full") {
    $recurse = false;
}
$list = new Listing();
if (!$_REQUEST['mask']) {
    $mask = $Cfg_FolderLoc;
    $index_UI->zip_hash = Listing::hash_gen($Cfg_FolderLoc);
    $index_UI->previous_href = "";
} else {
    $context = Listing::find_hash($_REQUEST['mask'], $Cfg_FolderLoc);
    $mask = $context['current_dir'];
    $index_UI->zip_hash = $_REQUEST['mask'];
}
if ($mask != $Cfg_FolderLoc) {
    $index_UI->previous_href = "pitchfork-application-index.php?mask=" . $context['previous_dir'];
} else {
    $index_UI->previous_href = "pitchfork-application-index.php";
}
# Set a title for this page (that will appear in the browser window title and on the page)
if ($hash == $Cfg_FolderLoc) {
    $index_UI->set_page_title("Index of all files");
} else {
    $index_UI->set_page_title("Index of " . end(explode('/', $mask)));
}
# Detect the browser and see if they can be trusted with the javascript
开发者ID:rtownsend,项目名称:pitchfork,代码行数:31,代码来源:pitchfork-application-index.php


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