PHPackages                             lazarusphp/openhandler - 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. lazarusphp/openhandler

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

lazarusphp/openhandler
======================

FileManager and Data Writer.

1.0.1(4mo ago)05MITPHP

Since Dec 31Pushed 4mo agoCompare

[ Source](https://github.com/Lazarusphp/OpenHandler)[ Packagist](https://packagist.org/packages/lazarusphp/openhandler)[ RSS](/packages/lazarusphp-openhandler/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

OpenFileHandler
===============

[](#openfilehandler)

*Version Information*Build version : v1.0.0 Date Of Build : 31/12/2025

**Index**

1 [What is OpenHandler](#what-is-openhandler)

2 [Open FileHandler Permissions Manager](#open-file-handler-permissions-manager)

3 [Usage](#usage)

4 [Helpers](#helpers)

What is OpenHandler
-------------------

[](#what-is-openhandler)

Open Handler (OH) is a standalone File and Directory Handling Library, OFH is designed to control and comminicate with the Server file structure, set permissions and manage files and directories.

Open File handler Permissions manager
-------------------------------------

[](#open-file-handler-permissions-manager)

Along side the FileWriter and File handler the Library will also feature a permissions manager. The Permissions manager will give the FileHandler library the ability to set permissions relating to the files and directories.

Usage
-----

[](#usage)

**Installation**

```
composer install lazarusphp/openhandler
```

*Creating a new Instantiation.*\*

```
// Setting a path within the methods parameters will set the directory root.
// Leaving it blank will default to the folder root.
$filehandler = OpenHandler::create("/var/www/OpenHandler/Structure");
```

**Creating a Directory**

if a root is not generated but required, the root directory will have to be passed for the following methods.

upon creating a Directory Helper methods such as hasDirectory and writable are also called these methods are required to make sure the correct permissions and structure access are put in place [click here](#helpers) for more informtion on helpers.

```
// Make Sure path exists
$filehandler->directory("/Apps/Login");
```

**Generating Files**

Open Handler has the ability to Generate files with Additional Customisation read more about [FileWriter](./FileWriter.md) commands.

**Listing Files and Folders**

the code below can be used to list directories and the files, it is recommended to list them in a loop but can also be apploed to the var\_dump or print\_r methods for debugging purposes.

```
$filehandler->list("/Apps");

foreach($filehandler->list("/Apps") as $item => $folders)
{
    // List code goes here.
}
```

**Deleting Directory and files**

OpenHandler has the ability to delete a single file or directory.

Passing a single filename will Remove the specific file.

```
$filehandler->delete("/Apps/Home/users.env");
```

Passing a directory will Delete the specified directory along with any files inside.

```
$filehandler->delete("/Apps");
```

**Setting a prefix**

Using a prefix gives the ability to group methods into a specific directory making and can be done like so.

```
$filehandler->prefix("/App/Users",function($handler){
    // Use handler at this point to call methods
    $handler->directory("/Uploads");
    if(isset($_POST["file"]) && $_SERVER["REQUEST_METHOD"] === "POST")
    {
        // Set the path and the Form Name value.
        $handler->upload("Uploads","file");
    }
})
```

**Uploading FIles**

```
if(isset($_POST["file"]) && $_SERVER["REQUEST_METHOD"] === "POST")
{
    $filehandler->upload("/uploads/Path","file");
}
```

### Helpers

[](#helpers)

**importing**

Add Under Namspace

```
use LazarusPhp\OpenHandler\CoreFiles\Traits\Structure;
```

Add Within the classname

```
use Structure;
```

OpenHandler utilisies a trait called Structure which contants helper functions for ease of access when Handling Data.

**hasFile**

Check if the file is a valid file this uses the built in is\_file() method and returns a true or false boolean.

```
    if($this->hasFile("/App/Home/test.php"))
    {
        echo "this is a valid File";
    }
```

**fileExists**

file Exists utilises the file\_exist() method and checks if the file Exists.

```
    if($this->fileExists("App/Home/test.php"))
    {
        echo "file Exists";
    }
```

**hasDirectory**

Has directory is used to validate if the path is a valid directory hasDirectory uses the is\_dir() built in method and returns a true or false boolean.

```
if($this->hasDirectory("/Apps/Home"))
{
    echo "directory Exists";
}
else
{
    echo "Directory doesnt exist";
}
```

**reflection**

The Reflection helper is used to call a new Reflection class instance.

```
$class = $this->reflection(__CLASS__);
$class->getShortName();
```

**getExtension**

the getExtension helper gives the ability obtain the file extension type which can be used with other helper methods.

```
$this->getExtension("/App/Home/Users.php");
```

**hasExtension**

The hasExtension helper is used to validate and limit what file extentions can be used when writing or opening data.

```
    if($this->hasExtension("/App/Home/test.php","php"))
    {
        echo "FIle is a valid type";
    }
```

**WhitelistExtention**

The Whitelist Extension helper can be used in conjunction with the hasExtension helper and getExtensions helper when creating a custom method.

```
function myCustommFileMethod($file)
{
    $extention = $this->getExtension($file);
    if($this->whitelistExtension($extension,["php","js","txt"]))
    {
        echo "We can Continue";
    }
}

$filemethod = new CustomClass();
$filemethod->myCustomFileMethod("App/Home/Users.php");
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance75

Regular maintenance activity

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity36

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.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

138d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/42fe8da43e075694b07eeec0a2fb822ab60aa872bf765cb0434b919b43264479?d=identicon)[mbamber1986](/maintainers/mbamber1986)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/lazarusphp-openhandler/health.svg)

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

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

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

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15161.6M2.6k](/packages/illuminate-filesystem)[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)[madnest/madzipper

Easier zip file handling for Laravel applications.

1382.3M6](/packages/madnest-madzipper)

PHPackages © 2026

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