dev-master
9999999-dev https://github.com/gocom/eienPHP helper library for handling temporary files
MIT
The Requires
- php >=5.2.0
The Development Requires
by Jukka Svahn
file directory temporary temp tmp
PHP helper library for handling temporary files
Packagist | Twitter | Issues | , (*1)
Eien is a small PHP helper library for handling temporary files. Get, create, make, remove and flush temporary files and directories. Currently unstable, work in progress., (*2)
echo (string) new Rah_Eien_Temporary_File();
The file is moved to location specified with the optional Rah_Eien_File::$final option, if defined. The moving is performed once there are no other references to the instance, script is closed or when the move() method is called., (*3)
$tmp = new Rah_Eien_File(); $tmp->final('/path/to/final/location.txt'); $file = new Rah_Eien_Temporary_File($tmp);
If you want moving to happen automatically, the easiest ways are extending, which allows you to perform your actions within it, unsetting the instance once you are done with it or wrapping the instance to its own contexts, like an anonymous function., (*4)
In addition to creating brand new temporary files, or getting paths as strings, you can also create temporary file instances from other files. The specified files are copied to your temporary directory, and you get an instance point to the new temporary instance., (*5)
$tmp = new Rah_Eien_File(); $tmp->file('/path/to/source/file.txt'); echo (string) new Rah_Eien_Temporary_File($tmp);
echo (string) new Rah_Eien_Temporary_Directory();
PHP helper library for handling temporary files
MIT
file directory temporary temp tmp