Skip to content

filipe-magellan/php-tmpfile

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

php-tmpfile

Build Status Latest Stable Version Total Downloads Latest Unstable Version HHVM Status License

A convenience class for temporary files.

Features

  • Create temporary file with arbitrary content
  • Delete file after use
  • Send file to client, either inline or with save dialog
  • Save file locally

Examples

<?php
use mikehaertl\tmp\File;

$file = new File('some content', '.html');

// send to client for download
$file->send('home.html');

// save to disk
$file->saveAs('/dir/test.html');

// Access file name and directory
echo $file->getFileName();
echo $file->getTempDir();

About

A convenience class for temporary files

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%