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


PHP Listing::hash_gen方法代码示例

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


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

示例1: find_hash

 public function find_hash($hash, $dir)
 {
     $shell_command = "find \"{$dir}\" -! -name \\.\\*";
     $shell_result;
     exec($shell_command, $shell_result);
     foreach ($shell_result as $f) {
         if (Listing::hash_gen($f) == $hash) {
             $result = $f;
             break;
         }
     }
     # Work out the previous directory
     $dir_array = explode('/', $result);
     $previous_dir = "";
     for ($i = 0; $i < count($dir_array) - 1; $i++) {
         if ($dir_array[$i] != "") {
             $previous_dir .= "/" . $dir_array[$i];
         }
     }
     $previous_dir = Listing::hash_gen($previous_dir);
     return array('current_dir' => $result, 'previous_dir' => $previous_dir);
 }
开发者ID:rtownsend,项目名称:pitchfork,代码行数:22,代码来源:pitchfork-class-listing.php

示例2: Listing

include "includes/pitchfork-class-listing.php";
include "pitchfork-application-authenticate.php";
$search_results = new Listing();
$search_string = $_REQUEST['search'];
$search_exp = "\"*";
for ($i = 0; $i < strlen($search_string); $i++) {
    $search_exp .= "[" . strtoupper($search_string[$i]) . strtolower($search_string[$i]) . "]";
}
$search_exp .= "*\"";
$shell_command = "find " . escapeshellarg($Cfg_FolderLoc) . " -name " . $search_exp;
$shell_result;
exec($shell_command, $shell_result);
$results;
foreach ($shell_result as $f) {
    if ($f != $dir) {
        if (is_dir($f)) {
            $results['directories'][] = array('display' => end(explode('/', $f)), 'path' => $f, 'hash' => $search_results->hash_gen($f));
        } else {
            $results['files'][] = array('display' => end(explode('/', $f)), 'hash' => $search_results->hash_gen($f), 'path' => $f);
        }
    }
}
$search_index = new UserInterface();
$search_index->include_js("pitchfork-quicktime-playback.js");
$search_index->load_header();
$search_index->search_term = $search_string;
$search_index->load('search-results');
$search_index->append($search_results->print_structure($results));
$search_index->load_footer();
$search_index->return_UI();
# Part of Pitchfork.
开发者ID:rtownsend,项目名称:pitchfork,代码行数:31,代码来源:pitchfork-application-find.php

示例3: Profile

# Include the UI processor...
include 'includes/pitchfork-class-interface.php';
include 'pitchfork-application-authenticate.php';
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 {
开发者ID:rtownsend,项目名称:pitchfork,代码行数:31,代码来源:pitchfork-application-index.php


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