Download the PHP package thomas-squall/file-utils without Composer

On this page you can find all versions of the php package thomas-squall/file-utils. 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-utils

File Utils for php

List of available functions

1) require_all_files 2) require_once_all_files 3) include_all_files 4) include_once_all_files 5) get_all_files 6) get_all_dirs 7) file_get_json 7) file_put_json

require_all_files

Description

Requires all the files in a folder that matches the provided pattern.

Definition

require_all_files($dir, $pattern = "*.php", $callback = null)

Where: 1) $dir is the directory where the files are located 2) $pattern is the pattern used to find the files (*.php by default) 3) $recursive will fetch also the child folders if set to true (default is false) 4) $callback is the callback called per each file (null by default, the file path will be passed as parameter)

Usage

require_once_all_files

Description

Requires once all the files in a folder that matches the provided pattern.

Definition

require_once_all_files($dir, $pattern = "*.php", $callback = null)

Where: 1) $dir is the directory where the files are located 2) $pattern is the pattern used to find the files (*.php by default) 3) $recursive will fetch also the child folders if set to true (default is false) 4) $callback is the callback called per each file (null by default, the file path will be passed as parameter)

Usage

include_all_files

Description

Includes all the files in a folder that matches the provided pattern.

Definition

include_all_files($dir, $pattern = "*.php", $callback = null)

Where: 1) $dir is the directory where the files are located 2) $pattern is the pattern used to find the files (*.php by default) 3) $recursive will fetch also the child folders if set to true (default is false) 4) $callback is the callback called per each file (null by default, the file path will be passed as parameter)

Usage

include_once_all_files

Description

Includes once all the files in a folder that matches the provided pattern.

Definition

include_once_all_files($dir, $pattern = "*.php", $callback = null)

Where: 1) $dir is the directory where the files are located 2) $pattern is the pattern used to find the files (*.php by default) 3) $recursive will fetch also the child folders if set to true (default is false) 4) $callback is the callback called per each file (null by default, the file path will be passed as parameter)

Usage

get_all_files

Description

Get all the files in a folder that matches the provided pattern.

Definition

get_all_files($dir, $recursive = false)

Where: 1) $dir is the directory where the files are located 2) $recursive will fetch also the children folders if set to true (default is false)

Usage

get_all_dirs

Description

Returns all the directories in a given directory.

Definition

get_all_dirs($dir, $recursive = false)

Where: 1) $dir is the directory where the files are located 2) $recursive will fetch also the children directories if set to true (default is false)

Usage

file_get_json

Description

Reads the content of a json file and returns it as array or object. Please Note: if the content is not a json encoded string an empty array will be returned.

Definition

file_get_json($file, $associative = true)

Where: 1) $file is the path to the file that we want to read 2) $associative will return the content as associative array when true, as object when false

Usage

file_put_json

Description

Saves an array or an object into a json file.

Definition

file_put_json($file, $content, $pretty = true)

Where: 1) $file is the path to the file that we want to save the content to 2) $content is the content we want to save (array or object) 3) $pretty will save the content prettified when true, minified when false

Usage

More utilities coming...


All versions of file-utils with dependencies

PHP Build Version
Package Version
Requires thomas-squall/string-utils Version ^0.5.5
ext-json Version *
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 thomas-squall/file-utils contains the following files

Loading the files please wait ....