Skip to content

dmromanov/cakephp-tmpfile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TmpFile plugin for CakePHP

Latest Stable Version Minimum PHP Version Build Status codecov

This plugins provides class for creating temporary files, that are guaranteed to be deleted after program termination, and is compatible with CakePHP\Filesystem\File API.

Usage

Create unique temporary files:

$tmpFile1 = new TmpFile();
$tmpFile2 = new TmpFile(
    'foo-',
    TMP . 'bar',
    0644
)
$tmpFile2->close();

// use as a regular CakePHP\Filesystem\File
$tmpfile->open()
$tmpfile->write($data);
$tmpfile->close();

After a program termination (regular or after a crash) the file will be deleted.

Constructor's parameters:

string $prefix The prefix of the generated temporary filename.
string $path The directory where the temporary filename will be created
int $mode File permissions

Installation

You can install this plugin into your CakePHP application using composer.

The recommended way to install composer packages is:

composer require dmromanov/cakephp-tmpfile

About

Temporary File class for the CakePHP Framework

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages