PHP code example of tourze / symfony-temp-file-bundle
1. Go to this page and download the library: Download tourze/symfony-temp-file-bundle library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
tourze / symfony-temp-file-bundle example snippets
Tourze\TempFileBundle\TempFileBundle::class => ['all' => true],
use Tourze\TempFileBundle\Service\TemporaryFileService;
// Inject TemporaryFileService
'tempFile = $temporaryFileService->generateTemporaryFileName('prefix_', 'txt');
file_put_contents($tempFile, 'hello world');
// The temp file will be automatically deleted at the end of the request or command
$temporaryFileService->addTemporaryFile($filePath);