PHPackages                             ali-eltaweel/files - 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. ali-eltaweel/files

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

ali-eltaweel/files
==================

File Managment in PHP.

1.5.0(7mo ago)0524PHPPHP ^8.1

Since Jun 21Pushed 7mo agoCompare

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

READMEChangelog (4)Dependencies (5)Versions (8)Used By (4)

Files
=====

[](#files)

**File Managment in PHP**

- [Files](#files)
    - [Installation](#installation)
    - [Usage](#usage)
        - [Creating Files Objects](#creating-files-objects)
        - [Available File Types](#available-file-types)
        - [File Properties](#file-properties)
            - [RegularFile Properties](#regularfile-properties)
            - [Link Properties](#link-properties)
        - [File Methods](#file-methods)
            - [RegularFile Methods](#regularfile-methods)
        - [Directory Methods](#directory-methods)
        - [Link Methods](#link-methods)

---

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

[](#installation)

Install *files* via Composer:

```
composer require ali-eltaweel/files
```

Usage
-----

[](#usage)

### Creating Files Objects

[](#creating-files-objects)

Instances of the `File` abstract class can be created using the `File::make()` which looks for the file type and returns the appropriate class instance, or by directly instantiating a concrete `File` class.

```
use Files\{ Directory, File, RegularFile };

$file = File::make('path/to/file');
$file = new RegularFile('path/to/file');

$dir = File::make('path/to/dir');
$dir = new Directory('path/to/dir');
```

### Available File Types

[](#available-file-types)

- Fifo
- CharacterDevice
- Directory
- RegularFile
- Symlink

### File Properties

[](#file-properties)

PropertyTypeGetSetpathstring✅❌uidstring | integer✅✅gidstring | integer✅✅permissionsinteger✅✅modeinteger✅✅atimeinteger✅✅ctimeinteger✅❌mtimeinteger✅✅inodeinteger✅❌sizeinteger✅❌type[FileType](#available-file-types)✅❌statStat✅❌#### RegularFile Properties

[](#regularfile-properties)

PropertyTypeGetSetcontentstring✅✅#### Link Properties

[](#link-properties)

PropertyTypeGetSettargetGidstring | integer✅✅targetUidstring | integer✅✅target?File✅❌finalTarget?File✅❌### File Methods

[](#file-methods)

- copy

```
copy(Path|string $target): bool
```

- link

```
link(Path|string $target): bool
```

- symlink

```
symlink(Path|string $target): bool
```

- rename

```
rename(Path|string $target): bool
```

- touch

```
touch(?int $mtime = null, ?int $atime = null): bool
```

- remove

```
remove(): bool
```

- open

```
open(): Handles\Handle
```

#### RegularFile Methods

[](#regularfile-methods)

- transaction

```
transaction(callable $work, string $mode = 'r', Lock $lock = Lock::Exclusive): mixed
```

- setContent

```
setContent(string $content): int
```

- getContent

```
getContent(): ?string
```

### Directory Methods

[](#directory-methods)

- mkdir

```
mkdir(Path|string $name, int $permissions = 0777, bool $recursive = false): ?Directory
```

- remove

```
remove(bool $force = false): bool
```

- foreachChild

```
foreachChild(callable $callback): void
```

### Link Methods

[](#link-methods)

- chgrpTarget

```
chgrpTarget(string|int $group): bool
```

- chownTarget

```
chownTarget(string|int $user): bool
```

- readlink

```
readlink(): ?File
```

- readlinkRecursively

```
readlinkRecursively(): ?File
```

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance64

Regular maintenance activity

Popularity8

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

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

Recently: every ~9 days

Total

7

Last Release

221d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/45892756?v=4)[Ali Kamel](/maintainers/ali-eltaweel)[@ali-eltaweel](https://github.com/ali-eltaweel)

---

Top Contributors

[![ali-eltaweel](https://avatars.githubusercontent.com/u/45892756?v=4)](https://github.com/ali-eltaweel "ali-eltaweel (8 commits)")

### Embed Badge

![Health badge](/badges/ali-eltaweel-files/health.svg)

```
[![Health](https://phpackages.com/badges/ali-eltaweel-files/health.svg)](https://phpackages.com/packages/ali-eltaweel-files)
```

PHPackages © 2026

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