PHPackages                             canaryphp/canaryphpfile - 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. canaryphp/canaryphpfile

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

canaryphp/canaryphpfile
=======================

CanaryPHPFile Simple File Managing for php

v1.0(6y ago)1161MITPHPPHP &gt;=5.6.0

Since Dec 24Pushed 6y ago1 watchersCompare

[ Source](https://github.com/canaryphp/canaryphpfile)[ Packagist](https://packagist.org/packages/canaryphp/canaryphpfile)[ RSS](/packages/canaryphp-canaryphpfile/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (1)

CanaryPHPFile File Managing
===========================

[](#canaryphpfile-file-managing)

Simple file manging for php

Classes Feature
===============

[](#classes-feature)

- Copy and move
- read and write
- Check file (Image|Audio|Video|Text)

How to Install
--------------

[](#how-to-install)

- **Availlable only with Composer :**
- Command :

```
composer require canaryphp/canaryphpfile

```

- composer.json

```
{
    "require":{
        "canaryphp/canaryphpfile"
    }
}
```

- **After install read :**`CanaryPHPTools START.md`: [START.md](https://github.com/canaryphp/canaryphptools/blob/master/START.md)

### Examples

[](#examples)

1. Copy an File

```
require 'vendor/autoload.php';
$canary = new \CanaryPHPFile\Canary();
$canary->file(__DIR__.DS.'text.txt')->setNewName('new_name.txt')
                                    ->setNewDir(__DIR__.DS.'move_to')
                                    ->copy();
```

2. Move an file

```
require 'vendor/autoload.php';
$canary = new \CanaryPHPFile\Canary();
$canary->file(__DIR__.DS.'text.txt')->setNewName('new_name.txt')
                                    ->setNewDir(__DIR__.DS.'move_to')
                                    ->move();
```

3. get file info :

```
require 'vendor/autoload.php';
$canary = new \CanaryPHPFile\Canary();
$file = $canary->file(__DIR__.DS.'text.txt')->getInfo();
echo "";
var_dump($file);
echo "";
```

3. Check file :

```
require 'vendor/autoload.php';
$canary = new \CanaryPHPFile\Canary();
$file = $canary->file(__DIR__.DS.'text.txt');
//Check image
$image = $file->checkImage();
//Check Text
$text =  $file->checkText();
//Check Audio
$audio = $file->checkAudio();
//Check Video
$video = $file->checkVideo();
echo "";
var_dump("File is Image :",$image);
echo "";
echo var_dump("File is text :",$text);
echo "";
echo var_dump("File is audio :",$audio);
echo "";
echo var_dump("File is video :",$video);
echo "";
/**
 * output :
 * string(15) "File is Image :"bool(false)
 * string(14) "File is text :"bool(true)
 * string(15) "File is audio :"bool(false)
 *string(15) "File is video :"bool(false)
 */
```

4. Put , get file content and delete file:

```
require 'vendor/autoload.php';
$canary = new \CanaryPHPFile\Canary();
$file = $canary->file(__DIR__.DS.'text.txt');
//Put new file content
$file->put('This new Content');
//get file content
$content = $file->get();
//show content
var_dump($content);
//Delete file
$file->delete();
/**
 * // output :
 *
 * string(16) "This new Content"
 *
 */
```

4. Show Error :

```
require 'vendor/autoload.php';
$canary = new \CanaryPHPFile\Canary();
$file = $canary->file(__DIR__.DS.'text.txt');
$file->setNewName('new_name.txt')
                                ->setNewDir(__DIR__.DS.'doesnt/exist/folder')
                                ->move();
var_dump($file->FILE_ERRORS());
/**
 * //output
 *
 * array(1) { [0]=> string(95) "FileError(E:\xampp\htdocs\canary_file\doesnt/exist/folder) : The folder does not exist ." }
 *
 */
```

NOTICE
======

[](#notice)

- `vendor` folder and the `vendor/autoload.php` script are generated by composer ,there are not part from CanaryPHPFile

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

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

Unknown

Total

1

Last Release

2337d ago

### Community

Maintainers

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

---

Top Contributors

[![canaryphp](https://avatars.githubusercontent.com/u/58607374?v=4)](https://github.com/canaryphp "canaryphp (2 commits)")

### Embed Badge

![Health badge](/badges/canaryphp-canaryphpfile/health.svg)

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

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[google/cloud-storage

Cloud Storage Client for PHP

34390.8M125](/packages/google-cloud-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)

PHPackages © 2026

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