PHPackages                             mbcraft/piol - 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. [Caching](/categories/caching)
4. /
5. mbcraft/piol

ActiveLibrary[Caching](/categories/caching)

mbcraft/piol
============

Piol is a library for handling files and directories.

2.1.1(9y ago)038MITPHP

Since Apr 28Pushed 2y ago1 watchersCompare

[ Source](https://github.com/mbcraft/piol)[ Packagist](https://packagist.org/packages/mbcraft/piol)[ RSS](/packages/mbcraft-piol/feed)WikiDiscussions master Synced today

READMEChangelog (5)Dependencies (1)Versions (6)Used By (0)

Piol - PHP I/O Library
======================

[](#piol---php-io-library)

Piol ( PHP I/O Library ) is a library for managing files, directories and performing common operation on files and directories like copy, move, rename, etc. It was extracted from Frozen framework and has been revised in order to let this code be more useful.

Content :
---------

[](#content-)

This package contains :

docs/ &lt;-- API documentation

src/ &lt;-- full documented source code

test/ &lt;-- unit test classes and data

vendor/ &lt;-- empty but ready for composer packages (used for running unit tests)

README.md &lt;-- instructions and description of whole package

composer.json &lt;-- composer configuration

composer.phar &lt;-- instance of composer

config\_tests.php &lt;-- configuration file needed for command line test runner

run\_tests.sh &lt;-- test runner for linux/unix

run\_tests.php &lt;-- web test runner

make\_docs.php &lt;-- regenerate docs after code changes

Installation &amp; Usage :
--------------------------

[](#installation--usage-)

Inside your code simply add the use directives on top of the code files where you need, eg.:

`use Mbcraft/Piol/File;`

`use Mbcraft/Piol/Dir;`

the library will load with its default settings (file root jail as PIOL\_ROOT\_PATH) and everything should work out of the box.

The library has no external dependencies, all used classes are inside the Mbcraft\\Piol namespace.

If you define a PIOL\_ROOT\_PATH as a constant with 'define' directive inside php before library usage you can define what your file root jail directory is. All paths of File's or Dir's will start from this one (so they are relative). The definition of this constant is REQUIRED for this library to work. If the library is used inside a Laravel project, the PIOL\_ROOT\_PATH is automatically set to the source file root.

Running tests :
---------------

[](#running-tests-)

Under Linux, type

`sudo php composer.phar update ./run_tests.sh`

The first command will download libraries necessary for running unit tests (it is not needed for the library to work) while the second one will actually run the unit tests.

Alternatively, you can also run your test on web, loading the run\_tests.php web page and setting its folder as web root on your virtual host.

All tests should work out of the box on Linux. On Windows permission tests are disabled due to missing support for permission change of files (php chmod function will lie on its return value, and even inside OS there are problems in changing file permissions due to a completely different permission model).

Features :
----------

[](#features-)

- Easy File and Directory management with root jail feature (PIOL\_ROOT\_PATH) that can be set before using the library or is set automatically. Common methods for working with files and directories, reading and writing file data. Useful features like rename, delete, move files and directories, directory visit, permission get and set (Linux only) and much more.
- Zip creation and extraction (zip library required inside php) with ZipUtils class.
- Properties management in ini and java xml formats.
- Csv utility class for reading and writing csv data.
- StringBuffer class, for working with character streams.
- Secure storage management : store files inside a protected directory. Save data as string, properties or xml.
- Upload handler : easy handle file uploads with UploadUtils class, even multiple file uploads are handled easily.
- Cache class useful for caches is available : check the FlatDirCache class.
- Automatic Laravel framework integration.

Documentation :
---------------

[](#documentation-)

You can find the whole API documentation inside the docs/ directory, opening the index.html file with your favorite browser.

Info :
------

[](#info-)

Current version : 2.1.1

Latest changes :
----------------

[](#latest-changes-)

- Refactored the namespace to be in "Mbcraft".
- Check PIOL\_ROOT\_PATH both from defined constant and $\_ENV.
- Laravel automatic integration.
- Added JavaXmlPropertiesUtils class.
- Refactored the package of some classes.
- Fixed class names in documentation.
- Add openWriter($erase) parameter.
- Added CsvUtils class
- Added IReader and IWriter interfaces
- Added StringBuffer class

Roadmap :
---------

[](#roadmap-)

- Add implementation of Link class.

Credits :
---------

[](#credits-)

Making of :

Full source code and documentation was written by Marco Bagnaresi. Some help was taken from Zeal and StackOverflow. StackOverflow references are put inside the code when i used it.

Distribution :

I hope you find this library useful. The library is now open source and distributed with MIT license.

-Marco

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

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 ~25 days

Total

5

Last Release

3613d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5803202?v=4)[Marco Bagnaresi](/maintainers/mbcraft)[@mbcraft](https://github.com/mbcraft)

---

Top Contributors

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

---

Tags

librarycachefilesiostoragedirectories

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mbcraft-piol/health.svg)

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

###  Alternatives

[aplus/cache

Aplus Framework Cache Library

171.6M4](/packages/aplus-cache)[rapidwebltd/rw-file-cache

RW File Cache is a PHP File-based Caching Library. Its syntax is designed to closely resemble the PHP memcache extension.

15194.2k7](/packages/rapidwebltd-rw-file-cache)[duncan3dc/helpers

A collection of useful helper classes

13188.0k](/packages/duncan3dc-helpers)

PHPackages © 2026

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