Download the PHP package brunonatali/file without Composer

On this page you can find all versions of the php package brunonatali/file. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package file

File

Use this library to manipulate and interact with the file system.
Note. Some functions or classes cannot interact with the Windows system, so use it with caution.

WARNING: The reactphp/event-loop to work, but it was not added as required in the composer configuration so as not to force the average user to include a library that they will never use, so don't forget to require it when installing your program, if you are going to use this class.

Table of Contents

OnFileChange

OnFileChange is a little help for you to monitor when a file has been modified and take some action from it.

Read the following notes

This class supports debug by including brunonatali/tools in your composer project.

ATENTION: The reactphp/event-loop to work, include it by hand in your project!

PERFORMANCE: For performance purpouses install the inotify PECL extension and include brunonatali/inotify in your project.

Polling example

Inotify example

Install brunonatali/inotify in your project by typing:

OFC Configuration

Configuations are passed in array format on 4th OnFileChange() arg as follows:

OFC start()

Used to starts watching file change. Only takes effect when stoped or initialized with 'auto_start' => false.
This function dos not return nothing.

OFC stop()

Stops file change verification. This function dos not return nothing.

OFC setPollingTime()

Configure polling time when using this method.

OFC static isFileChanged()

You can manually check file changes by calling isFileChanged(). This function is provided statically to could be called by hand

JsonFile

This class is available with static functions for easy interaction, with the objective of easy manipulation / creation of JSON files.

readAsArray()

Reads entire json file as array. This function is meant to be a function to simplify use of native PHP functions file_get_contents() and json_decode(), adding some validations.
Simple call:

saveArray()

Save provided array to a JSON file, returning a boolean success result.
You can provide PHP JSON flags.

FileHandler

File handler was designed to be an stream file reader, but was not reviewed and not documented yet.

Install

The recommended way to install this library is through Composer. New to Composer?

This project follows SemVer. This will install the latest supported version:

This project aims to run on Linux and require other components and inotify PHP extension, to work properly, follow each section instructions to get what you need.
If you find a bug, please report.

License

MIT, see LICENSE file.


All versions of file with dependencies

PHP Build Version
Package Version
Requires php Version >=7
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package brunonatali/file contains the following files

Loading the files please wait ....