kohkimakimoto / temporary
A PHP helper class to manipulate a temporary file.
Installs: 31
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/kohkimakimoto/temporary
Requires
- php: >=5.3.0
Requires (Dev)
- fabpot/php-cs-fixer: @stable
- phpunit/phpunit: 4.*
This package is auto-updated.
Last update: 2025-09-07 02:32:06 UTC
README
A PHP helper class to manipulate a temporary file and directory.
temporary file.
use Kohkimakimoto\Temporary\TemporaryFile; $tmpfile = new TemporaryFile(); echo $tmpfile->path(); // ex) /private/var/folders/bt/xwh9qmcj00dctz53_rxclgtr0000gn/T/phpqWK5fj $tmpfile->write("temporary data..."); echo $data = $tmpfile->read(); // temporary data... // You don't need to close it. The temporary file will be closed automatically when the object removes.
temporary directory.
use Kohkimakimoto\Temporary\TemporaryDir; $tmpdir = new TemporaryDir(); echo $tmpdir->path(); // ex) /private/var/folders/bt/xwh9qmcj00dctz53_rxclgtr0000gn/T/KFHg4L // You don't need to close it. The temporary dir will be deleted automatically when the object removes.
Requirements
- PHP5.3 or later
Installation
Create composer.json
for installing via composer..
{
"require": {
"kohkimakimoto/temporary": "1.0.*"
}
}
Run composer install command.
composer install
Author
Kohki Makimoto kohki.makimoto@gmail.com
License
MIT license.