PHPackages                             anekdotes/file - 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. anekdotes/file

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

anekdotes/file
==============

Provides an easier way to manipulate file for common use like move,rename etc.

2.0.0(4y ago)01.0k12MITPHPPHP &gt;=7.4.0

Since Mar 18Pushed 4y ago2 watchersCompare

[ Source](https://github.com/anekdotes/file)[ Packagist](https://packagist.org/packages/anekdotes/file)[ Docs](https://github.com/anekdotes/file)[ RSS](/packages/anekdotes-file/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (7)Used By (2)

Anekdotes File
==============

[](#anekdotes-file)

[![Latest Stable Version](https://camo.githubusercontent.com/71b4269c6de914524794d34658dbd9da76ec60f52a347cf0a81f3e518edb7151/68747470733a2f2f706f7365722e707567782e6f72672f616e656b646f7465732f66696c652f762f737461626c65)](https://packagist.org/packages/anekdotes/file)[![Build Status](https://camo.githubusercontent.com/57347a9537d732a9bb9fb786d6e2d433c32c22c788bc820695d34f50153d15a4/68747470733a2f2f7472617669732d63692e6f72672f616e656b646f7465732f66696c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/anekdotes/file)[![StyleCI](https://camo.githubusercontent.com/4d8fdc6ab2e63735a78f4cf320ace6593dbdcc55c98b0af0ca320d70dcdcfb5d/68747470733a2f2f7374796c6563692e696f2f7265706f732f35343135303634322f736869656c643f7374796c653d666c6174)](https://styleci.io/repos/54150642)[![License](https://camo.githubusercontent.com/f0dc3417e28f41572c1c1d70b878b8ac6686a01878829a1b453da9652a778144/68747470733a2f2f706f7365722e707567782e6f72672f616e656b646f7465732f66696c652f6c6963656e7365)](https://packagist.org/packages/anekdotes/file)[![Total Downloads](https://camo.githubusercontent.com/9af96bd015dc87e60560c625abda81ca135d0fca108424da86afee0d0a4b3cdf/68747470733a2f2f706f7365722e707567782e6f72672f616e656b646f7465732f66696c652f646f776e6c6f616473)](https://packagist.org/packages/anekdotes/file)

A library that provides an easy way to manipulate files for common uses such as move, rename etc.

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

[](#installation)

Install via composer into your project:

```
composer require anekdotes/file

```

Usage
-----

[](#usage)

Use the class where ever you need it:

```
use Anekdotes\File\File;
```

Note : This requires autoloading namespaces. Using composer to do autoloading helps a lot.

### Methods

[](#methods)

Multiple static methods are available:

#### get

[](#get)

Get the content of a file.

- **$path**: path of the file
- **$default**: closure or string

```
File::get($path, $default = null);
```

#### exists

[](#exists)

Check if file exists.

- **$path**: path of the file

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

#### Put

[](#put)

Create a new file.

- **$path**: path of the desired file location
- **$contents**: content of the file

```
File::put($path, $contents)
```

#### size

[](#size)

Get the file size in bytes.

- **$path**: path of the file

```
File::size($path)
```

#### delete

[](#delete)

Delete a file.

- **$path**: path of the file

```
File::delete($path)
```

#### move

[](#move)

Move/rename a file.

- **$path**: path of the file to move
- **$target**: target of the file

```
File::move($path, $target)
```

#### copy

[](#copy)

Copy a file.

- **$path**: path of the file to copy
- **$target**: target of the file

```
File::copy($path, $target)
```

#### extension

[](#extension)

Get the file extension.

- **$path**: path of the file

```
File::extension($path)
```php

#### isDirectory

Check if path is a directory.

* **$path**: path of the directory

```php
isDirectory($directory)

```

#### glob

[](#glob)

Returns an array of all files/folder inside a directory

- **$path**: path of the directory

```
File::glob($path)
```

#### directories

[](#directories)

Returns an array of all folders inside a directory

- **$path**: path of the directory

```
File::directories($path)
```

#### files

[](#files)

Returns an array of all files inside a directory

- **$directory**: path of the directory

```
File::files($directory)
```

#### isFile

[](#isfile)

Check if path is a file.

- **$path**: path of the file

```
File::isFile($file)
```

#### makeDirectory

[](#makedirectory)

Create a directory.

- **$path**: desired path
- **$mode**: folder mod

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

#### deleteDirectory

[](#deletedirectory)

Delete a directory.

- **$directory**: path of directory

```
File::deleteDirectory($directory)
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 89.5% 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 ~415 days

Recently: every ~519 days

Total

6

Last Release

1628d ago

Major Versions

1.0.4 → 2.0.02021-11-24

PHP version history (2 changes)1.0.0PHP &gt;=5.3.0

2.0.0PHP &gt;=7.4.0

### Community

Maintainers

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

---

Top Contributors

[![franatieu](https://avatars.githubusercontent.com/u/4522233?v=4)](https://github.com/franatieu "franatieu (17 commits)")[![Grasseh](https://avatars.githubusercontent.com/u/2159610?v=4)](https://github.com/Grasseh "Grasseh (2 commits)")

---

Tags

filedirectoryrenamemove

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/anekdotes-file/health.svg)

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

###  Alternatives

[adlawson/vfs

Virtual file system

300433.0k21](/packages/adlawson-vfs)[naucon/file

This package contains php classes to access, change, copy, delete, move, rename files and directories.

2525.4k1](/packages/naucon-file)[crysalead/dir

Recursive directory scanner to locate directories and/or files in a file system

13214.5k4](/packages/crysalead-dir)[icecave/temptation

Painless temporary files and directories that clean up after themselves.

129.3k2](/packages/icecave-temptation)

PHPackages © 2026

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