for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace h4kuna\Upload\Driver;
use h4kuna\Upload\IDriver,
Nette\Http;
use h4kuna\Upload\IStoreFile;
class LocalFilesystem implements IDriver
{
/** @var string */
private $destinationDir;
public function __construct($destinationDir)
$this->destinationDir = $destinationDir;
}
public function save(Http\FileUpload $fileUpload, $pathname)
$fileUpload->move($this->createURI($pathname));
public function createURI($relativePath)
if ($relativePath instanceof IStoreFile) {
$relativePath = $relativePath->getRelativePath();
return $this->destinationDir . DIRECTORY_SEPARATOR . $relativePath;
public function isFileExists($pathname)
return is_file($this->createURI($pathname));
public function createName(Http\FileUpload $fileUpload)
return NULL;