muharihar/file-finder 问题修复 & 功能扩展

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

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

muharihar/file-finder

Composer 安装命令:

composer require muharihar/file-finder

包简介

Laravel Local File Finder Package

README 文档

README

Laravel Local File Finder Package is a simple laravel package that allow finding a file by CONTENT (currently only for .txt file).

Online Demo:

Available Features:

  • List default storage directories and files.
  • Search files and directories By Name.
  • Search files by Content.

REST API Features

Installation

  • Create Laravel Project
$ composer create-project --prefer-dist laravel/laravel laravel_file_finder_5.6_test "5.6.*"
  • Add FileFinder Package
$ cd laravel_file_finder_5.6_test
$ composer require muharihar/file-finder
  • Publish Assets and Default Data Samples
$ php artisan vendor:publish --tag=public --force
  • Add FileFinder Service Provider to laravel application config (config/app.php)
/*
* Package Service Providers...
*/

Muharihar\FileFinder\ServiceProviders\FileFinderServiceProvider::class,
  • Running Application
$ php artisan serve

Test via CURL

1. List default storage directories and files.

Command:

$ curl -v -X GET "http://localhost:8000/file-finder/api/v1.0/default/list-dir-and-files" -H "accept: application/json"

Sample Result: sampleResponse

2. Search files and directories By Name.

Command:

$ curl -X GET "http://localhost:8000/file-finder/api/v1.0/search/by-name?s=b" -H "accept: application/json"

Sample Result:

{
  "searchKey": "b",
  "results": [
    {
      "idx": 2,
      "isDir": true,
      "shortPath": "public/file-finder/folder_animals/folder_birds",
      "extension": "",
      "fileSize": 0,
      "parentPath": "public/file-finder/folder_animals"
    },
    {
      "idx": 12,
      "isDir": true,
      "shortPath": "public/file-finder/folder_fruits/folder_berries",
      "extension": "",
      "fileSize": 0,
      "parentPath": "public/file-finder/folder_fruits"
    },
    {
      "idx": 13,
      "isDir": false,
      "shortPath": "public/file-finder/folder_fruits/folder_berries/file_berries_list.txt",
      "extension": "txt",
      "fileSize": 44,
      "parentPath": "public/file-finder/folder_fruits/folder_berries"
    },
    {
      "idx": 26,
      "isDir": false,
      "shortPath": "public/file-finder/folder_geolocations/folder_cities/file_bg.txt",
      "extension": "txt",
      "fileSize": 633,
      "parentPath": "public/file-finder/folder_geolocations/folder_cities"
    }
  ],
  "resultCount": 4
}

3. Search files by Content.

Command:

$ curl -X GET "http://localhost:8000/file-finder/api/v1.0/search/by-content?s=Obama" -H "accept: application/json"

Sample Result:

{
  "searchKey": "Obama",
  "results": [
    {
      "idx": 41,
      "isDir": false,
      "shortPath": "public/file-finder/folder_peoples/folder_presidents/file_us.txt",
      "extension": "txt",
      "fileSize": 6713,
      "parentPath": "public/file-finder/folder_peoples/folder_presidents",
      "info": {
        "firstPos": 6580,
        "firstStr": "...Obama,http://en.wikipedia.org/wiki/Barack_Obama,20"
      }
    }
  ],
  "resultCount": 1
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2018-09-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固