terremoth/php-win32-filepicker 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

terremoth/php-win32-filepicker

最新稳定版本:v1.0.2

Composer 安装命令:

composer require terremoth/php-win32-filepicker

包简介

Use native Windows Explorer File Selector to select a file on PHP

README 文档

README

Calls Windows Explorer to select file(s).

You are able to configure to select 1 or multiple files, filtering by extensions or let the user free to choose any.

Unlocked by the power of PHP's FFI

Not because we must do it, but because we can!

Made by Terremoth with ⚡ & ❤

Test Run Status License Latest Stable Version Total Downloads Dynamic JSON Badge OpenSSF Scorecard

codecov Test Coverage Psalm type coverage Psalm level Codacy Badge Maintainability

Installation

composer require terremoth/php-win32-filepicker

Documentation

require_once 'vendor/autoload.php';

use Terremoth\Win32\FilePicker;

$selectedDirectory = $_SERVER['USERPROFILE'] ?? 'C:\\'; // optional

$fp = new FilePicker($selectedDirectory); // $selectedDirectory can be null without problem.

// all methods below are *optional*:
$fp
    ->selectMultipleFiles()
    ->addExtensionsFilter(['png', 'jpg', 'gif', 'avif', 'webp', 'jpeg', 'ico', 'bmp'])
    ->filterOnlySelectedExtensions()
    ->setDefaultExtensionSearch('png')
;

$selectedFiles = $fp->open();

print_r($selectedFiles);

// if no files were selected, an empty array will be returned 😉

That's it!

See demos/demo.php for this example.

统计信息

  • 总下载量: 4
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2025-03-06