ozdemir/vuefinder-php 问题修复 & 功能扩展

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

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

ozdemir/vuefinder-php

Composer 安装命令:

composer require ozdemir/vuefinder-php

包简介

Vuefinder Php Library.

README 文档

README

Modern PHP Backend for VueFinder File Manager

PHP Version License

VueFinder is a powerful, modern file management system that provides a beautiful web interface for managing files and folders. This PHP backend powers VueFinder, giving you complete control over file operations like upload, download, rename, move, copy, archive, and more.

Whether you're building a content management system, a file sharing platform, or need file management capabilities in your application, VueFinder PHP provides a robust, production-ready solution that works with any PHP framework or plain PHP.

What is VueFinder?

VueFinder is a full-featured file manager that allows users to:

  • Browse and organize files and folders
  • Upload files with drag & drop support
  • Search files with advanced filters
  • Edit, rename, move, and copy files
  • Create and extract ZIP archives
  • Preview files directly in the browser
  • Generate public URLs for files
  • And much more!

This PHP package is the backend API that handles all file operations. It's designed to work seamlessly with the VueFinder frontend, but can also be used standalone for building custom file management solutions.

Why Choose VueFinder PHP?

  • Easy to Use - Get started in minutes with simple setup
  • Framework Agnostic - Works with Laravel, Symfony, or plain PHP
  • Production Ready - Built with type safety and error handling
  • Flexible Storage - Support for local files, cloud storage, and more
  • Complete API - 17 actions covering all file management needs
  • Modern Architecture - Clean, maintainable, and testable code
  • CDN Support - Built-in URL resolver for CDN integration
  • Secure - Private folder exclusions and access control

Installation

Install via Composer:

composer require ozdemir/vuefinder

Requirements

  • PHP 8.0 or higher
  • Composer
  • League Flysystem 3.x
  • Symfony HTTP Foundation 6.x

Quick Start

Basic Setup (Plain PHP)

The simplest way to get started:

require 'vendor/autoload.php';

use Ozdemir\VueFinder\VueFinder;
use League\Flysystem\Local\LocalFilesystemAdapter;

// Create VueFinder instance with your storage
$vueFinder = new VueFinder([
    'local' => new LocalFilesystemAdapter(__DIR__ . '/uploads'),
]);

// Initialize with configuration
$vueFinder->init([
    'publicLinks' => ['local://public' => 'https://example.com'],
]);

// That's it! VueFinder will handle requests automatically:
// GET  /index.php?q=index&path=local://uploads
// POST /index.php?q=upload&path=local://uploads

Framework Integration (Laravel, Symfony, etc.)

For framework integration, use the builder pattern:

use Ozdemir\VueFinder\VueFinderBuilder;
use Ozdemir\VueFinder\Actions\VueFinderActionFactory;
use League\Flysystem\Local\LocalFilesystemAdapter;

// One-line setup!
$core = VueFinderBuilder::create(
    ['local' => new LocalFilesystemAdapter(__DIR__ . '/uploads')],
    ['publicLinks' => ['local://public' => 'https://example.com']]
);

// In your controller:
$factory = new VueFinderActionFactory($core);
$action = $factory->setRequest($request)->create('index');
return $action->execute();

Available Actions

VueFinder PHP provides a complete set of file management actions:

Action Description
index List files and directories in a folder
search Search files with filters and size categorization
upload Upload files with validation
delete Delete files or folders (with recursive support)
rename Rename files and folders
move Move files/folders to new locations
copy Copy files/folders
create-folder Create new directories
create-file Create new text files
download Download files with proper headers
preview Preview files in browser
save Save file content
archive Create ZIP archives from files/directories
unarchive Extract ZIP archives

All actions are implemented as separate classes, making the codebase maintainable and easy to extend.

Configuration

URL Configuration

Configure public URLs for your files, including CDN support:

$config = [
    'storages' => [
        'local' => [
            'publicBaseUrl' => 'https://cdn.example.com',
            'publicPrefix' => 'uploads',
        ],
        's3' => [
            'publicBaseUrl' => 'https://my-bucket.s3.amazonaws.com',
        ],
    ],
    'publicExclusions' => ['local://private'], // Exclude private folders
];

$core = VueFinderBuilder::create($storages, $config);

Storage Configuration

VueFinder supports multiple storage backends through Flysystem:

use League\Flysystem\Local\LocalFilesystemAdapter;
use League\Flysystem\AwsS3V3\AwsS3V3Adapter;

$storages = [
    'local' => new LocalFilesystemAdapter(__DIR__ . '/uploads'),
    's3' => new AwsS3V3Adapter($s3Client, 'my-bucket'),
    // Add more storage adapters as needed
];

Examples

Example: File Upload Endpoint

$core = VueFinderBuilder::create($storages, $config);
$factory = new VueFinderActionFactory($core);

// Handle file upload
$action = $factory->setRequest($request)->create('upload');
$response = $action->execute();

Example: List Files

// GET /api/files?q=index&path=local://documents
$action = $factory->setRequest($request)->create('index');
return $action->execute();

Example Laravel Project

For a complete Laravel implementation example, check out the VueFinder Laravel API project. This example demonstrates how to integrate VueFinder PHP into a Laravel application with REST API endpoints.

Migration from v3

VueFinder PHP 4.0 maintains API compatibility with v3. The query parameter method (?q=action) continues to work as before, ensuring smooth migration.

Contributing

Contributions are welcome! Please ensure your code follows clean architecture principles and includes appropriate tests.

License

MIT License - see LICENSE file for details.

Learn More

For more information about VueFinder, visit vuefinder.ozdemir.be.

ozdemir/vuefinder-php 适用场景与选型建议

ozdemir/vuefinder-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 30.8k 次下载、GitHub Stars 达 27, 最近一次更新时间为 2018 年 08 月 21 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 ozdemir/vuefinder-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 ozdemir/vuefinder-php 我们能提供哪些服务?
定制开发 / 二次开发

基于 ozdemir/vuefinder-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 30.8k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 27
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 27
  • Watchers: 1
  • Forks: 15
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-08-21