Download the PHP package atk14/files without Composer

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

Files

Build Status

A PHP class for basic file manipulation.

Basic usage

Files is just a bunch of static functions.

$content = Files::GetFileContent("/path/to/a/file");

To recursively delete a directory

$items_deleted = Files::RecursiveUnlinkDir("/path/to/a/dir");

To determine a file type

$mime_type = Files::DetermineFileType("/path/to/a/file"); // "image/jpg"

To write a content to a temporary file

$temp_filename = Files::WriteToTemp($some_content);

And so on.

Usage

Directory creation

Files::Mkdir("/path/to/a/directory/"); // creates directory "/path/to/a/directory"
Files::Mkdir("/path/to/another/directory"); // creates directory /path/to/another/directory

Files::MkdirForFile("/path/to/a/file"); // creates directory "/path/to/a"

Finding files

$all_files_in_a_dir = Files::FindFiles("./dir"); // ["./dir/image.jpg", "./dir/image.png", "./dir/subdir/image2.jpg", "./dir/subdir/readme.txt"]
$files_right_in_a_dir = Files::FindFiles("./dir", ["maxdepth" => 1]); // ["./dir/image.jpg", "./dir/image.png"]

// filtering files
$images = Files::FindFiles("./dir/", ["pattern" => '/\.(png|jpg)$/']); // ["./dir/image.jpg", "./dir/image.png", "./dir/subdir/image2.jpg"]

// finding recently updated log files
$log_files = Files::FindFiles("./log/", [
  "pattern" => '/\.log$/', // only *.log files
  "min_mtime" => time() - 30 * 60 // not older than 30 minutes 
 ]);

Temporary files

// by the TEMP constant the temporary directory can be specified
define("TEMP","/path/to/temp/");

echo Files::GetTempDir(); // "/path/to/temp/";

$filename = Files::GetTempFilename(); // "/path/to/to/temp/files_tmp_5e060486c4e507.42603767"
$filename = Files::GetTempFilename("image_scaling"); // "/path/to/temp/image_scaling5e060493067748.51409402";

$filename = Files::WriteToTemp($content); // "/path/to/temp/files_tmp_5e0602ce153bd8.40620979"

File types

Files::DetermineFileType("path/to/a/file"); // "image/jpeg"

// safe file type determination on just uploaded file
Files::DetermineFileType($_FILES["file"]["tmp_name"],["original_filename" => $_FILES["file"]["name"]]);

Installation

Use the Composer to install Files.

cd path/to/your/project/
composer require atk14/files dev-master

Licence

Files is free software distributed under the terms of the MIT license


All versions of files with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.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 atk14/files contains the following files

Loading the files please wait ....