吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 2525|回复: 24
收起左侧

[其他原创] 单文件PHP应用,瞬间创建文件和文件夹的图库,支持联网访问轻松管理!

[复制链接]
omar111 发表于 2025-10-6 10:00
本帖最后由 omar111 于 2025-10-6 15:16 编辑

一个单文件的 PHP 程序,通过浏览器访问,该文件夹就变成了网页版本的文件库,可以预览图片、视频、音频,以及文本文件。

非常的简单,可以说无需安装(运行 php 环境不算),就能用。

可以预览视频、音乐、全景图片,高亮显示代码,还支持幻灯片播放,修改配置文件后还能正则表达式过滤文件、添加用户名密码、上传文件等等。

[PHP] 纯文本查看 复制代码
<?php
class Config {
  public static $default = [
    'root' => '',
    'root_url_path' => null,
    'root_lock' => null,
    'start_path' => false,
    'username' => '',
    'password' => '',
    'load_images' => true,
    'load_files_proxy_php' => false,
    'load_images_max_filesize' => 1000000,
    'image_resize_enabled' => true,
    'image_resize_use_imagemagick' => false,
    'image_resize_cache' => true,
    'image_resize_cache_use_dir' => false,
    'image_resize_dimensions' => 320,
    'image_resize_dimensions_retina' => 480,
    'image_resize_dimensions_allowed' => '',
    'image_resize_quality' => 85,
    'image_resize_function' => 'imagecopyresampled',
    'image_resize_sharpen' => true,
    'image_resize_memory_limit' => 256,
    'image_resize_max_pixels' => 60000000,
    'image_resize_min_ratio' => 1.5,
    'image_resize_cache_direct' => false,
    'folder_preview_image' => true,
    'folder_preview_default' => '_filespreview.jpg',
    'menu_enabled' => true,
    'menu_max_depth' => 5,
    'menu_sort' => 'name_asc',
    'menu_cache_validate' => true,
    'menu_load_all' => false,
    'menu_recursive_symlinks' => true,
    'layout' => 'rows',
    'cache' => true,
    'cache_key' => 0,
    'clean_cache_interval' => 7,
    'clean_cache_allow_manual' => false,
    'image_cache_file' => 'cache.txt',
    'image_cache_max_last_access_time' => 90,
    'image_cache_validate_time' => true,
    'storage_path' => '_files',
    'files_include' => '',
    'files_exclude' => '',
    'dirs_include' => '',
    'dirs_exclude' => '',
    'allow_symlinks' => true,
    'get_mime_type' => false,
    'license_key' => '',
    'download_dir' => 'browser',
    'download_dir_cache' => 'dir',
    'assets' => '',
    'allow_all' => false,
    'allow_upload' => false,
    'allow_delete' => false,
    'allow_rename' => false,
    'allow_new_folder' => false,
    'allow_new_file' => false,
    'allow_duplicate' => false,
    'allow_text_edit' => false,
    'allow_zip' => false,
    'allow_unzip' => false,
    'allow_move' => false,
    'allow_copy' => false,
    'allow_download' => true,
    'allow_mass_download' => false,
    'allow_mass_copy_links' => false,
    'allow_settings' => false,
    'allow_check_updates' => false,
    'allow_tests' => true,
    'allow_tasks' => false,
    'demo_mode' => false,
    'upload_allowed_file_types' => '',
    'upload_max_filesize' => 0,
    'upload_exists' => 'increment',
    'ffmpeg_path' => 'ffmpeg',
    'imagemagick_path' => 'convert',
    'imagemagick_image_types' => 'heif, heic, tiff, tif, psd, dng',
    'use_google_docs_viewer' => false,
    'lang_default' => 'en',
    'lang_auto' => true,
    'index_cache' => false,
  ];

  // global application variables created on new Config()
  public static $version = '0.14.2';  // Files Gallery version
  public static $config = [];         // config array merged from _filesconfig.php, config.php and default config
  public static $localconfigpath = '_filesconfig.php'; // optional config file in current dir, useful when overriding shared configs
  public static $localconfig = [];    // config array from localconfigpath
  public static $storagepath;         // absolute storage path for cache, config, plugins and more, normally _files dir
  public static $storageconfigpath;   // absolute path to storage config, normally _files/config/config.php
  public static $storageconfig = [];  // config array from storage path, normally _files/config/config.php
  public static $cachepath;           // absolute cache path shortcut
  public static $__dir__;             // absolute __DIR__ path with normalized OS path
  public static $__file__;            // absolute __FILE__ path with normalized OS path
  public static $root;                // absolute root path interpolated from config root option, normally current dir
  public static $document_root;       // absolute server document root with normalized OS path
  public static $created = [];        // checks what dirs and files get created by config on ?action=tests

  // config construct created static app vars and merge configs
  public function __construct() {

    // get absolute __DIR__ and __FILE__ paths with normalized OS paths
    self::$__dir__ = Path::realpath(__DIR__);
    self::$__file__ = Path::realpath(__FILE__);

    // load local config _filesconfig.php if exists
    self::$localconfig = $this->load(self::$localconfigpath);

    // create initial config array from default and localconfig
    self::$config = array_replace(self::$default, self::$localconfig);

    // set absolute storagepath, create storage dirs if required, and load, create or update storage config.php
    $this->storage();

    // get server document root with normalized OS path
    self::$document_root = Path::realpath($_SERVER['DOCUMENT_ROOT']);

    // install.php - allow edit settings and create users from interface temporarily when file is named "install.php"
    // useful when installing Files Gallery, allows editing settings and creating users without having to modify config.php manually
    // remember to rename the file back to index.php once you have edited settings and/or created users.
    if(U::basename(__FILE__) === 'install.php') self::$config['allow_settings'] = true;

    // at this point we must check if login is required or user is already logged in, and then merge user config
    new Login();

    // assign root realpath after login user is resolved
    self::$root = Path::valid_root(self::get('root'));

    // error if root path does not exist
    if(!self::$root) U::error('Invalid root dir "' . self::get('root') . '"');

    // shortcut option `allow_all` allows all file actions (except settings, check_updates, tests, tasks)
    if(self::get('allow_all')) foreach (['upload', 'delete', 'rename', 'new_folder', 'new_file', 'duplicate', 'text_edit', 'zip', 'unzip', 'move', 'copy', 'download', 'mass_download', 'mass_copy_links'] as $k) self::$config['allow_'.$k] = true;
  }

  // public shortcut function to get config option Config::get('option')
  public static function get($option){
    return self::$config[$option];
  }

  // public get config comma-delimited string option as array
  public static function get_array($option) {
    $str = self::$config[$option];
    return !empty($str) && is_string($str) ? array_map('trim', explode(',', $str)) : [];
  }

  // load a config file and trim values / returns empty array if file doesn't exist
  private function load($path) {
    if(empty($path) || !file_exists($path)) return [];
    $config = include $path;
    if(empty($config) || !is_array($config)) return [];
    return array_map(function($v){
      return is_string($v) ? trim($v) : $v;
    }, $config);
  }


下载地址:https://wwga.lanzouq.com/iNhJx37rgrqh

版本2下载地址:https://wwga.lanzouq.com/iyITm37rhulg
运行后默认保存D盘www目录

免费评分

参与人数 4吾爱币 +10 热心值 +4 收起 理由
wuloveyou + 1 + 1 我很赞同!
xlln + 1 + 1 我很赞同!
GEMMHL + 1 + 1 欢迎分析讨论交流,吾爱破解论坛有你更精彩!
hrh123 + 7 + 1 欢迎分析讨论交流,吾爱破解论坛有你更精彩!

查看全部评分

本帖被以下淘专辑推荐:

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

bachelor66 发表于 2025-10-7 12:04
开创者 发表于 2025-10-6 17:59
这有什么不同的地方吗?我直接下载的官网的,用着也非常不错的

官网在哪?                                    
ziqiming 发表于 2025-10-6 14:44
image.png
就是在D盘运行的,一闪就没有了。

image.png

看着像是缺少DLL文件


joody 发表于 2025-10-6 11:45
mark一下,这个比我之前翻译的 ets有异曲同工之妙
ziqiming 发表于 2025-10-6 14:13
我win10专业版,闪退打开127.0.0.1:8000无法访问
 楼主| omar111 发表于 2025-10-6 14:39
ziqiming 发表于 2025-10-6 14:13
我win10专业版,闪退打开127.0.0.1:8000无法访问

放D盘运行试试
applepv 发表于 2025-10-6 14:47
我也是同样问题,,win10,,打开后,打开页面了,但程序退出,,就在D盘的,,,
开创者 发表于 2025-10-6 17:59
这有什么不同的地方吗?我直接下载的官网的,用着也非常不错的
开创者 发表于 2025-10-7 12:21

我在百度找的,看着像,不知道是不是真的,不过用了一下感觉不错。
[HTML] 纯文本查看 复制代码
https://www.files.gallery/
q314956820 发表于 2025-10-9 11:02
拒绝了你的请求
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - 52pojie.cn ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2026-6-4 06:43

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表