PHPackages                             acide/acfilemanager - 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. acide/acfilemanager

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

acide/acfilemanager
===================

This is a magical php file manager library

334PHP

Since Aug 7Pushed 5y ago2 watchersCompare

[ Source](https://github.com/morteza-jamali/AC-FileManager)[ Packagist](https://packagist.org/packages/acide/acfilemanager)[ RSS](/packages/acide-acfilemanager/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependenciesVersions (1)Used By (0)

 AC FileManager
================

[](#--ac-filemanager)

[![version](https://camo.githubusercontent.com/27e6c9e96115937c217ea3d1b72eb784630283b649124427eda3bd333d0d3450/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d322e312e312d6f72616e6765)](https://camo.githubusercontent.com/27e6c9e96115937c217ea3d1b72eb784630283b649124427eda3bd333d0d3450/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d322e312e312d6f72616e6765)[![license](https://camo.githubusercontent.com/6028d7887efeb03a3e06067daf344bec4dd89fa4416c5fbed65d1d71a673c49b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4343302d2d312e302d79656c6c6f77677265656e)](https://camo.githubusercontent.com/6028d7887efeb03a3e06067daf344bec4dd89fa4416c5fbed65d1d71a673c49b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4343302d2d312e302d79656c6c6f77677265656e)[![size](https://camo.githubusercontent.com/4b28fbef7b49bc3a9de225be9a4431cef2b99c66c03feefe3ec76c17938f848b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73697a652d3132302532304b422d6c6967687467726579)](https://camo.githubusercontent.com/4b28fbef7b49bc3a9de225be9a4431cef2b99c66c03feefe3ec76c17938f848b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73697a652d3132302532304b422d6c6967687467726579)

PHP library for file and directory management

Requirements
------------

[](#requirements)

This library is supported by PHP versions 5.6 or higher

Installation
------------

[](#installation)

The preferred way to install this library is through [Composer](https://getcomposer.org/) :

```
composer require acide/acfilemanager

```

Quick Start
-----------

[](#quick-start)

To use this library with Composer :

```
require __DIR__ . '/vendor/autoload.php';

use ACFileManager\Src\File;
```

Available Methods
-----------------

[](#available-methods)

```
File::exists($path)
```

MethodDescriptionReturnexistsCheck if a file or directory exists in a pathBooleanAttributeDescriptionTypeRequiredDefault$pathFile or directory pathStringYes```
File::scanPath($path , $order);
```

MethodDescriptionReturnscanPathList files and directories inside the specified pathArrayAttributeDescriptionTypeRequiredDefault$pathDirectory pathStringYes$orderSorting orderIntNoSCANDIR\_SORT\_ASCENDINGIf the optional **$order** is set to **SCANDIR\_SORT\_DESCENDING**, then the sort order is alphabetical in descending order. If it is set to **SCANDIR\_SORT\_NONE** then the result is unsorted.

```
File::filterScan($path , $filters , $order)
```

MethodDescriptionReturnfilterScanFilters and remove an array from scanArrayAttributeDescriptionTypeRequiredDefault$pathDirectory pathStringYes$filtersArray of filtered directories and filesArrayYes$orderSorting orderIntNoSCANDIR\_SORT\_ASCENDING**\# A simple filterScan() example**

```
$result = File::filterScan(
    '/path/tmp' ,
    array('readme.txt' , 'sources')
);

print_r($result);
```

Lists all files and directories in `/path/tmp` and removes `readme.txt` file and `sources` directory from result

```
File::getFiles($path , $regex , $depth , $order)
```

MethodDescriptionReturngetFilesLists all files in a pathArrayAttributeDescriptionTypeRequiredDefault$pathDirectory pathStringYes$regexRegex for matching file nameStringNonull$depthDepth for searching filesIntNoCURRENT\_DEPTH$orderSorting orderIntNoSCANDIR\_SORT\_ASCENDING```
File::getDirectories($path , $regex , $depth , $order)
```

MethodDescriptionReturngetDirectoriesLists all directories in a pathArrayAttributeDescriptionTypeRequiredDefault$pathDirectory pathStringYes$regexRegex for matching directory nameStringNonull$depthDepth for searching directoriesIntNoCURRENT\_DEPTH$orderSorting orderIntNoSCANDIR\_SORT\_ASCENDING```
File::deleteFile($path)
```

MethodDescriptionReturndeleteFileDelete file if existsBooleanAttributeDescriptionTypeRequiredDefault$pathFile pathStringYes```
File::deleteDirectory($path)
```

MethodDescriptionReturndeleteDirectoryDelete a folder with its contentBooleanAttributeDescriptionTypeRequiredDefault$pathDirectory pathStringYes```
File::emptyDirectory($path , $except , $self_delete)
```

MethodDescriptionReturnemptyDirectoryDelete all files and directories from directoryBooleanAttributeDescriptionTypeRequiredDefault$pathDirectory pathStringYes$self\_deleteDelete directory itselfBooleanNoFalse$exceptDoesn't remove these files and directoriesArrayNo\[\]**\# A simple emptyDirectory() example**

```
File::emptyDirectory('/to/path/sample' , [
    '/to/path/sample/Application' ,
    '/to/path/sample/webpack.config.js'
]);
```

```
File::makeDirectory($path , $mode)
```

MethodDescriptionReturnmakeDirectoryCreates a directoryBooleanAttributeDescriptionTypeRequiredDefault$pathDirectory pathStringYes$modeMode numberIntNo0777The mode is 0777 by default, which means the widest possible access. For more information on modes, read the details on the [chmod()](https://www.php.net/manual/en/function.chmod.php) page.

```
File::addFileContent($path , $content , $mode)
```

MethodDescriptionReturnaddFileContentAdd content to a fileBooleanAttributeDescriptionTypeRequiredDefault$pathFile pathStringYes$contentContent for writingStringYes$modeWriting ModeStringNowIf you use addFileContent() on a file that does not exist, it will create it, given that the file is opened for writing **(w)** or appending **(a)**

**\# A simple addFileContent() example**

```
$result = File::addFileContent(
    '/path/tmp/doc.txt' ,
    'This is for test :)'
);

var_dump($result);
```

```
File::copyDirectoryRecursively($from , $to)
```

MethodDescriptionReturncopyDirectoryRecursivelyCopies directory recursivelyAttributeDescriptionTypeRequiredDefault$fromFrom directory pathStringYes$toDestination directory pathStringYes```
File::copyFile($from , $to)
```

MethodDescriptionReturncopyFileCopies file contentBooleanAttributeDescriptionTypeRequiredDefault$fromFrom file pathStringYes$toDestination file pathStringYes```
File::rename($path , $new_name)
```

MethodDescriptionReturnrenameRenames a file or directoryBooleanAttributeDescriptionTypeRequiredDefault$pathDirectory or file pathStringYes$new\_nameNew nameStringYes**\# A simple rename() example**

```
$result = rename(
    '/path/tmp/File1.txt' ,
    'File2.txt'
);

var_dump($result);
```

```
File::moveFile($from_dir , $to_dir , $name)
```

MethodDescriptionReturnmoveFileMoves file to another directoryBooleanAttributeDescriptionTypeRequiredDefault$from\_dirParent directory pathStringYes$to\_dirDestination directory pathStringYes$nameFile nameStringYes**\# A simple moveFile() example**

```
$result = File::moveFile(
    '/path/tmp' ,
    '/path/another' ,
    'Files.txt'
);

var_dump($result);
```

Moves `Files.txt` in `/path/tmp` directory to `/path/another` directory

```
File::moveDirectory($from_dir , $to_dir , $dir)
```

MethodDescriptionReturnmoveDirectoryMoves directoryBooleanAttributeDescriptionTypeRequiredDefault$from\_dirParent directory pathStringYes$to\_dirDestination directory pathStringYes$dirDirectory nameStringYes```
File::isFileEmpty($path)
```

MethodDescriptionReturnisFileEmptyCheck if file is emptyBooleanAttributeDescriptionTypeRequiredDefault$pathFile pathStringYes```
File::isDirectoryEmpty($path)
```

MethodDescriptionReturnisDirectoryEmptyCheck if directory is emptyBooleanAttributeDescriptionTypeRequiredDefault$pathDirectory pathStringYes```
File::cleanPath($path)
```

MethodDescriptionReturncleanPathRemoves last / and \\ from pathStringAttributeDescriptionTypeRequiredDefault$pathFile or directory pathStringYes**\# A simple cleanPath() example**

```
$result = File::cleanPath('path/tmp/');

echo $result;
```

Result is `path/tmp`

```
File::fixPath($path)
```

MethodDescriptionReturnfixPathFixes path string problemsStringAttributeDescriptionTypeRequiredDefault$pathFile or directory pathStringYes**\# A simple fixPath() example in Linux OS**

```
$result = File::fixPath('var/www/html/acide\images\test.png');

echo $result;
```

Result is `var/www/html/acide/images/test.png`

```
File::getDirectoryTree($path)
```

MethodDescriptionReturngetDirectoryTreeGet all files and directoriesArrayAttributeDescriptionTypeRequiredDefault$pathDirectory pathStringYes```
--- /root
    |
    |----- /src
    |      |----- main.js
    |      |----- home.js
    |
    |----- example.text
    |----- simple.php

```

The file manager returns the above file structure as follows :

```
array (size=2)
  '../root' =>
    array (size=3)
      'src' => string 'directory' (length=3)
      'example.text' => string 'file' (length=12)
      'simple.php' => string 'file' (length=10)
  '../root/src' =>
    array (size=2)
      'main.js' => string 'file' (length=7)
      'home.js' => string 'file' (length=7)
```

```
File::getBaseName($path)
```

MethodDescriptionReturngetBaseNameGet path base nameStringAttributeDescriptionTypeRequiredDefault$pathDirectory pathStringYes```
File::getFileContent($path)
```

MethodDescriptionReturngetFileContentReturns file contentStringAttributeDescriptionTypeRequiredDefault$pathFile pathStringYesLicense
-------

[](#license)

This project is licensed under Creative Commons Zero v1.0 Universal license. See the [LICENSE](https://github.com/morteza-jamali/AC-FileManager/blob/master/LICENSE) file for more info.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/b49254145784872c4c29a188c1b89d5377cf22f527a4163ec7dd5591a0c013fc?d=identicon)[moraj](/maintainers/moraj)

---

Top Contributors

[![morteza-jamali](https://avatars.githubusercontent.com/u/42025368?v=4)](https://github.com/morteza-jamali "morteza-jamali (21 commits)")

### Embed Badge

![Health badge](/badges/acide-acfilemanager/health.svg)

```
[![Health](https://phpackages.com/badges/acide-acfilemanager/health.svg)](https://phpackages.com/packages/acide-acfilemanager)
```

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[google/cloud-storage

Cloud Storage Client for PHP

34390.8M125](/packages/google-cloud-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)

PHPackages © 2026

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