PHPackages                             kappa/filesystem - 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. kappa/filesystem

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

kappa/filesystem
================

Easy system for work with files and directories

v4.2.0(12y ago)11.6k2BSD-3-ClausePHPPHP &gt;= 5.3.3

Since Jun 27Pushed 12y ago1 watchersCompare

[ Source](https://github.com/Kappa-org/FileSystem)[ Packagist](https://packagist.org/packages/kappa/filesystem)[ Docs](https://github.com/Kappa-org/FileSystem)[ RSS](/packages/kappa-filesystem/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (4)Versions (11)Used By (2)

Kappa\\FileSystem [![Build Status](https://camo.githubusercontent.com/79b22fe0f1ffb5a3270d5d5d702281aa20ccd332a9571fb89b3bcba7b5e3f1ba/68747470733a2f2f7472617669732d63692e6f72672f4b617070612d6170702f46696c6553797374656d2e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/Kappa-app/FileSystem)
=============================================================================================================================================================================================================================================================================================================

[](#kappafilesystem-)

Easy system for work with files and directories

Requirements:
-------------

[](#requirements)

- PHP 5.3.3 or higher
- [Kappa\\Utils](https://github.com/kappa-org/utils) 1.0.0
- [Nette framework](https://github.com/nette/nette) ~2.1

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

[](#installation)

The best way to install Kappa/FileSystem is using Composer:

```
$ composer require kappa/filesystem:@dev
```

Usages
------

[](#usages)

Create a new file or directory:

```
$file = File::create('path/to/file.txt', 'Hello wolrd!') // Create a new file with Hello world! text
$directory  = Directory::create('path/to/directory') // Create a new directory
```

Opening files and directories:

```
$file = File::open('path/to/file'); // Open file
$dorectory = Directory::open('path/to/file'); // Open directory
```

Upload files via [FileUpload](https://github.com/nette/http/blob/master/src/Http/FileUpload.php):

```
// $fileUpload is instance of FileUpload from forms example...
$file = File::upload($fileUpload, 'path/to/save/file');
```

Load file from [Nette\\Utils\\Image](https://github.com/nette/utils/blob/master/src/Utils/Image.php)

```
$image = Image::fromFile('image.png');
$image->resize(10,10);
$file = File::fromImage($image, 'newImage.png');
```

Create a new image 'newImage' with dimensions 10x10 px and return instance of File

*If you can work with same image without creating new file use original file name as second parameter*

### File API:

[](#file-api)

- `read()` - Returns file content
- `overwrite(content)` - Overwrite file content *(content can be null for clear file)*
- `clear()` - Clear file content *(same as `overwrite(null)`)*
- `append(content, newLine = true)` - Append text to end file
- `getInfo()` - Returns SplFileInfo
- `toImage()` - Returns Nette\\Utils\\Image

### Directory API:

[](#directory-api)

- `getInfo()` - Returns SplFileInfo
- `getDirectories()` - Returns directories in directory as array `path => Directory`
- `getFiles()` - Returns files in directory as array `path => File`
- `getContent()` - Returns directories and files in directory as array `path => Directory|File`

### FileSystem API:

[](#filesystem-api)

- `remove(source)` - Remove file or directory, `source` must be instance of File or Directory
- `rename(source, new name, overwrite)` - Renamed file or directory. `source` must be instance of File or Directory and return new instance of object
- `copy(source, target, overwrite)` - Copy source to target, `source` must be instance of File or Directory, `target` can be string or instance of Directory. Return instance of copy file;
- `move(source, target, overwrite)` - Same as `copy()` but remove source after copy

### Examples:

[](#examples)

```
$file = File::create('file.txt');
$file = FileSystem::rename($file, 'superFile.txt');
$file->getInfo()->getBasename(); // Return superFile.txt
```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity64

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

Recently: every ~35 days

Total

9

Last Release

4420d ago

Major Versions

v0.9 → v1.0.02013-07-10

v1.0.0 → v2.0.02013-10-01

v2.0.1 → v3.0.02014-01-03

v3.0.0 → v4.0.02014-04-14

PHP version history (3 changes)v0.9PHP &gt;= 5.3.0

v2.0.0PHP &gt;= 5.4.0

v4.0.0PHP &gt;= 5.3.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/0c0840abca14f130b93d02cfa8412e99dc0645ca3f7e57cf75cfcb487efe33aa?d=identicon)[Budry](/maintainers/Budry)

---

Top Contributors

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

---

Tags

nettefilesKappafile systemdirectories

### Embed Badge

![Health badge](/badges/kappa-filesystem/health.svg)

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

###  Alternatives

[league/flysystem

File storage abstraction for PHP

13.6k679.9M2.5k](/packages/league-flysystem)[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.7k285.7M1.0k](/packages/league-flysystem-aws-s3-v3)[league/flysystem-local

Local filesystem adapter for Flysystem.

225267.1M82](/packages/league-flysystem-local)[mikehaertl/php-tmpfile

A convenience class for temporary files

9732.3M21](/packages/mikehaertl-php-tmpfile)[league/flysystem-memory

In-memory filesystem adapter for Flysystem.

8737.3M269](/packages/league-flysystem-memory)[league/flysystem-sftp-v3

SFTP filesystem adapter for Flysystem.

6134.8M150](/packages/league-flysystem-sftp-v3)

PHPackages © 2026

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