Laravel version update

Laravel version update
This commit is contained in:
Manish Verma
2018-08-06 18:48:58 +05:30
parent d143048413
commit 126fbb0255
13678 changed files with 1031482 additions and 778530 deletions

View File

@@ -0,0 +1,41 @@
<?php
namespace Flow;
class Uploader
{
/**
* Delete chunks older than expiration time.
*
* @param string $chunksFolder
* @param int $expirationTime seconds
*
* @throws FileOpenException
*/
public static function pruneChunks($chunksFolder, $expirationTime = 172800)
{
$handle = opendir($chunksFolder);
if (!$handle) {
throw new FileOpenException('failed to open folder: '.$chunksFolder);
}
while (false !== ($entry = readdir($handle))) {
if ($entry == "." || $entry == ".." || $entry == ".gitignore") {
continue;
}
$path = $chunksFolder.DIRECTORY_SEPARATOR.$entry;
if (is_dir($path)) {
continue;
}
if (time() - filemtime($path) > $expirationTime) {
unlink($path);
}
}
closedir($handle);
}
}