PHPackages                             gongfangjun/file-manager - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. gongfangjun/file-manager

ActiveLibrary[File &amp; Storage](/categories/file-storage)

gongfangjun/file-manager
========================

A file/dir manager for php

1.0.3(9y ago)1332MITPHPPHP &gt;=5.4.0

Since Sep 8Pushed 9y agoCompare

[ Source](https://github.com/gongfangjun/file-manager)[ Packagist](https://packagist.org/packages/gongfangjun/file-manager)[ RSS](/packages/gongfangjun-file-manager/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (5)Used By (0)

file-manager
============

[](#file-manager)

A file/dir manager for php

install
-------

[](#install)

add a line to the "require" section in your composer.json,then run the command: composer update

```
{
	"require":{
		"gongfangjun/file-manager": "*"
	}
}

```

how to use it in your project
-----------------------------

[](#how-to-use-it-in-your-project)

```
include './vendor/autoload.php';

use FileManager\FileManager;

//scan sub docs in the dir
$fm = new FileManager('/data/upload/');
foreach ($fm->scan() as $doc) {
	echo $doc->path,"\n";
}

//scan all the docs in the dir
function scan($path) {
	$fm = new FileManager($path);
	foreach ($fm->scan() as $doc) {
	    if ($doc->isDir) {
	        echo $doc->path,"\n";
	        scan($doc->path);
	    } else {
	        echo $doc->path,"\n";
	        echo "   |- file size : ", $doc->filesize,"\n";
	        echo "   |- last visit time : ", date('Y-m-d H:i:s', $doc->lastVisitTime),"\n";
	        echo "   `- last modify time : ", date('Y-m-d H:i:s', $doc->lastModTime),"\n";
	    }
	}
}

scan('/data/upload/');

//delete a file
$fm = new FileManager('/data/upload/js/inc/bootstrap.js');
$fm->del();

//delete a dir
$fm = new FileManager('/data/upload/js/inc/');
$fm->del();

//read a file
$fm = new FileManager('/data/upload/js/index.js');
$fm->getContent();

//write content to a file
$fm = new FileManager('/data/upload/js/index.js');
$fm->write('var userName = "gongfangjun"');

```

property of FileManager\\Component\\Document
--------------------------------------------

[](#property-of-filemanagercomponentdocument)

[click here to see the source code](https://github.com/gongfangjun/file-manager/blob/master/src/Component/Document.php)

path

isFile

isDir

isReadable

isWritable

lastVisitTime

lastModTime

filesize

apis
----

[](#apis)

[scan()](https://github.com/gongfangjun/file-manager/blob/master/src/Component/Document.php)

 scan a dir

[del()](https://github.com/gongfangjun/file-manager/blob/master/src/Contracts/Reader.php)

 del a file or a dir

[write()](https://github.com/gongfangjun/file-manager/blob/master/src/Contracts/Writer.php)

 write content to a file

[getContent()](https://github.com/gongfangjun/file-manager/blob/master/src/Contracts/Reader.php)

 get content from a file

[createFile()](https://github.com/gongfangjun/file-manager/blob/master/src/Contracts/Writer.php)

 create a file

[createDir()](https://github.com/gongfangjun/file-manager/blob/master/src/Contracts/Writer.php)

 create a dir

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

3531d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7697134f9eb8037ba41d7e3a90ca437b610badfefd7aeb96cacd3bdc6e28af09?d=identicon)[gongfangjun](/maintainers/gongfangjun)

---

Top Contributors

[![gongfangjun](https://avatars.githubusercontent.com/u/22025197?v=4)](https://github.com/gongfangjun "gongfangjun (4 commits)")

---

Tags

file manager

### Embed Badge

![Health badge](/badges/gongfangjun-file-manager/health.svg)

```
[![Health](https://phpackages.com/badges/gongfangjun-file-manager/health.svg)](https://phpackages.com/packages/gongfangjun-file-manager)
```

###  Alternatives

[helios-ag/fm-elfinder-bundle

ElFinder bundle, adds ElFinder file manager to your Symfony project

2814.8M27](/packages/helios-ag-fm-elfinder-bundle)[artgris/filemanager-bundle

FileManager is a simple Multilingual File Manager Bundle for Symfony

182420.8k9](/packages/artgris-filemanager-bundle)[components/elfinder

ElFinder FileManager

551.9M1](/packages/components-elfinder)[jasekz/laradrop

File manager using Dropzone.js for Laravel 5 | 6 | 7 | 8

7310.3k1](/packages/jasekz-laradrop)[mwguerra/filemanager

A full-featured file manager package for Laravel and Filament v5 with dual operating modes, drag-and-drop uploads, S3/MinIO support, and comprehensive security features.

718.5k1](/packages/mwguerra-filemanager)[laravel-enso/files

File manager dependency for Laravel Enso

1643.3k23](/packages/laravel-enso-files)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
