Download the PHP package modevsome/mofilesmanager without Composer

On this page you can find all versions of the php package modevsome/mofilesmanager. 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 mofilesmanager

Latest Stable Version Total Downloads License

moFilesManager is a small library for handling files and folders more easier in PHP.
The library provide two objects, one for handling files and one for handling folders.

Required Configuration

php: >=7.0.0
Fileinfo PHP extension

How to use

Installation

The better way for adding moFilesManager to your application is to use Composer by launching it in your dev environment, here's the URL of the Packagist page : https://packagist.org/packages/modevsome/mofilesmanager

You can also download the last release.

Tests

Once moFilesManager is added into your application, don't hesitate to play some tests for checking the basic functions of the library. Open you command line tool and execute the following command :

You can ask a log file of the tests by adding ths param : -log

Basic usage

You can read the method summary below to find out all the features.

#f03c15 IMPORTANTS ADVICES #f03c15

moFilesManager\Folder methodes summary

Create a Folder instance

This method return an instance of the Folder class. The path is optionnal at this step, and can be changed later.

Change the path

This method change the path value of the Folder object. This method is fluent, it return the current object.

Create the folder

This method create the folder on the disk. This method return TRUE in case of success, else FALSE.

Copy the folder

This method recursively duplicat the current folder at the provided location defined in the required $copy_path param. All the content of the folder will be duplicated, including files and subfolders.
The boolean param $replace is optionnal. If the param is equal to TRUE, the folder we be replaced if it already exist, if tthe param is equal to FALSE, the existing folder will be not replaced. By default the param is equal to TRUE.
This method return TRUE in case of success, else FALSE.

Rename the folder

This method change the name of the current folder. The provided $new_name should not be a path, just a folder name.
The boolean param $replace is optionnal. If the param is equal to TRUE, the folder we be replaced if it already exist, if tthe param is equal to FALSE, the existing folder will be not replaced. By default the param is equal to TRUE.
This method return TRUE in case of success, else FALSE.

Move the folder

This method duplicat the current folder at the provided location defined in the required $copy_path param. All the content of the folder will be moved, including files and subfolders.
The boolean param $replace is optionnal. If the param is equal to TRUE, the folder we be replaced if it already exist, if tthe param is equal to FALSE, the existing folder will be not replaced. By default the param is equal to TRUE.
This method return TRUE in case of success, else FALSE.

Drain the folder

This method recursively remove all items contained into the folder.
A rollback function minimise the impact of eventual errors occurred during the process.
This method return TRUE in case of success, else FALSE.

Delete the folder

This method delete the folder, even if there's files or subfolders contained in the folder.
A rollback function minimise the impact of eventual errors occurred during the process.
This method return TRUE in case of success, else FALSE.

Make a Zip archive of the folder

All the items will be recursively added in the archive.
@param string $archive_name : The path of the zip file that will be made. Default : The folder parent path
@param boolean $replace : True to replace the current file if it already exist. Default : TRUE
@param array $options : An array containing some options : 'compression_method', 'compression_level'
This method return TRUE in case of success, else FALSE.

Extract an archive zip into the the current folder

The path of the zip file must be provided throw the param $archive_path.
The boolean param $replace is optionnal. If the param is equal to TRUE, the folder we be replaced if it already exist, if the param is equal to FALSE, the existing folder will be not replaced. By default the param is equal to TRUE.
A rollback function minimise the impact of eventual errors occurred during the process. This method return TRUE in case of success, else FALSE.

IMPORTANT : The extracted archive need to be outside the target folder.

moFilesManager\File methodes summary

Create a File instance

This method return an instance of the File class. The path is optionnal at this step, and can be changed later.

Change the path

This method change the path value of the File object. This method is fluent, it return the current object.

Get the current file content

Return the file content as a string.

Set the current file content

This method change the content of the file.
The content of the file is NOT saved as long as the method write() is not called.
This method is fluent, it return the current object.

Add content to the current file

This method Append or Prepend the provided content to the current content string. The content of the file is NOT saved as long as the method write() is not called.
This method is fluent, it return the current object.

Create or replace the current file on the disk

This method save the current file on the disk.
The boolean param $replace is optionnal. If the param is equal to TRUE, the file we be replaced if it already exist, if tthe param is equal to FALSE, the existing file will be not replaced. By default the param is equal to TRUE.
This method return TRUE in case of success, else FALSE.

Copy the current file

This method duplicat the current at the provided location defined in the required $copy_path param.
The boolean param $replace is optionnal. If the param is equal to TRUE, the file we be replaced if it already exist, if tthe param is equal to FALSE, the existing file will be not replaced. By default the param is equal to TRUE.
This method return TRUE in case of success, else FALSE.

Rename the current file

This method change the name of the current file, BUT it does not move the file. The provided $new_name should not be a path, just a file name.
The boolean param $replace is optionnal. If the param is equal to TRUE, the file we be replaced if it already exist, if tthe param is equal to FALSE, the existing file will be not replaced. By default the param is equal to TRUE.
This method return TRUE in case of success, else FALSE.

Move the current file

This method move the current file at the provided location defined in the required $new_path param.
The boolean param $replace is optionnal. If the param is equal to TRUE, the file we be replaced if it already exist, if tthe param is equal to FALSE, the existing file will be not replaced. By default the param is equal to TRUE.
This method return TRUE in case of success, else FALSE.

Delete the current file

This method delete the current file. This method return TRUE in case of success, else FALSE.

Upload a file

This method upload a file.
@param $tmp_name : The file tmp_name (required). It can be found in the associeted row of the superglobal $_FILES.
@param $replace : TRUE to replace the current file if it already exist. Default : TRUE
@param $allowed_types : An array which contain one or more file type that will be accepted, if this param if empty, all types will be accepted.
@param $max_size : The allowed maximum file size (must be provided in BYTES).
This method return TRUE in case of success, else FALSE.

Get the FileStream

DO NOT FORGET TO CLOSE the STREAM with FCLOSE!
@param string $fopenMode
@param boolean $forceFolderCreation
@return mixed Returns a file pointer resource on success, or FALSE on failure
@since 1.1.4

moFilesManager\moFilesManager methodes summary

The following methods must be called statically.

Enable/Disable debuging

By default debuging is disabled, set debuging to TRUE if you want to use the trace log

Return nothing (void)

Get the current debuging state

Get all recorded traces

Return an array containing all recorded traces during the several process

Get the last recorded trace

Return a string which contain the last logged content

Rebuild and Secure a given path by removing illegitimate directory separator

Return a string which contain the cleaned path


All versions of mofilesmanager with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.0
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 modevsome/mofilesmanager contains the following files

Loading the files please wait ....