init without trunk
This commit is contained in:
parent
ed24ac4994
commit
bb809e7233
14652 changed files with 177862 additions and 94817 deletions
62
vendor/gedmo/doctrine-extensions/lib/Gedmo/Uploadable/FileInfo/FileInfoArray.php
vendored
Normal file
62
vendor/gedmo/doctrine-extensions/lib/Gedmo/Uploadable/FileInfo/FileInfoArray.php
vendored
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
<?php
|
||||
|
||||
namespace Gedmo\Uploadable\FileInfo;
|
||||
|
||||
/**
|
||||
* FileInfoArray
|
||||
*
|
||||
* @author Gustavo Falco <comfortablynumb84@gmail.com>
|
||||
* @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
|
||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
*/
|
||||
|
||||
class FileInfoArray implements FileInfoInterface
|
||||
{
|
||||
protected $fileInfo;
|
||||
|
||||
public function __construct(array $fileInfo)
|
||||
{
|
||||
$keys = array('error', 'size', 'type', 'tmp_name', 'name');
|
||||
|
||||
foreach ($keys as $k) {
|
||||
if (!isset($fileInfo[$k])) {
|
||||
$msg = 'There are missing keys in the fileInfo. ';
|
||||
$msg .= 'Keys needed: '.implode(',', $keys);
|
||||
|
||||
throw new \RuntimeException($msg);
|
||||
}
|
||||
}
|
||||
|
||||
$this->fileInfo = $fileInfo;
|
||||
}
|
||||
|
||||
public function getTmpName()
|
||||
{
|
||||
return $this->fileInfo['tmp_name'];
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return $this->fileInfo['name'];
|
||||
}
|
||||
|
||||
public function getSize()
|
||||
{
|
||||
return $this->fileInfo['size'];
|
||||
}
|
||||
|
||||
public function getType()
|
||||
{
|
||||
return $this->fileInfo['type'];
|
||||
}
|
||||
|
||||
public function getError()
|
||||
{
|
||||
return $this->fileInfo['error'];
|
||||
}
|
||||
|
||||
public function isUploadedFile()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
27
vendor/gedmo/doctrine-extensions/lib/Gedmo/Uploadable/FileInfo/FileInfoInterface.php
vendored
Normal file
27
vendor/gedmo/doctrine-extensions/lib/Gedmo/Uploadable/FileInfo/FileInfoInterface.php
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
namespace Gedmo\Uploadable\FileInfo;
|
||||
|
||||
/**
|
||||
* FileInfoInterface
|
||||
*
|
||||
* @author Gustavo Falco <comfortablynumb84@gmail.com>
|
||||
* @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
|
||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
*/
|
||||
|
||||
interface FileInfoInterface
|
||||
{
|
||||
public function getTmpName();
|
||||
public function getName();
|
||||
public function getSize();
|
||||
public function getType();
|
||||
public function getError();
|
||||
|
||||
/**
|
||||
* This method must return true if the file is coming from $_FILES, or false instead.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isUploadedFile();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue