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

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

eden/file
=========

File methods

4.0.1(10y ago)2418.4k↓34.3%6[1 issues](https://github.com/Eden-PHP/File/issues)9MITPHPPHP &gt;=5.4.1

Since Oct 7Pushed 10y ago3 watchersCompare

[ Source](https://github.com/Eden-PHP/File)[ Packagist](https://packagist.org/packages/eden/file)[ Docs](http://eden-php.com)[ RSS](/packages/eden-file/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (4)Versions (4)Used By (9)

[![logo](https://camo.githubusercontent.com/683ba05b2b51f50045c674b19a4f0ceb30702a8ab495623be7c02e07ab226f08/687474703a2f2f6564656e2e6f70656e6f766174652e636f6d2f6173736574732f696d616765732f636c6f75642d736f6369616c2e706e67)](https://camo.githubusercontent.com/683ba05b2b51f50045c674b19a4f0ceb30702a8ab495623be7c02e07ab226f08/687474703a2f2f6564656e2e6f70656e6f766174652e636f6d2f6173736574732f696d616765732f636c6f75642d736f6369616c2e706e67) Eden File
===============================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#-eden-file)

[![Build Status](https://camo.githubusercontent.com/dfd8349ffe7b6ae1ef657aa9d8f529d103e0519ee880a507e3e89e69aac051c4/68747470733a2f2f6170692e7472617669732d63692e6f72672f4564656e2d5048502f46696c652e737667)](https://travis-ci.org/Eden-PHP/File)
==================================================================================================================================================================================================================================================

[](#)

- [Install](#install)
- [Introduction](#intro)
- [API](#api)
    - [isFile](#isFile)
    - [getBase](#getBase)
    - [getContent](#getContent)
    - [getData](#getData)
    - [getExtension](#getExtension)
    - [getFolder](#getFolder)
    - [getMime](#getMime)
    - [getName](#getName)
    - [getSize](#getSize)
    - [getTime](#getTime)
    - [setContent](#setContent)
    - [setData](#setData)
    - [remove](#remove)
    - [touch](#touch)
- [Contributing](#contributing)

====

Install
-------

[](#install)

`composer install eden/file`

====

Introduction
------------

[](#introduction)

Instantiate file in this manner.

```
$file = eden('file', '/some/path/to/file.txt');

```

====

API
---

[](#api)

====

### isFile

[](#isfile)

Checks to see if this path is a real file

#### Usage

[](#usage)

```
eden('file', '/some/path/to/file.txt')->isFile();

```

#### Parameters

[](#parameters)

Returns `bool`

====

### getBase

[](#getbase)

Returns the base file name with out the extension

#### Usage

[](#usage-1)

```
eden('file', '/some/path/to/file.txt')->getBase();

```

#### Parameters

[](#parameters-1)

Returns `string`

====

### getContent

[](#getcontent)

Returns the contents of a file given the path

#### Usage

[](#usage-2)

```
eden('file', '/some/path/to/file.txt')->getContent();

```

#### Parameters

[](#parameters-2)

Returns `string`

====

### getData

[](#getdata)

Returns the executes the specified file and returns the final value

#### Usage

[](#usage-3)

```
eden('file', '/some/path/to/file.txt')->getData();

```

#### Parameters

[](#parameters-3)

Returns `bool`

====

### getExtension

[](#getextension)

Returns the base file name extension

#### Usage

[](#usage-4)

```
eden('file', '/some/path/to/file.txt')->getExtension();

```

#### Parameters

[](#parameters-4)

Returns `string|null`

====

### getFolder

[](#getfolder)

Returns the file path

#### Usage

[](#usage-5)

```
eden('file', '/some/path/to/file.txt')->getFolder();

```

#### Parameters

[](#parameters-5)

Returns `string`

====

### getMime

[](#getmime)

Returns the mime type of a file

#### Usage

[](#usage-6)

```
eden('file', '/some/path/to/file.txt')->getMime();

```

#### Parameters

[](#parameters-6)

Returns `string`

====

### getName

[](#getname)

Returns the file name

#### Usage

[](#usage-7)

```
eden('file', '/some/path/to/file.txt')->getName();

```

#### Parameters

[](#parameters-7)

Returns `string`

====

### getSize

[](#getsize)

Returns the size of a file in bytes

#### Usage

[](#usage-8)

```
eden('file', '/some/path/to/file.txt')->getSize();

```

#### Parameters

[](#parameters-8)

Returns `string`

====

### getTime

[](#gettime)

Returns the last time file was modified in UNIX time

#### Usage

[](#usage-9)

```
eden('file', '/some/path/to/file.txt')->getTime();

```

#### Parameters

[](#parameters-9)

Returns `int`

====

### setContent

[](#setcontent)

Creates a file and puts specified content into that file

#### Usage

[](#usage-10)

```
eden('file', '/some/path/to/file.txt')->setContent(*string $content);

```

#### Parameters

[](#parameters-10)

- `*string $content` - The raw content to save

Returns `Eden\File\Index`

#### Example

[](#example)

```
eden('file', '/some/path/to/file.txt')->setContent('foo');

```

====

### setData

[](#setdata)

Creates a php file and puts specified variable into that file

#### Usage

[](#usage-11)

```
eden('file', '/some/path/to/file.txt')->setData(*mixed $variable);

```

#### Parameters

[](#parameters-11)

- `*mixed $variable` - Whatever data to save

Returns `Eden\File\Index`

#### Example

[](#example-1)

```
eden('file', '/some/path/to/file.txt')->setData($variable);

```

====

### remove

[](#remove)

Removes a file

#### Usage

[](#usage-12)

```
eden('file', '/some/path/to/file.txt')->remove();

```

#### Parameters

[](#parameters-12)

Returns `Eden\File\Index`

====

### touch

[](#touch)

Touches a file (effectively creates the file if it doesn't exist and updates the date if it does)

#### Usage

[](#usage-13)

```
eden('file', '/some/path/to/file.txt')->touch();

```

#### Parameters

[](#parameters-13)

Returns `Eden\File\Index`

====

\#Contributing to Eden

Contributions to *Eden* are following the Github work flow. Please read up before contributing.

\##Setting up your machine with the Eden repository and your fork

1. Fork the repository
2. Fire up your local terminal create a new branch from the `v4` branch of your fork with a branch name describing what your changes are. Possible branch name types:
    - bugfix
    - feature
    - improvement
3. Make your changes. Always make sure to sign-off (-s) on all commits made (git commit -s -m "Commit message")

\##Making pull requests

1. Please ensure to run `phpunit` before making a pull request.
2. Push your code to your remote forked version.
3. Go back to your forked version on GitHub and submit a pull request.
4. An Eden developer will review your code and merge it in when it has been classified as suitable.

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity60

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

Total

3

Last Release

3885d ago

PHP version history (2 changes)v4PHP &gt;=5.3.1

4.0.1PHP &gt;=5.4.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/120378?v=4)[Christian Blanquera](/maintainers/cblanquera)[@cblanquera](https://github.com/cblanquera)

---

Top Contributors

[![clark21](https://avatars.githubusercontent.com/u/5639521?v=4)](https://github.com/clark21 "clark21 (6 commits)")

---

Tags

libraryeden

### Embed Badge

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

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

###  Alternatives

[eden/mail

Eden POP3, IMAP and SMTP component

179276.6k1](/packages/eden-mail)[eden/sqlite

Eden SQLite Search, Collection, Model ORM componen

199.2k2](/packages/eden-sqlite)[erlandmuchasaj/laravel-file-uploader

A simple package to help you easily upload files to your laravel project.

139.2k](/packages/erlandmuchasaj-laravel-file-uploader)

PHPackages © 2026

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