Pressroom template verwijderd, website naar root van repo
This commit is contained in:
157
vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithContentTypes.php
vendored
Normal file
157
vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithContentTypes.php
vendored
Normal file
@@ -0,0 +1,157 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Http\Concerns;
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
trait InteractsWithContentTypes
|
||||
{
|
||||
/**
|
||||
* Determine if the given content types match.
|
||||
*
|
||||
* @param string $actual
|
||||
* @param string $type
|
||||
* @return bool
|
||||
*/
|
||||
public static function matchesType($actual, $type)
|
||||
{
|
||||
if ($actual === $type) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$split = explode('/', $actual);
|
||||
|
||||
return isset($split[1]) && preg_match('#'.preg_quote($split[0], '#').'/.+\+'.preg_quote($split[1], '#').'#', $type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the request is sending JSON.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isJson()
|
||||
{
|
||||
return Str::contains($this->header('CONTENT_TYPE'), ['/json', '+json']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the current request probably expects a JSON response.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function expectsJson()
|
||||
{
|
||||
return ($this->ajax() && ! $this->pjax()) || $this->wantsJson();
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the current request is asking for JSON in return.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function wantsJson()
|
||||
{
|
||||
$acceptable = $this->getAcceptableContentTypes();
|
||||
|
||||
return isset($acceptable[0]) && Str::contains($acceptable[0], ['/json', '+json']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether the current requests accepts a given content type.
|
||||
*
|
||||
* @param string|array $contentTypes
|
||||
* @return bool
|
||||
*/
|
||||
public function accepts($contentTypes)
|
||||
{
|
||||
$accepts = $this->getAcceptableContentTypes();
|
||||
|
||||
if (count($accepts) === 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$types = (array) $contentTypes;
|
||||
|
||||
foreach ($accepts as $accept) {
|
||||
if ($accept === '*/*' || $accept === '*') {
|
||||
return true;
|
||||
}
|
||||
|
||||
foreach ($types as $type) {
|
||||
if ($this->matchesType($accept, $type) || $accept === strtok($type, '/').'/*') {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the most suitable content type from the given array based on content negotiation.
|
||||
*
|
||||
* @param string|array $contentTypes
|
||||
* @return string|null
|
||||
*/
|
||||
public function prefers($contentTypes)
|
||||
{
|
||||
$accepts = $this->getAcceptableContentTypes();
|
||||
|
||||
$contentTypes = (array) $contentTypes;
|
||||
|
||||
foreach ($accepts as $accept) {
|
||||
if (in_array($accept, ['*/*', '*'])) {
|
||||
return $contentTypes[0];
|
||||
}
|
||||
|
||||
foreach ($contentTypes as $contentType) {
|
||||
$type = $contentType;
|
||||
|
||||
if (! is_null($mimeType = $this->getMimeType($contentType))) {
|
||||
$type = $mimeType;
|
||||
}
|
||||
|
||||
if ($this->matchesType($type, $accept) || $accept === strtok($type, '/').'/*') {
|
||||
return $contentType;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether a request accepts JSON.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function acceptsJson()
|
||||
{
|
||||
return $this->accepts('application/json');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether a request accepts HTML.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function acceptsHtml()
|
||||
{
|
||||
return $this->accepts('text/html');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the data format expected in the response.
|
||||
*
|
||||
* @param string $default
|
||||
* @return string
|
||||
*/
|
||||
public function format($default = 'html')
|
||||
{
|
||||
foreach ($this->getAcceptableContentTypes() as $type) {
|
||||
if ($format = $this->getFormat($type)) {
|
||||
return $format;
|
||||
}
|
||||
}
|
||||
|
||||
return $default;
|
||||
}
|
||||
}
|
||||
64
vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithFlashData.php
vendored
Normal file
64
vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithFlashData.php
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Http\Concerns;
|
||||
|
||||
trait InteractsWithFlashData
|
||||
{
|
||||
/**
|
||||
* Retrieve an old input item.
|
||||
*
|
||||
* @param string $key
|
||||
* @param string|array|null $default
|
||||
* @return string|array
|
||||
*/
|
||||
public function old($key = null, $default = null)
|
||||
{
|
||||
return $this->session()->getOldInput($key, $default);
|
||||
}
|
||||
|
||||
/**
|
||||
* Flash the input for the current request to the session.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function flash()
|
||||
{
|
||||
$this->session()->flashInput($this->input());
|
||||
}
|
||||
|
||||
/**
|
||||
* Flash only some of the input to the session.
|
||||
*
|
||||
* @param array|mixed $keys
|
||||
* @return void
|
||||
*/
|
||||
public function flashOnly($keys)
|
||||
{
|
||||
$this->session()->flashInput(
|
||||
$this->only(is_array($keys) ? $keys : func_get_args())
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Flash only some of the input to the session.
|
||||
*
|
||||
* @param array|mixed $keys
|
||||
* @return void
|
||||
*/
|
||||
public function flashExcept($keys)
|
||||
{
|
||||
$this->session()->flashInput(
|
||||
$this->except(is_array($keys) ? $keys : func_get_args())
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Flush all of the old input from the session.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function flush()
|
||||
{
|
||||
$this->session()->flashInput([]);
|
||||
}
|
||||
}
|
||||
315
vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithInput.php
vendored
Normal file
315
vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithInput.php
vendored
Normal file
@@ -0,0 +1,315 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Http\Concerns;
|
||||
|
||||
use SplFileInfo;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Http\UploadedFile;
|
||||
|
||||
trait InteractsWithInput
|
||||
{
|
||||
/**
|
||||
* Retrieve a server variable from the request.
|
||||
*
|
||||
* @param string $key
|
||||
* @param string|array|null $default
|
||||
* @return string|array
|
||||
*/
|
||||
public function server($key = null, $default = null)
|
||||
{
|
||||
return $this->retrieveItem('server', $key, $default);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if a header is set on the request.
|
||||
*
|
||||
* @param string $key
|
||||
* @return bool
|
||||
*/
|
||||
public function hasHeader($key)
|
||||
{
|
||||
return ! is_null($this->header($key));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a header from the request.
|
||||
*
|
||||
* @param string $key
|
||||
* @param string|array|null $default
|
||||
* @return string|array
|
||||
*/
|
||||
public function header($key = null, $default = null)
|
||||
{
|
||||
return $this->retrieveItem('headers', $key, $default);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the bearer token from the request headers.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function bearerToken()
|
||||
{
|
||||
$header = $this->header('Authorization', '');
|
||||
|
||||
if (Str::startsWith($header, 'Bearer ')) {
|
||||
return Str::substr($header, 7);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the request contains a given input item key.
|
||||
*
|
||||
* @param string|array $key
|
||||
* @return bool
|
||||
*/
|
||||
public function exists($key)
|
||||
{
|
||||
$keys = is_array($key) ? $key : func_get_args();
|
||||
|
||||
$input = $this->all();
|
||||
|
||||
foreach ($keys as $value) {
|
||||
if (! Arr::has($input, $value)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the request contains a non-empty value for an input item.
|
||||
*
|
||||
* @param string|array $key
|
||||
* @return bool
|
||||
*/
|
||||
public function has($key)
|
||||
{
|
||||
$keys = is_array($key) ? $key : func_get_args();
|
||||
|
||||
foreach ($keys as $value) {
|
||||
if ($this->isEmptyString($value)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the given input key is an empty string for "has".
|
||||
*
|
||||
* @param string $key
|
||||
* @return bool
|
||||
*/
|
||||
protected function isEmptyString($key)
|
||||
{
|
||||
$value = $this->input($key);
|
||||
|
||||
return ! is_bool($value) && ! is_array($value) && trim((string) $value) === '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all of the input and files for the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function all()
|
||||
{
|
||||
return array_replace_recursive($this->input(), $this->allFiles());
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve an input item from the request.
|
||||
*
|
||||
* @param string $key
|
||||
* @param string|array|null $default
|
||||
* @return string|array
|
||||
*/
|
||||
public function input($key = null, $default = null)
|
||||
{
|
||||
return data_get(
|
||||
$this->getInputSource()->all() + $this->query->all(), $key, $default
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a subset containing the provided keys with values from the input data.
|
||||
*
|
||||
* @param array|mixed $keys
|
||||
* @return array
|
||||
*/
|
||||
public function only($keys)
|
||||
{
|
||||
$keys = is_array($keys) ? $keys : func_get_args();
|
||||
|
||||
$results = [];
|
||||
|
||||
$input = $this->all();
|
||||
|
||||
foreach ($keys as $key) {
|
||||
Arr::set($results, $key, data_get($input, $key));
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all of the input except for a specified array of items.
|
||||
*
|
||||
* @param array|mixed $keys
|
||||
* @return array
|
||||
*/
|
||||
public function except($keys)
|
||||
{
|
||||
$keys = is_array($keys) ? $keys : func_get_args();
|
||||
|
||||
$results = $this->all();
|
||||
|
||||
Arr::forget($results, $keys);
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
/**
|
||||
* Intersect an array of items with the input data.
|
||||
*
|
||||
* @param array|mixed $keys
|
||||
* @return array
|
||||
*/
|
||||
public function intersect($keys)
|
||||
{
|
||||
return array_filter($this->only(is_array($keys) ? $keys : func_get_args()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a query string item from the request.
|
||||
*
|
||||
* @param string $key
|
||||
* @param string|array|null $default
|
||||
* @return string|array
|
||||
*/
|
||||
public function query($key = null, $default = null)
|
||||
{
|
||||
return $this->retrieveItem('query', $key, $default);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if a cookie is set on the request.
|
||||
*
|
||||
* @param string $key
|
||||
* @return bool
|
||||
*/
|
||||
public function hasCookie($key)
|
||||
{
|
||||
return ! is_null($this->cookie($key));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a cookie from the request.
|
||||
*
|
||||
* @param string $key
|
||||
* @param string|array|null $default
|
||||
* @return string|array
|
||||
*/
|
||||
public function cookie($key = null, $default = null)
|
||||
{
|
||||
return $this->retrieveItem('cookies', $key, $default);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an array of all of the files on the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function allFiles()
|
||||
{
|
||||
$files = $this->files->all();
|
||||
|
||||
return $this->convertedFiles
|
||||
? $this->convertedFiles
|
||||
: $this->convertedFiles = $this->convertUploadedFiles($files);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given array of Symfony UploadedFiles to custom Laravel UploadedFiles.
|
||||
*
|
||||
* @param array $files
|
||||
* @return array
|
||||
*/
|
||||
protected function convertUploadedFiles(array $files)
|
||||
{
|
||||
return array_map(function ($file) {
|
||||
if (is_null($file) || (is_array($file) && empty(array_filter($file)))) {
|
||||
return $file;
|
||||
}
|
||||
|
||||
return is_array($file)
|
||||
? $this->convertUploadedFiles($file)
|
||||
: UploadedFile::createFromBase($file);
|
||||
}, $files);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the uploaded data contains a file.
|
||||
*
|
||||
* @param string $key
|
||||
* @return bool
|
||||
*/
|
||||
public function hasFile($key)
|
||||
{
|
||||
if (! is_array($files = $this->file($key))) {
|
||||
$files = [$files];
|
||||
}
|
||||
|
||||
foreach ($files as $file) {
|
||||
if ($this->isValidFile($file)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check that the given file is a valid file instance.
|
||||
*
|
||||
* @param mixed $file
|
||||
* @return bool
|
||||
*/
|
||||
protected function isValidFile($file)
|
||||
{
|
||||
return $file instanceof SplFileInfo && $file->getPath() != '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a file from the request.
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed $default
|
||||
* @return \Illuminate\Http\UploadedFile|array|null
|
||||
*/
|
||||
public function file($key = null, $default = null)
|
||||
{
|
||||
return data_get($this->allFiles(), $key, $default);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a parameter item from a given source.
|
||||
*
|
||||
* @param string $source
|
||||
* @param string $key
|
||||
* @param string|array|null $default
|
||||
* @return string|array
|
||||
*/
|
||||
protected function retrieveItem($source, $key, $default)
|
||||
{
|
||||
if (is_null($key)) {
|
||||
return $this->$source->all();
|
||||
}
|
||||
|
||||
return $this->$source->get($key, $default);
|
||||
}
|
||||
}
|
||||
37
vendor/laravel/framework/src/Illuminate/Http/Exceptions/HttpResponseException.php
vendored
Normal file
37
vendor/laravel/framework/src/Illuminate/Http/Exceptions/HttpResponseException.php
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Http\Exceptions;
|
||||
|
||||
use RuntimeException;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
class HttpResponseException extends RuntimeException
|
||||
{
|
||||
/**
|
||||
* The underlying response instance.
|
||||
*
|
||||
* @var \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
protected $response;
|
||||
|
||||
/**
|
||||
* Create a new HTTP response exception instance.
|
||||
*
|
||||
* @param \Symfony\Component\HttpFoundation\Response $response
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Response $response)
|
||||
{
|
||||
$this->response = $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the underlying response instance.
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function getResponse()
|
||||
{
|
||||
return $this->response;
|
||||
}
|
||||
}
|
||||
10
vendor/laravel/framework/src/Illuminate/Http/Exceptions/PostTooLargeException.php
vendored
Normal file
10
vendor/laravel/framework/src/Illuminate/Http/Exceptions/PostTooLargeException.php
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Http\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
||||
class PostTooLargeException extends Exception
|
||||
{
|
||||
//
|
||||
}
|
||||
10
vendor/laravel/framework/src/Illuminate/Http/File.php
vendored
Normal file
10
vendor/laravel/framework/src/Illuminate/Http/File.php
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Http;
|
||||
|
||||
use Symfony\Component\HttpFoundation\File\File as SymfonyFile;
|
||||
|
||||
class File extends SymfonyFile
|
||||
{
|
||||
use FileHelpers;
|
||||
}
|
||||
62
vendor/laravel/framework/src/Illuminate/Http/FileHelpers.php
vendored
Normal file
62
vendor/laravel/framework/src/Illuminate/Http/FileHelpers.php
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Http;
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
trait FileHelpers
|
||||
{
|
||||
/**
|
||||
* The cache copy of the file's hash name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $hashName = null;
|
||||
|
||||
/**
|
||||
* Get the fully qualified path to the file.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function path()
|
||||
{
|
||||
return $this->getRealPath();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the file's extension.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function extension()
|
||||
{
|
||||
return $this->guessExtension();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the file's extension supplied by the client.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function clientExtension()
|
||||
{
|
||||
return $this->guessClientExtension();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a filename for the file.
|
||||
*
|
||||
* @param string $path
|
||||
* @return string
|
||||
*/
|
||||
public function hashName($path = null)
|
||||
{
|
||||
if ($path) {
|
||||
$path = rtrim($path, '/').'/';
|
||||
}
|
||||
|
||||
$hash = $this->hashName ?: $this->hashName = Str::random(40);
|
||||
|
||||
return $path.$hash.'.'.$this->guessExtension();
|
||||
}
|
||||
}
|
||||
110
vendor/laravel/framework/src/Illuminate/Http/JsonResponse.php
vendored
Executable file
110
vendor/laravel/framework/src/Illuminate/Http/JsonResponse.php
vendored
Executable file
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Http;
|
||||
|
||||
use JsonSerializable;
|
||||
use InvalidArgumentException;
|
||||
use Illuminate\Contracts\Support\Jsonable;
|
||||
use Illuminate\Contracts\Support\Arrayable;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse as BaseJsonResponse;
|
||||
|
||||
class JsonResponse extends BaseJsonResponse
|
||||
{
|
||||
use ResponseTrait;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param mixed $data
|
||||
* @param int $status
|
||||
* @param array $headers
|
||||
* @param int $options
|
||||
*/
|
||||
public function __construct($data = null, $status = 200, $headers = [], $options = 0)
|
||||
{
|
||||
$this->encodingOptions = $options;
|
||||
|
||||
parent::__construct($data, $status, $headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the JSONP callback.
|
||||
*
|
||||
* @param string|null $callback
|
||||
* @return $this
|
||||
*/
|
||||
public function withCallback($callback = null)
|
||||
{
|
||||
return $this->setCallback($callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the json_decoded data from the response.
|
||||
*
|
||||
* @param bool $assoc
|
||||
* @param int $depth
|
||||
* @return mixed
|
||||
*/
|
||||
public function getData($assoc = false, $depth = 512)
|
||||
{
|
||||
return json_decode($this->data, $assoc, $depth);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setData($data = [])
|
||||
{
|
||||
$this->original = $data;
|
||||
|
||||
if ($data instanceof Arrayable) {
|
||||
$this->data = json_encode($data->toArray(), $this->encodingOptions);
|
||||
} elseif ($data instanceof Jsonable) {
|
||||
$this->data = $data->toJson($this->encodingOptions);
|
||||
} elseif ($data instanceof JsonSerializable) {
|
||||
$this->data = json_encode($data->jsonSerialize(), $this->encodingOptions);
|
||||
} else {
|
||||
$this->data = json_encode($data, $this->encodingOptions);
|
||||
}
|
||||
|
||||
if (! $this->hasValidJson(json_last_error())) {
|
||||
throw new InvalidArgumentException(json_last_error_msg());
|
||||
}
|
||||
|
||||
return $this->update();
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if an error occurred during JSON encoding.
|
||||
*
|
||||
* @param int $jsonError
|
||||
* @return bool
|
||||
*/
|
||||
protected function hasValidJson($jsonError)
|
||||
{
|
||||
return $jsonError === JSON_ERROR_NONE ||
|
||||
($jsonError === JSON_ERROR_UNSUPPORTED_TYPE &&
|
||||
$this->hasEncodingOption(JSON_PARTIAL_OUTPUT_ON_ERROR));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setEncodingOptions($options)
|
||||
{
|
||||
$this->encodingOptions = (int) $options;
|
||||
|
||||
return $this->setData($this->getData());
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if a JSON encoding option is set.
|
||||
*
|
||||
* @param int $option
|
||||
* @return bool
|
||||
*/
|
||||
public function hasEncodingOption($option)
|
||||
{
|
||||
return (bool) ($this->encodingOptions & $option);
|
||||
}
|
||||
}
|
||||
27
vendor/laravel/framework/src/Illuminate/Http/Middleware/CheckResponseForModifications.php
vendored
Normal file
27
vendor/laravel/framework/src/Illuminate/Http/Middleware/CheckResponseForModifications.php
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
class CheckResponseForModifications
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
$response = $next($request);
|
||||
|
||||
if ($response instanceof Response) {
|
||||
$response->isNotModified($request);
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
24
vendor/laravel/framework/src/Illuminate/Http/Middleware/FrameGuard.php
vendored
Normal file
24
vendor/laravel/framework/src/Illuminate/Http/Middleware/FrameGuard.php
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
|
||||
class FrameGuard
|
||||
{
|
||||
/**
|
||||
* Handle the given request and get the response.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
$response = $next($request);
|
||||
|
||||
$response->headers->set('X-Frame-Options', 'SAMEORIGIN', false);
|
||||
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
238
vendor/laravel/framework/src/Illuminate/Http/RedirectResponse.php
vendored
Executable file
238
vendor/laravel/framework/src/Illuminate/Http/RedirectResponse.php
vendored
Executable file
@@ -0,0 +1,238 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Http;
|
||||
|
||||
use BadMethodCallException;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\MessageBag;
|
||||
use Illuminate\Support\ViewErrorBag;
|
||||
use Illuminate\Support\Traits\Macroable;
|
||||
use Illuminate\Session\Store as SessionStore;
|
||||
use Illuminate\Contracts\Support\MessageProvider;
|
||||
use Symfony\Component\HttpFoundation\File\UploadedFile as SymfonyUploadedFile;
|
||||
use Symfony\Component\HttpFoundation\RedirectResponse as BaseRedirectResponse;
|
||||
|
||||
class RedirectResponse extends BaseRedirectResponse
|
||||
{
|
||||
use ResponseTrait, Macroable {
|
||||
Macroable::__call as macroCall;
|
||||
}
|
||||
|
||||
/**
|
||||
* The request instance.
|
||||
*
|
||||
* @var \Illuminate\Http\Request
|
||||
*/
|
||||
protected $request;
|
||||
|
||||
/**
|
||||
* The session store implementation.
|
||||
*
|
||||
* @var \Illuminate\Session\Store
|
||||
*/
|
||||
protected $session;
|
||||
|
||||
/**
|
||||
* Flash a piece of data to the session.
|
||||
*
|
||||
* @param string|array $key
|
||||
* @param mixed $value
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function with($key, $value = null)
|
||||
{
|
||||
$key = is_array($key) ? $key : [$key => $value];
|
||||
|
||||
foreach ($key as $k => $v) {
|
||||
$this->session->flash($k, $v);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add multiple cookies to the response.
|
||||
*
|
||||
* @param array $cookies
|
||||
* @return $this
|
||||
*/
|
||||
public function withCookies(array $cookies)
|
||||
{
|
||||
foreach ($cookies as $cookie) {
|
||||
$this->headers->setCookie($cookie);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Flash an array of input to the session.
|
||||
*
|
||||
* @param array $input
|
||||
* @return $this
|
||||
*/
|
||||
public function withInput(array $input = null)
|
||||
{
|
||||
$this->session->flashInput($this->removeFilesFromInput(
|
||||
! is_null($input) ? $input : $this->request->input()
|
||||
));
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove all uploaded files form the given input array.
|
||||
*
|
||||
* @param array $input
|
||||
* @return array
|
||||
*/
|
||||
protected function removeFilesFromInput(array $input)
|
||||
{
|
||||
foreach ($input as $key => $value) {
|
||||
if (is_array($value)) {
|
||||
$input[$key] = $this->removeFilesFromInput($value);
|
||||
}
|
||||
|
||||
if ($value instanceof SymfonyUploadedFile) {
|
||||
unset($input[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
return $input;
|
||||
}
|
||||
|
||||
/**
|
||||
* Flash an array of input to the session.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function onlyInput()
|
||||
{
|
||||
return $this->withInput($this->request->only(func_get_args()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Flash an array of input to the session.
|
||||
*
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function exceptInput()
|
||||
{
|
||||
return $this->withInput($this->request->except(func_get_args()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Flash a container of errors to the session.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Support\MessageProvider|array|string $provider
|
||||
* @param string $key
|
||||
* @return $this
|
||||
*/
|
||||
public function withErrors($provider, $key = 'default')
|
||||
{
|
||||
$value = $this->parseErrors($provider);
|
||||
|
||||
$errors = $this->session->get('errors', new ViewErrorBag);
|
||||
|
||||
if (! $errors instanceof ViewErrorBag) {
|
||||
$errors = new ViewErrorBag;
|
||||
}
|
||||
|
||||
$this->session->flash(
|
||||
'errors', $errors->put($key, $value)
|
||||
);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse the given errors into an appropriate value.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Support\MessageProvider|array|string $provider
|
||||
* @return \Illuminate\Support\MessageBag
|
||||
*/
|
||||
protected function parseErrors($provider)
|
||||
{
|
||||
if ($provider instanceof MessageProvider) {
|
||||
return $provider->getMessageBag();
|
||||
}
|
||||
|
||||
return new MessageBag((array) $provider);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the original response content.
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
public function getOriginalContent()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the request instance.
|
||||
*
|
||||
* @return \Illuminate\Http\Request|null
|
||||
*/
|
||||
public function getRequest()
|
||||
{
|
||||
return $this->request;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the request instance.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return void
|
||||
*/
|
||||
public function setRequest(Request $request)
|
||||
{
|
||||
$this->request = $request;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the session store implementation.
|
||||
*
|
||||
* @return \Illuminate\Session\Store|null
|
||||
*/
|
||||
public function getSession()
|
||||
{
|
||||
return $this->session;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the session store implementation.
|
||||
*
|
||||
* @param \Illuminate\Session\Store $session
|
||||
* @return void
|
||||
*/
|
||||
public function setSession(SessionStore $session)
|
||||
{
|
||||
$this->session = $session;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dynamically bind flash data in the session.
|
||||
*
|
||||
* @param string $method
|
||||
* @param array $parameters
|
||||
* @return $this
|
||||
*
|
||||
* @throws \BadMethodCallException
|
||||
*/
|
||||
public function __call($method, $parameters)
|
||||
{
|
||||
if (static::hasMacro($method)) {
|
||||
return $this->macroCall($method, $parameters);
|
||||
}
|
||||
|
||||
if (Str::startsWith($method, 'with')) {
|
||||
return $this->with(Str::snake(substr($method, 4)), $parameters[0]);
|
||||
}
|
||||
|
||||
throw new BadMethodCallException(
|
||||
"Method [$method] does not exist on Redirect."
|
||||
);
|
||||
}
|
||||
}
|
||||
606
vendor/laravel/framework/src/Illuminate/Http/Request.php
vendored
Normal file
606
vendor/laravel/framework/src/Illuminate/Http/Request.php
vendored
Normal file
@@ -0,0 +1,606 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Http;
|
||||
|
||||
use Closure;
|
||||
use ArrayAccess;
|
||||
use RuntimeException;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Traits\Macroable;
|
||||
use Illuminate\Contracts\Support\Arrayable;
|
||||
use Symfony\Component\HttpFoundation\ParameterBag;
|
||||
use Symfony\Component\HttpFoundation\Request as SymfonyRequest;
|
||||
|
||||
class Request extends SymfonyRequest implements Arrayable, ArrayAccess
|
||||
{
|
||||
use Concerns\InteractsWithContentTypes,
|
||||
Concerns\InteractsWithFlashData,
|
||||
Concerns\InteractsWithInput,
|
||||
Macroable;
|
||||
|
||||
/**
|
||||
* The decoded JSON content for the request.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $json;
|
||||
|
||||
/**
|
||||
* All of the converted files for the request.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $convertedFiles;
|
||||
|
||||
/**
|
||||
* The user resolver callback.
|
||||
*
|
||||
* @var \Closure
|
||||
*/
|
||||
protected $userResolver;
|
||||
|
||||
/**
|
||||
* The route resolver callback.
|
||||
*
|
||||
* @var \Closure
|
||||
*/
|
||||
protected $routeResolver;
|
||||
|
||||
/**
|
||||
* Create a new Illuminate HTTP request from server variables.
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public static function capture()
|
||||
{
|
||||
static::enableHttpMethodParameterOverride();
|
||||
|
||||
return static::createFromBase(SymfonyRequest::createFromGlobals());
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the Request instance.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function instance()
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the request method.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function method()
|
||||
{
|
||||
return $this->getMethod();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the root URL for the application.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function root()
|
||||
{
|
||||
return rtrim($this->getSchemeAndHttpHost().$this->getBaseUrl(), '/');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the URL (no query string) for the request.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function url()
|
||||
{
|
||||
return rtrim(preg_replace('/\?.*/', '', $this->getUri()), '/');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the full URL for the request.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function fullUrl()
|
||||
{
|
||||
$query = $this->getQueryString();
|
||||
|
||||
$question = $this->getBaseUrl().$this->getPathInfo() == '/' ? '/?' : '?';
|
||||
|
||||
return $query ? $this->url().$question.$query : $this->url();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the full URL for the request with the added query string parameters.
|
||||
*
|
||||
* @param array $query
|
||||
* @return string
|
||||
*/
|
||||
public function fullUrlWithQuery(array $query)
|
||||
{
|
||||
$question = $this->getBaseUrl().$this->getPathInfo() == '/' ? '/?' : '?';
|
||||
|
||||
return count($this->query()) > 0
|
||||
? $this->url().$question.http_build_query(array_merge($this->query(), $query))
|
||||
: $this->fullUrl().$question.http_build_query($query);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current path info for the request.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function path()
|
||||
{
|
||||
$pattern = trim($this->getPathInfo(), '/');
|
||||
|
||||
return $pattern == '' ? '/' : $pattern;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current encoded path info for the request.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function decodedPath()
|
||||
{
|
||||
return rawurldecode($this->path());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a segment from the URI (1 based index).
|
||||
*
|
||||
* @param int $index
|
||||
* @param string|null $default
|
||||
* @return string|null
|
||||
*/
|
||||
public function segment($index, $default = null)
|
||||
{
|
||||
return Arr::get($this->segments(), $index - 1, $default);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all of the segments for the request path.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function segments()
|
||||
{
|
||||
$segments = explode('/', $this->decodedPath());
|
||||
|
||||
return array_values(array_filter($segments, function ($v) {
|
||||
return $v != '';
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the current request URI matches a pattern.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function is()
|
||||
{
|
||||
foreach (func_get_args() as $pattern) {
|
||||
if (Str::is($pattern, $this->decodedPath())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the route name matches the given string.
|
||||
*
|
||||
* @param string $name
|
||||
* @return bool
|
||||
*/
|
||||
public function routeIs($name)
|
||||
{
|
||||
return $this->route() && $this->route()->named($name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the current request URL and query string matches a pattern.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function fullUrlIs()
|
||||
{
|
||||
$url = $this->fullUrl();
|
||||
|
||||
foreach (func_get_args() as $pattern) {
|
||||
if (Str::is($pattern, $url)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the request is the result of an AJAX call.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function ajax()
|
||||
{
|
||||
return $this->isXmlHttpRequest();
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the request is the result of an PJAX call.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function pjax()
|
||||
{
|
||||
return $this->headers->get('X-PJAX') == true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the request is over HTTPS.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function secure()
|
||||
{
|
||||
return $this->isSecure();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the client IP address.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function ip()
|
||||
{
|
||||
return $this->getClientIp();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the client IP addresses.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function ips()
|
||||
{
|
||||
return $this->getClientIps();
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge new input into the current request's input array.
|
||||
*
|
||||
* @param array $input
|
||||
* @return void
|
||||
*/
|
||||
public function merge(array $input)
|
||||
{
|
||||
$this->getInputSource()->add($input);
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace the input for the current request.
|
||||
*
|
||||
* @param array $input
|
||||
* @return void
|
||||
*/
|
||||
public function replace(array $input)
|
||||
{
|
||||
$this->getInputSource()->replace($input);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the JSON payload for the request.
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed $default
|
||||
* @return mixed
|
||||
*/
|
||||
public function json($key = null, $default = null)
|
||||
{
|
||||
if (! isset($this->json)) {
|
||||
$this->json = new ParameterBag((array) json_decode($this->getContent(), true));
|
||||
}
|
||||
|
||||
if (is_null($key)) {
|
||||
return $this->json;
|
||||
}
|
||||
|
||||
return data_get($this->json->all(), $key, $default);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the input source for the request.
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\ParameterBag
|
||||
*/
|
||||
protected function getInputSource()
|
||||
{
|
||||
if ($this->isJson()) {
|
||||
return $this->json();
|
||||
}
|
||||
|
||||
return $this->getRealMethod() == 'GET' ? $this->query : $this->request;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an Illuminate request from a Symfony instance.
|
||||
*
|
||||
* @param \Symfony\Component\HttpFoundation\Request $request
|
||||
* @return \Illuminate\Http\Request
|
||||
*/
|
||||
public static function createFromBase(SymfonyRequest $request)
|
||||
{
|
||||
if ($request instanceof static) {
|
||||
return $request;
|
||||
}
|
||||
|
||||
$content = $request->content;
|
||||
|
||||
$request = (new static)->duplicate(
|
||||
$request->query->all(), $request->request->all(), $request->attributes->all(),
|
||||
$request->cookies->all(), $request->files->all(), $request->server->all()
|
||||
);
|
||||
|
||||
$request->content = $content;
|
||||
|
||||
$request->request = $request->getInputSource();
|
||||
|
||||
return $request;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function duplicate(array $query = null, array $request = null, array $attributes = null, array $cookies = null, array $files = null, array $server = null)
|
||||
{
|
||||
return parent::duplicate($query, $request, $attributes, $cookies, $this->filterFiles($files), $server);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the given array of files, removing any empty values.
|
||||
*
|
||||
* @param mixed $files
|
||||
* @return mixed
|
||||
*/
|
||||
protected function filterFiles($files)
|
||||
{
|
||||
if (! $files) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($files as $key => $file) {
|
||||
if (is_array($file)) {
|
||||
$files[$key] = $this->filterFiles($files[$key]);
|
||||
}
|
||||
|
||||
if (empty($files[$key])) {
|
||||
unset($files[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
return $files;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the session associated with the request.
|
||||
*
|
||||
* @return \Illuminate\Session\Store
|
||||
*
|
||||
* @throws \RuntimeException
|
||||
*/
|
||||
public function session()
|
||||
{
|
||||
if (! $this->hasSession()) {
|
||||
throw new RuntimeException('Session store not set on request.');
|
||||
}
|
||||
|
||||
return $this->getSession();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the session instance on the request.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Session\Session $session
|
||||
* @return void
|
||||
*/
|
||||
public function setLaravelSession($session)
|
||||
{
|
||||
$this->session = $session;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the user making the request.
|
||||
*
|
||||
* @param string|null $guard
|
||||
* @return mixed
|
||||
*/
|
||||
public function user($guard = null)
|
||||
{
|
||||
return call_user_func($this->getUserResolver(), $guard);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the route handling the request.
|
||||
*
|
||||
* @param string|null $param
|
||||
*
|
||||
* @return \Illuminate\Routing\Route|object|string
|
||||
*/
|
||||
public function route($param = null)
|
||||
{
|
||||
$route = call_user_func($this->getRouteResolver());
|
||||
|
||||
if (is_null($route) || is_null($param)) {
|
||||
return $route;
|
||||
}
|
||||
|
||||
return $route->parameter($param);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a unique fingerprint for the request / route / IP address.
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @throws \RuntimeException
|
||||
*/
|
||||
public function fingerprint()
|
||||
{
|
||||
if (! $route = $this->route()) {
|
||||
throw new RuntimeException('Unable to generate fingerprint. Route unavailable.');
|
||||
}
|
||||
|
||||
return sha1(implode('|', array_merge(
|
||||
$route->methods(), [$route->domain(), $route->uri(), $this->ip()]
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the JSON payload for the request.
|
||||
*
|
||||
* @param array $json
|
||||
* @return $this
|
||||
*/
|
||||
public function setJson($json)
|
||||
{
|
||||
$this->json = $json;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the user resolver callback.
|
||||
*
|
||||
* @return \Closure
|
||||
*/
|
||||
public function getUserResolver()
|
||||
{
|
||||
return $this->userResolver ?: function () {
|
||||
//
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the user resolver callback.
|
||||
*
|
||||
* @param \Closure $callback
|
||||
* @return $this
|
||||
*/
|
||||
public function setUserResolver(Closure $callback)
|
||||
{
|
||||
$this->userResolver = $callback;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the route resolver callback.
|
||||
*
|
||||
* @return \Closure
|
||||
*/
|
||||
public function getRouteResolver()
|
||||
{
|
||||
return $this->routeResolver ?: function () {
|
||||
//
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the route resolver callback.
|
||||
*
|
||||
* @param \Closure $callback
|
||||
* @return $this
|
||||
*/
|
||||
public function setRouteResolver(Closure $callback)
|
||||
{
|
||||
$this->routeResolver = $callback;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all of the input and files for the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function toArray()
|
||||
{
|
||||
return $this->all();
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the given offset exists.
|
||||
*
|
||||
* @param string $offset
|
||||
* @return bool
|
||||
*/
|
||||
public function offsetExists($offset)
|
||||
{
|
||||
return array_key_exists($offset, $this->all());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the value at the given offset.
|
||||
*
|
||||
* @param string $offset
|
||||
* @return mixed
|
||||
*/
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return data_get($this->all(), $offset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value at the given offset.
|
||||
*
|
||||
* @param string $offset
|
||||
* @param mixed $value
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value)
|
||||
{
|
||||
$this->getInputSource()->set($offset, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the value at the given offset.
|
||||
*
|
||||
* @param string $offset
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset)
|
||||
{
|
||||
$this->getInputSource()->remove($offset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if an input element is set on the request.
|
||||
*
|
||||
* @param string $key
|
||||
* @return bool
|
||||
*/
|
||||
public function __isset($key)
|
||||
{
|
||||
return ! is_null($this->__get($key));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an input element from the request.
|
||||
*
|
||||
* @param string $key
|
||||
* @return mixed
|
||||
*/
|
||||
public function __get($key)
|
||||
{
|
||||
if ($this->offsetExists($key)) {
|
||||
return $this->offsetGet($key);
|
||||
}
|
||||
|
||||
return $this->route($key);
|
||||
}
|
||||
}
|
||||
72
vendor/laravel/framework/src/Illuminate/Http/Response.php
vendored
Executable file
72
vendor/laravel/framework/src/Illuminate/Http/Response.php
vendored
Executable file
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Http;
|
||||
|
||||
use ArrayObject;
|
||||
use JsonSerializable;
|
||||
use Illuminate\Contracts\Support\Jsonable;
|
||||
use Illuminate\Contracts\Support\Renderable;
|
||||
use Symfony\Component\HttpFoundation\Response as BaseResponse;
|
||||
|
||||
class Response extends BaseResponse
|
||||
{
|
||||
use ResponseTrait;
|
||||
|
||||
/**
|
||||
* Set the content on the response.
|
||||
*
|
||||
* @param mixed $content
|
||||
* @return $this
|
||||
*/
|
||||
public function setContent($content)
|
||||
{
|
||||
$this->original = $content;
|
||||
|
||||
// If the content is "JSONable" we will set the appropriate header and convert
|
||||
// the content to JSON. This is useful when returning something like models
|
||||
// from routes that will be automatically transformed to their JSON form.
|
||||
if ($this->shouldBeJson($content)) {
|
||||
$this->header('Content-Type', 'application/json');
|
||||
|
||||
$content = $this->morphToJson($content);
|
||||
}
|
||||
|
||||
// If this content implements the "Renderable" interface then we will call the
|
||||
// render method on the object so we will avoid any "__toString" exceptions
|
||||
// that might be thrown and have their errors obscured by PHP's handling.
|
||||
elseif ($content instanceof Renderable) {
|
||||
$content = $content->render();
|
||||
}
|
||||
|
||||
return parent::setContent($content);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the given content should be turned into JSON.
|
||||
*
|
||||
* @param mixed $content
|
||||
* @return bool
|
||||
*/
|
||||
protected function shouldBeJson($content)
|
||||
{
|
||||
return $content instanceof Jsonable ||
|
||||
$content instanceof ArrayObject ||
|
||||
$content instanceof JsonSerializable ||
|
||||
is_array($content);
|
||||
}
|
||||
|
||||
/**
|
||||
* Morph the given content into JSON.
|
||||
*
|
||||
* @param mixed $content
|
||||
* @return string
|
||||
*/
|
||||
protected function morphToJson($content)
|
||||
{
|
||||
if ($content instanceof Jsonable) {
|
||||
return $content->toJson();
|
||||
}
|
||||
|
||||
return json_encode($content);
|
||||
}
|
||||
}
|
||||
134
vendor/laravel/framework/src/Illuminate/Http/ResponseTrait.php
vendored
Normal file
134
vendor/laravel/framework/src/Illuminate/Http/ResponseTrait.php
vendored
Normal file
@@ -0,0 +1,134 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Http;
|
||||
|
||||
use Exception;
|
||||
use Illuminate\Http\Exceptions\HttpResponseException;
|
||||
|
||||
trait ResponseTrait
|
||||
{
|
||||
/**
|
||||
* The original content of the response.
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
public $original;
|
||||
|
||||
/**
|
||||
* The exception that triggered the error response (if applicable).
|
||||
*
|
||||
* @var \Exception|null
|
||||
*/
|
||||
public $exception;
|
||||
|
||||
/**
|
||||
* Get the status code for the response.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function status()
|
||||
{
|
||||
return $this->getStatusCode();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the content of the response.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function content()
|
||||
{
|
||||
return $this->getContent();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the original response content.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getOriginalContent()
|
||||
{
|
||||
return $this->original;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a header on the Response.
|
||||
*
|
||||
* @param string $key
|
||||
* @param array|string $values
|
||||
* @param bool $replace
|
||||
* @return $this
|
||||
*/
|
||||
public function header($key, $values, $replace = true)
|
||||
{
|
||||
$this->headers->set($key, $values, $replace);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an array of headers to the response.
|
||||
*
|
||||
* @param array $headers
|
||||
* @return $this
|
||||
*/
|
||||
public function withHeaders(array $headers)
|
||||
{
|
||||
foreach ($headers as $key => $value) {
|
||||
$this->headers->set($key, $value);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a cookie to the response.
|
||||
*
|
||||
* @param \Symfony\Component\HttpFoundation\Cookie|mixed $cookie
|
||||
* @return $this
|
||||
*/
|
||||
public function cookie($cookie)
|
||||
{
|
||||
return call_user_func_array([$this, 'withCookie'], func_get_args());
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a cookie to the response.
|
||||
*
|
||||
* @param \Symfony\Component\HttpFoundation\Cookie|mixed $cookie
|
||||
* @return $this
|
||||
*/
|
||||
public function withCookie($cookie)
|
||||
{
|
||||
if (is_string($cookie) && function_exists('cookie')) {
|
||||
$cookie = call_user_func_array('cookie', func_get_args());
|
||||
}
|
||||
|
||||
$this->headers->setCookie($cookie);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the exception to attach to the response.
|
||||
*
|
||||
* @param \Exception $e
|
||||
* @return $this
|
||||
*/
|
||||
public function withException(Exception $e)
|
||||
{
|
||||
$this->exception = $e;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Throws the response in a HttpResponseException instance.
|
||||
*
|
||||
* @throws \Illuminate\Http\Exceptions\HttpResponseException
|
||||
*/
|
||||
public function throwResponse()
|
||||
{
|
||||
throw new HttpResponseException($this);
|
||||
}
|
||||
}
|
||||
115
vendor/laravel/framework/src/Illuminate/Http/Testing/File.php
vendored
Normal file
115
vendor/laravel/framework/src/Illuminate/Http/Testing/File.php
vendored
Normal file
@@ -0,0 +1,115 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Http\Testing;
|
||||
|
||||
use Illuminate\Http\UploadedFile;
|
||||
|
||||
class File extends UploadedFile
|
||||
{
|
||||
/**
|
||||
* The name of the file.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $name;
|
||||
|
||||
/**
|
||||
* The temporary file resource.
|
||||
*
|
||||
* @var resource
|
||||
*/
|
||||
public $tempFile;
|
||||
|
||||
/**
|
||||
* The "size" to report.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $sizeToReport;
|
||||
|
||||
/**
|
||||
* Create a new file instance.
|
||||
*
|
||||
* @param string $name
|
||||
* @param resource $tempFile
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($name, $tempFile)
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->tempFile = $tempFile;
|
||||
|
||||
parent::__construct(
|
||||
$this->tempFilePath(), $name, $this->getMimeType(),
|
||||
filesize($this->tempFilePath()), $error = null, $test = true
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new fake file.
|
||||
*
|
||||
* @param string $name
|
||||
* @param int $kilobytes
|
||||
* @return \Illuminate\Http\Testing\File
|
||||
*/
|
||||
public static function create($name, $kilobytes = 0)
|
||||
{
|
||||
return (new FileFactory)->create($name, $kilobytes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new fake image.
|
||||
*
|
||||
* @param string $name
|
||||
* @param int $width
|
||||
* @param int $height
|
||||
* @return \Illuminate\Http\Testing\File
|
||||
*/
|
||||
public static function image($name, $width = 10, $height = 10)
|
||||
{
|
||||
return (new FileFactory)->image($name, $width, $height);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the "size" of the file in kilobytes.
|
||||
*
|
||||
* @param int $kilobytes
|
||||
* @return $this
|
||||
*/
|
||||
public function size($kilobytes)
|
||||
{
|
||||
$this->sizeToReport = $kilobytes * 1024;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the size of the file.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getSize()
|
||||
{
|
||||
return $this->sizeToReport ?: parent::getSize();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the MIME type for the file.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMimeType()
|
||||
{
|
||||
return MimeType::from($this->name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the path to the temporary file.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function tempFilePath()
|
||||
{
|
||||
return stream_get_meta_data($this->tempFile)['uri'];
|
||||
}
|
||||
}
|
||||
51
vendor/laravel/framework/src/Illuminate/Http/Testing/FileFactory.php
vendored
Normal file
51
vendor/laravel/framework/src/Illuminate/Http/Testing/FileFactory.php
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Http\Testing;
|
||||
|
||||
class FileFactory
|
||||
{
|
||||
/**
|
||||
* Create a new fake file.
|
||||
*
|
||||
* @param string $name
|
||||
* @param int $kilobytes
|
||||
* @return \Illuminate\Http\Testing\File
|
||||
*/
|
||||
public function create($name, $kilobytes = 0)
|
||||
{
|
||||
return tap(new File($name, tmpfile()), function ($file) use ($kilobytes) {
|
||||
$file->sizeToReport = $kilobytes * 1024;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new fake image.
|
||||
*
|
||||
* @param string $name
|
||||
* @param int $width
|
||||
* @param int $height
|
||||
* @return \Illuminate\Http\Testing\File
|
||||
*/
|
||||
public function image($name, $width = 10, $height = 10)
|
||||
{
|
||||
return new File($name, $this->generateImage($width, $height));
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a dummy image of the given width and height.
|
||||
*
|
||||
* @param int $width
|
||||
* @param int $height
|
||||
* @return resource
|
||||
*/
|
||||
protected function generateImage($width, $height)
|
||||
{
|
||||
return tap(tmpfile(), function ($temp) use ($width, $height) {
|
||||
ob_start();
|
||||
|
||||
imagepng(imagecreatetruecolor($width, $height));
|
||||
|
||||
fwrite($temp, ob_get_clean());
|
||||
});
|
||||
}
|
||||
}
|
||||
792
vendor/laravel/framework/src/Illuminate/Http/Testing/MimeType.php
vendored
Normal file
792
vendor/laravel/framework/src/Illuminate/Http/Testing/MimeType.php
vendored
Normal file
@@ -0,0 +1,792 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Http\Testing;
|
||||
|
||||
class MimeType
|
||||
{
|
||||
/**
|
||||
* An array of extension to MIME types.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected static $mimes = [
|
||||
'ez' => 'application/andrew-inset',
|
||||
'aw' => 'application/applixware',
|
||||
'atom' => 'application/atom+xml',
|
||||
'atomcat' => 'application/atomcat+xml',
|
||||
'atomsvc' => 'application/atomsvc+xml',
|
||||
'ccxml' => 'application/ccxml+xml',
|
||||
'cdmia' => 'application/cdmi-capability',
|
||||
'cdmic' => 'application/cdmi-container',
|
||||
'cdmid' => 'application/cdmi-domain',
|
||||
'cdmio' => 'application/cdmi-object',
|
||||
'cdmiq' => 'application/cdmi-queue',
|
||||
'cu' => 'application/cu-seeme',
|
||||
'davmount' => 'application/davmount+xml',
|
||||
'dbk' => 'application/docbook+xml',
|
||||
'dssc' => 'application/dssc+der',
|
||||
'xdssc' => 'application/dssc+xml',
|
||||
'ecma' => 'application/ecmascript',
|
||||
'emma' => 'application/emma+xml',
|
||||
'epub' => 'application/epub+zip',
|
||||
'exi' => 'application/exi',
|
||||
'pfr' => 'application/font-tdpfr',
|
||||
'gml' => 'application/gml+xml',
|
||||
'gpx' => 'application/gpx+xml',
|
||||
'gxf' => 'application/gxf',
|
||||
'stk' => 'application/hyperstudio',
|
||||
'ink' => 'application/inkml+xml',
|
||||
'ipfix' => 'application/ipfix',
|
||||
'jar' => 'application/java-archive',
|
||||
'ser' => 'application/java-serialized-object',
|
||||
'class' => 'application/java-vm',
|
||||
'js' => 'application/javascript',
|
||||
'json' => 'application/json',
|
||||
'jsonml' => 'application/jsonml+json',
|
||||
'lostxml' => 'application/lost+xml',
|
||||
'hqx' => 'application/mac-binhex40',
|
||||
'cpt' => 'application/mac-compactpro',
|
||||
'mads' => 'application/mads+xml',
|
||||
'mrc' => 'application/marc',
|
||||
'mrcx' => 'application/marcxml+xml',
|
||||
'ma' => 'application/mathematica',
|
||||
'mathml' => 'application/mathml+xml',
|
||||
'mbox' => 'application/mbox',
|
||||
'mscml' => 'application/mediaservercontrol+xml',
|
||||
'metalink' => 'application/metalink+xml',
|
||||
'meta4' => 'application/metalink4+xml',
|
||||
'mets' => 'application/mets+xml',
|
||||
'mods' => 'application/mods+xml',
|
||||
'm21' => 'application/mp21',
|
||||
'mp4s' => 'application/mp4',
|
||||
'doc' => 'application/msword',
|
||||
'mxf' => 'application/mxf',
|
||||
'bin' => 'application/octet-stream',
|
||||
'oda' => 'application/oda',
|
||||
'opf' => 'application/oebps-package+xml',
|
||||
'ogx' => 'application/ogg',
|
||||
'omdoc' => 'application/omdoc+xml',
|
||||
'onetoc' => 'application/onenote',
|
||||
'oxps' => 'application/oxps',
|
||||
'xer' => 'application/patch-ops-error+xml',
|
||||
'pdf' => 'application/pdf',
|
||||
'pgp' => 'application/pgp-encrypted',
|
||||
'asc' => 'application/pgp-signature',
|
||||
'prf' => 'application/pics-rules',
|
||||
'p10' => 'application/pkcs10',
|
||||
'p7m' => 'application/pkcs7-mime',
|
||||
'p7s' => 'application/pkcs7-signature',
|
||||
'p8' => 'application/pkcs8',
|
||||
'ac' => 'application/pkix-attr-cert',
|
||||
'cer' => 'application/pkix-cert',
|
||||
'crl' => 'application/pkix-crl',
|
||||
'pkipath' => 'application/pkix-pkipath',
|
||||
'pki' => 'application/pkixcmp',
|
||||
'pls' => 'application/pls+xml',
|
||||
'ai' => 'application/postscript',
|
||||
'cww' => 'application/prs.cww',
|
||||
'pskcxml' => 'application/pskc+xml',
|
||||
'rdf' => 'application/rdf+xml',
|
||||
'rif' => 'application/reginfo+xml',
|
||||
'rnc' => 'application/relax-ng-compact-syntax',
|
||||
'rl' => 'application/resource-lists+xml',
|
||||
'rld' => 'application/resource-lists-diff+xml',
|
||||
'rs' => 'application/rls-services+xml',
|
||||
'gbr' => 'application/rpki-ghostbusters',
|
||||
'mft' => 'application/rpki-manifest',
|
||||
'roa' => 'application/rpki-roa',
|
||||
'rsd' => 'application/rsd+xml',
|
||||
'rss' => 'application/rss+xml',
|
||||
'sbml' => 'application/sbml+xml',
|
||||
'scq' => 'application/scvp-cv-request',
|
||||
'scs' => 'application/scvp-cv-response',
|
||||
'spq' => 'application/scvp-vp-request',
|
||||
'spp' => 'application/scvp-vp-response',
|
||||
'sdp' => 'application/sdp',
|
||||
'setpay' => 'application/set-payment-initiation',
|
||||
'setreg' => 'application/set-registration-initiation',
|
||||
'shf' => 'application/shf+xml',
|
||||
'smi' => 'application/smil+xml',
|
||||
'rq' => 'application/sparql-query',
|
||||
'srx' => 'application/sparql-results+xml',
|
||||
'gram' => 'application/srgs',
|
||||
'grxml' => 'application/srgs+xml',
|
||||
'sru' => 'application/sru+xml',
|
||||
'ssdl' => 'application/ssdl+xml',
|
||||
'ssml' => 'application/ssml+xml',
|
||||
'tei' => 'application/tei+xml',
|
||||
'tfi' => 'application/thraud+xml',
|
||||
'tsd' => 'application/timestamped-data',
|
||||
'plb' => 'application/vnd.3gpp.pic-bw-large',
|
||||
'psb' => 'application/vnd.3gpp.pic-bw-small',
|
||||
'pvb' => 'application/vnd.3gpp.pic-bw-var',
|
||||
'tcap' => 'application/vnd.3gpp2.tcap',
|
||||
'pwn' => 'application/vnd.3m.post-it-notes',
|
||||
'aso' => 'application/vnd.accpac.simply.aso',
|
||||
'imp' => 'application/vnd.accpac.simply.imp',
|
||||
'acu' => 'application/vnd.acucobol',
|
||||
'atc' => 'application/vnd.acucorp',
|
||||
'air' => 'application/vnd.adobe.air-application-installer-package+zip',
|
||||
'fcdt' => 'application/vnd.adobe.formscentral.fcdt',
|
||||
'fxp' => 'application/vnd.adobe.fxp',
|
||||
'xdp' => 'application/vnd.adobe.xdp+xml',
|
||||
'xfdf' => 'application/vnd.adobe.xfdf',
|
||||
'ahead' => 'application/vnd.ahead.space',
|
||||
'azf' => 'application/vnd.airzip.filesecure.azf',
|
||||
'azs' => 'application/vnd.airzip.filesecure.azs',
|
||||
'azw' => 'application/vnd.amazon.ebook',
|
||||
'acc' => 'application/vnd.americandynamics.acc',
|
||||
'ami' => 'application/vnd.amiga.ami',
|
||||
'apk' => 'application/vnd.android.package-archive',
|
||||
'cii' => 'application/vnd.anser-web-certificate-issue-initiation',
|
||||
'fti' => 'application/vnd.anser-web-funds-transfer-initiation',
|
||||
'atx' => 'application/vnd.antix.game-component',
|
||||
'mpkg' => 'application/vnd.apple.installer+xml',
|
||||
'm3u8' => 'application/vnd.apple.mpegurl',
|
||||
'swi' => 'application/vnd.aristanetworks.swi',
|
||||
'iota' => 'application/vnd.astraea-software.iota',
|
||||
'aep' => 'application/vnd.audiograph',
|
||||
'mpm' => 'application/vnd.blueice.multipass',
|
||||
'bmi' => 'application/vnd.bmi',
|
||||
'rep' => 'application/vnd.businessobjects',
|
||||
'cdxml' => 'application/vnd.chemdraw+xml',
|
||||
'mmd' => 'application/vnd.chipnuts.karaoke-mmd',
|
||||
'cdy' => 'application/vnd.cinderella',
|
||||
'cla' => 'application/vnd.claymore',
|
||||
'rp9' => 'application/vnd.cloanto.rp9',
|
||||
'c4g' => 'application/vnd.clonk.c4group',
|
||||
'c11amc' => 'application/vnd.cluetrust.cartomobile-config',
|
||||
'c11amz' => 'application/vnd.cluetrust.cartomobile-config-pkg',
|
||||
'csp' => 'application/vnd.commonspace',
|
||||
'cdbcmsg' => 'application/vnd.contact.cmsg',
|
||||
'cmc' => 'application/vnd.cosmocaller',
|
||||
'clkx' => 'application/vnd.crick.clicker',
|
||||
'clkk' => 'application/vnd.crick.clicker.keyboard',
|
||||
'clkp' => 'application/vnd.crick.clicker.palette',
|
||||
'clkt' => 'application/vnd.crick.clicker.template',
|
||||
'clkw' => 'application/vnd.crick.clicker.wordbank',
|
||||
'wbs' => 'application/vnd.criticaltools.wbs+xml',
|
||||
'pml' => 'application/vnd.ctc-posml',
|
||||
'ppd' => 'application/vnd.cups-ppd',
|
||||
'car' => 'application/vnd.curl.car',
|
||||
'pcurl' => 'application/vnd.curl.pcurl',
|
||||
'dart' => 'application/vnd.dart',
|
||||
'rdz' => 'application/vnd.data-vision.rdz',
|
||||
'uvf' => 'application/vnd.dece.data',
|
||||
'uvt' => 'application/vnd.dece.ttml+xml',
|
||||
'uvx' => 'application/vnd.dece.unspecified',
|
||||
'uvz' => 'application/vnd.dece.zip',
|
||||
'fe_launch' => 'application/vnd.denovo.fcselayout-link',
|
||||
'dna' => 'application/vnd.dna',
|
||||
'mlp' => 'application/vnd.dolby.mlp',
|
||||
'dpg' => 'application/vnd.dpgraph',
|
||||
'dfac' => 'application/vnd.dreamfactory',
|
||||
'kpxx' => 'application/vnd.ds-keypoint',
|
||||
'ait' => 'application/vnd.dvb.ait',
|
||||
'svc' => 'application/vnd.dvb.service',
|
||||
'geo' => 'application/vnd.dynageo',
|
||||
'mag' => 'application/vnd.ecowin.chart',
|
||||
'nml' => 'application/vnd.enliven',
|
||||
'esf' => 'application/vnd.epson.esf',
|
||||
'msf' => 'application/vnd.epson.msf',
|
||||
'qam' => 'application/vnd.epson.quickanime',
|
||||
'slt' => 'application/vnd.epson.salt',
|
||||
'ssf' => 'application/vnd.epson.ssf',
|
||||
'es3' => 'application/vnd.eszigno3+xml',
|
||||
'ez2' => 'application/vnd.ezpix-album',
|
||||
'ez3' => 'application/vnd.ezpix-package',
|
||||
'fdf' => 'application/vnd.fdf',
|
||||
'mseed' => 'application/vnd.fdsn.mseed',
|
||||
'seed' => 'application/vnd.fdsn.seed',
|
||||
'gph' => 'application/vnd.flographit',
|
||||
'ftc' => 'application/vnd.fluxtime.clip',
|
||||
'fm' => 'application/vnd.framemaker',
|
||||
'fnc' => 'application/vnd.frogans.fnc',
|
||||
'ltf' => 'application/vnd.frogans.ltf',
|
||||
'fsc' => 'application/vnd.fsc.weblaunch',
|
||||
'oas' => 'application/vnd.fujitsu.oasys',
|
||||
'oa2' => 'application/vnd.fujitsu.oasys2',
|
||||
'oa3' => 'application/vnd.fujitsu.oasys3',
|
||||
'fg5' => 'application/vnd.fujitsu.oasysgp',
|
||||
'bh2' => 'application/vnd.fujitsu.oasysprs',
|
||||
'ddd' => 'application/vnd.fujixerox.ddd',
|
||||
'xdw' => 'application/vnd.fujixerox.docuworks',
|
||||
'xbd' => 'application/vnd.fujixerox.docuworks.binder',
|
||||
'fzs' => 'application/vnd.fuzzysheet',
|
||||
'txd' => 'application/vnd.genomatix.tuxedo',
|
||||
'ggb' => 'application/vnd.geogebra.file',
|
||||
'ggt' => 'application/vnd.geogebra.tool',
|
||||
'gex' => 'application/vnd.geometry-explorer',
|
||||
'gxt' => 'application/vnd.geonext',
|
||||
'g2w' => 'application/vnd.geoplan',
|
||||
'g3w' => 'application/vnd.geospace',
|
||||
'gmx' => 'application/vnd.gmx',
|
||||
'kml' => 'application/vnd.google-earth.kml+xml',
|
||||
'kmz' => 'application/vnd.google-earth.kmz',
|
||||
'gqf' => 'application/vnd.grafeq',
|
||||
'gac' => 'application/vnd.groove-account',
|
||||
'ghf' => 'application/vnd.groove-help',
|
||||
'gim' => 'application/vnd.groove-identity-message',
|
||||
'grv' => 'application/vnd.groove-injector',
|
||||
'gtm' => 'application/vnd.groove-tool-message',
|
||||
'tpl' => 'application/vnd.groove-tool-template',
|
||||
'vcg' => 'application/vnd.groove-vcard',
|
||||
'hal' => 'application/vnd.hal+xml',
|
||||
'zmm' => 'application/vnd.handheld-entertainment+xml',
|
||||
'hbci' => 'application/vnd.hbci',
|
||||
'les' => 'application/vnd.hhe.lesson-player',
|
||||
'hpgl' => 'application/vnd.hp-hpgl',
|
||||
'hpid' => 'application/vnd.hp-hpid',
|
||||
'hps' => 'application/vnd.hp-hps',
|
||||
'jlt' => 'application/vnd.hp-jlyt',
|
||||
'pcl' => 'application/vnd.hp-pcl',
|
||||
'pclxl' => 'application/vnd.hp-pclxl',
|
||||
'sfd-hdstx' => 'application/vnd.hydrostatix.sof-data',
|
||||
'mpy' => 'application/vnd.ibm.minipay',
|
||||
'afp' => 'application/vnd.ibm.modcap',
|
||||
'irm' => 'application/vnd.ibm.rights-management',
|
||||
'sc' => 'application/vnd.ibm.secure-container',
|
||||
'icc' => 'application/vnd.iccprofile',
|
||||
'igl' => 'application/vnd.igloader',
|
||||
'ivp' => 'application/vnd.immervision-ivp',
|
||||
'ivu' => 'application/vnd.immervision-ivu',
|
||||
'igm' => 'application/vnd.insors.igm',
|
||||
'xpw' => 'application/vnd.intercon.formnet',
|
||||
'i2g' => 'application/vnd.intergeo',
|
||||
'qbo' => 'application/vnd.intu.qbo',
|
||||
'qfx' => 'application/vnd.intu.qfx',
|
||||
'rcprofile' => 'application/vnd.ipunplugged.rcprofile',
|
||||
'irp' => 'application/vnd.irepository.package+xml',
|
||||
'xpr' => 'application/vnd.is-xpr',
|
||||
'fcs' => 'application/vnd.isac.fcs',
|
||||
'jam' => 'application/vnd.jam',
|
||||
'rms' => 'application/vnd.jcp.javame.midlet-rms',
|
||||
'jisp' => 'application/vnd.jisp',
|
||||
'joda' => 'application/vnd.joost.joda-archive',
|
||||
'ktz' => 'application/vnd.kahootz',
|
||||
'karbon' => 'application/vnd.kde.karbon',
|
||||
'chrt' => 'application/vnd.kde.kchart',
|
||||
'kfo' => 'application/vnd.kde.kformula',
|
||||
'flw' => 'application/vnd.kde.kivio',
|
||||
'kon' => 'application/vnd.kde.kontour',
|
||||
'kpr' => 'application/vnd.kde.kpresenter',
|
||||
'ksp' => 'application/vnd.kde.kspread',
|
||||
'kwd' => 'application/vnd.kde.kword',
|
||||
'htke' => 'application/vnd.kenameaapp',
|
||||
'kia' => 'application/vnd.kidspiration',
|
||||
'kne' => 'application/vnd.kinar',
|
||||
'skp' => 'application/vnd.koan',
|
||||
'sse' => 'application/vnd.kodak-descriptor',
|
||||
'lasxml' => 'application/vnd.las.las+xml',
|
||||
'lbd' => 'application/vnd.llamagraphics.life-balance.desktop',
|
||||
'lbe' => 'application/vnd.llamagraphics.life-balance.exchange+xml',
|
||||
'123' => 'application/vnd.lotus-1-2-3',
|
||||
'apr' => 'application/vnd.lotus-approach',
|
||||
'pre' => 'application/vnd.lotus-freelance',
|
||||
'nsf' => 'application/vnd.lotus-notes',
|
||||
'org' => 'application/vnd.lotus-organizer',
|
||||
'scm' => 'application/vnd.lotus-screencam',
|
||||
'lwp' => 'application/vnd.lotus-wordpro',
|
||||
'portpkg' => 'application/vnd.macports.portpkg',
|
||||
'mcd' => 'application/vnd.mcd',
|
||||
'mc1' => 'application/vnd.medcalcdata',
|
||||
'cdkey' => 'application/vnd.mediastation.cdkey',
|
||||
'mwf' => 'application/vnd.mfer',
|
||||
'mfm' => 'application/vnd.mfmp',
|
||||
'flo' => 'application/vnd.micrografx.flo',
|
||||
'igx' => 'application/vnd.micrografx.igx',
|
||||
'mif' => 'application/vnd.mif',
|
||||
'daf' => 'application/vnd.mobius.daf',
|
||||
'dis' => 'application/vnd.mobius.dis',
|
||||
'mbk' => 'application/vnd.mobius.mbk',
|
||||
'mqy' => 'application/vnd.mobius.mqy',
|
||||
'msl' => 'application/vnd.mobius.msl',
|
||||
'plc' => 'application/vnd.mobius.plc',
|
||||
'txf' => 'application/vnd.mobius.txf',
|
||||
'mpn' => 'application/vnd.mophun.application',
|
||||
'mpc' => 'application/vnd.mophun.certificate',
|
||||
'xul' => 'application/vnd.mozilla.xul+xml',
|
||||
'cil' => 'application/vnd.ms-artgalry',
|
||||
'cab' => 'application/vnd.ms-cab-compressed',
|
||||
'xls' => 'application/vnd.ms-excel',
|
||||
'xlam' => 'application/vnd.ms-excel.addin.macroenabled.12',
|
||||
'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroenabled.12',
|
||||
'xlsm' => 'application/vnd.ms-excel.sheet.macroenabled.12',
|
||||
'xltm' => 'application/vnd.ms-excel.template.macroenabled.12',
|
||||
'eot' => 'application/vnd.ms-fontobject',
|
||||
'chm' => 'application/vnd.ms-htmlhelp',
|
||||
'ims' => 'application/vnd.ms-ims',
|
||||
'lrm' => 'application/vnd.ms-lrm',
|
||||
'thmx' => 'application/vnd.ms-officetheme',
|
||||
'cat' => 'application/vnd.ms-pki.seccat',
|
||||
'stl' => 'application/vnd.ms-pki.stl',
|
||||
'ppt' => 'application/vnd.ms-powerpoint',
|
||||
'ppam' => 'application/vnd.ms-powerpoint.addin.macroenabled.12',
|
||||
'pptm' => 'application/vnd.ms-powerpoint.presentation.macroenabled.12',
|
||||
'sldm' => 'application/vnd.ms-powerpoint.slide.macroenabled.12',
|
||||
'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroenabled.12',
|
||||
'potm' => 'application/vnd.ms-powerpoint.template.macroenabled.12',
|
||||
'mpp' => 'application/vnd.ms-project',
|
||||
'docm' => 'application/vnd.ms-word.document.macroenabled.12',
|
||||
'dotm' => 'application/vnd.ms-word.template.macroenabled.12',
|
||||
'wps' => 'application/vnd.ms-works',
|
||||
'wpl' => 'application/vnd.ms-wpl',
|
||||
'xps' => 'application/vnd.ms-xpsdocument',
|
||||
'mseq' => 'application/vnd.mseq',
|
||||
'mus' => 'application/vnd.musician',
|
||||
'msty' => 'application/vnd.muvee.style',
|
||||
'taglet' => 'application/vnd.mynfc',
|
||||
'nlu' => 'application/vnd.neurolanguage.nlu',
|
||||
'ntf' => 'application/vnd.nitf',
|
||||
'nnd' => 'application/vnd.noblenet-directory',
|
||||
'nns' => 'application/vnd.noblenet-sealer',
|
||||
'nnw' => 'application/vnd.noblenet-web',
|
||||
'ngdat' => 'application/vnd.nokia.n-gage.data',
|
||||
'n-gage' => 'application/vnd.nokia.n-gage.symbian.install',
|
||||
'rpst' => 'application/vnd.nokia.radio-preset',
|
||||
'rpss' => 'application/vnd.nokia.radio-presets',
|
||||
'edm' => 'application/vnd.novadigm.edm',
|
||||
'edx' => 'application/vnd.novadigm.edx',
|
||||
'ext' => 'application/vnd.novadigm.ext',
|
||||
'odc' => 'application/vnd.oasis.opendocument.chart',
|
||||
'otc' => 'application/vnd.oasis.opendocument.chart-template',
|
||||
'odb' => 'application/vnd.oasis.opendocument.database',
|
||||
'odf' => 'application/vnd.oasis.opendocument.formula',
|
||||
'odft' => 'application/vnd.oasis.opendocument.formula-template',
|
||||
'odg' => 'application/vnd.oasis.opendocument.graphics',
|
||||
'otg' => 'application/vnd.oasis.opendocument.graphics-template',
|
||||
'odi' => 'application/vnd.oasis.opendocument.image',
|
||||
'oti' => 'application/vnd.oasis.opendocument.image-template',
|
||||
'odp' => 'application/vnd.oasis.opendocument.presentation',
|
||||
'otp' => 'application/vnd.oasis.opendocument.presentation-template',
|
||||
'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
|
||||
'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template',
|
||||
'odt' => 'application/vnd.oasis.opendocument.text',
|
||||
'odm' => 'application/vnd.oasis.opendocument.text-master',
|
||||
'ott' => 'application/vnd.oasis.opendocument.text-template',
|
||||
'oth' => 'application/vnd.oasis.opendocument.text-web',
|
||||
'xo' => 'application/vnd.olpc-sugar',
|
||||
'dd2' => 'application/vnd.oma.dd2+xml',
|
||||
'oxt' => 'application/vnd.openofficeorg.extension',
|
||||
'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
||||
'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide',
|
||||
'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
|
||||
'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template',
|
||||
'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||
'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
|
||||
'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||
'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
|
||||
'mgp' => 'application/vnd.osgeo.mapguide.package',
|
||||
'dp' => 'application/vnd.osgi.dp',
|
||||
'esa' => 'application/vnd.osgi.subsystem',
|
||||
'pdb' => 'application/vnd.palm',
|
||||
'paw' => 'application/vnd.pawaafile',
|
||||
'str' => 'application/vnd.pg.format',
|
||||
'ei6' => 'application/vnd.pg.osasli',
|
||||
'efif' => 'application/vnd.picsel',
|
||||
'wg' => 'application/vnd.pmi.widget',
|
||||
'plf' => 'application/vnd.pocketlearn',
|
||||
'pbd' => 'application/vnd.powerbuilder6',
|
||||
'box' => 'application/vnd.previewsystems.box',
|
||||
'mgz' => 'application/vnd.proteus.magazine',
|
||||
'qps' => 'application/vnd.publishare-delta-tree',
|
||||
'ptid' => 'application/vnd.pvi.ptid1',
|
||||
'qxd' => 'application/vnd.quark.quarkxpress',
|
||||
'bed' => 'application/vnd.realvnc.bed',
|
||||
'mxl' => 'application/vnd.recordare.musicxml',
|
||||
'musicxml' => 'application/vnd.recordare.musicxml+xml',
|
||||
'cryptonote' => 'application/vnd.rig.cryptonote',
|
||||
'cod' => 'application/vnd.rim.cod',
|
||||
'rm' => 'application/vnd.rn-realmedia',
|
||||
'rmvb' => 'application/vnd.rn-realmedia-vbr',
|
||||
'link66' => 'application/vnd.route66.link66+xml',
|
||||
'st' => 'application/vnd.sailingtracker.track',
|
||||
'see' => 'application/vnd.seemail',
|
||||
'sema' => 'application/vnd.sema',
|
||||
'semd' => 'application/vnd.semd',
|
||||
'semf' => 'application/vnd.semf',
|
||||
'ifm' => 'application/vnd.shana.informed.formdata',
|
||||
'itp' => 'application/vnd.shana.informed.formtemplate',
|
||||
'iif' => 'application/vnd.shana.informed.interchange',
|
||||
'ipk' => 'application/vnd.shana.informed.package',
|
||||
'twd' => 'application/vnd.simtech-mindmapper',
|
||||
'mmf' => 'application/vnd.smaf',
|
||||
'teacher' => 'application/vnd.smart.teacher',
|
||||
'sdkm' => 'application/vnd.solent.sdkm+xml',
|
||||
'dxp' => 'application/vnd.spotfire.dxp',
|
||||
'sfs' => 'application/vnd.spotfire.sfs',
|
||||
'sdc' => 'application/vnd.stardivision.calc',
|
||||
'sda' => 'application/vnd.stardivision.draw',
|
||||
'sdd' => 'application/vnd.stardivision.impress',
|
||||
'smf' => 'application/vnd.stardivision.math',
|
||||
'sdw' => 'application/vnd.stardivision.writer',
|
||||
'sgl' => 'application/vnd.stardivision.writer-global',
|
||||
'smzip' => 'application/vnd.stepmania.package',
|
||||
'sm' => 'application/vnd.stepmania.stepchart',
|
||||
'sxc' => 'application/vnd.sun.xml.calc',
|
||||
'stc' => 'application/vnd.sun.xml.calc.template',
|
||||
'sxd' => 'application/vnd.sun.xml.draw',
|
||||
'std' => 'application/vnd.sun.xml.draw.template',
|
||||
'sxi' => 'application/vnd.sun.xml.impress',
|
||||
'sti' => 'application/vnd.sun.xml.impress.template',
|
||||
'sxm' => 'application/vnd.sun.xml.math',
|
||||
'sxw' => 'application/vnd.sun.xml.writer',
|
||||
'sxg' => 'application/vnd.sun.xml.writer.global',
|
||||
'stw' => 'application/vnd.sun.xml.writer.template',
|
||||
'sus' => 'application/vnd.sus-calendar',
|
||||
'svd' => 'application/vnd.svd',
|
||||
'sis' => 'application/vnd.symbian.install',
|
||||
'xsm' => 'application/vnd.syncml+xml',
|
||||
'bdm' => 'application/vnd.syncml.dm+wbxml',
|
||||
'xdm' => 'application/vnd.syncml.dm+xml',
|
||||
'tao' => 'application/vnd.tao.intent-module-archive',
|
||||
'pcap' => 'application/vnd.tcpdump.pcap',
|
||||
'tmo' => 'application/vnd.tmobile-livetv',
|
||||
'tpt' => 'application/vnd.trid.tpt',
|
||||
'mxs' => 'application/vnd.triscape.mxs',
|
||||
'tra' => 'application/vnd.trueapp',
|
||||
'ufd' => 'application/vnd.ufdl',
|
||||
'utz' => 'application/vnd.uiq.theme',
|
||||
'umj' => 'application/vnd.umajin',
|
||||
'unityweb' => 'application/vnd.unity',
|
||||
'uoml' => 'application/vnd.uoml+xml',
|
||||
'vcx' => 'application/vnd.vcx',
|
||||
'vsd' => 'application/vnd.visio',
|
||||
'vis' => 'application/vnd.visionary',
|
||||
'vsf' => 'application/vnd.vsf',
|
||||
'wbxml' => 'application/vnd.wap.wbxml',
|
||||
'wmlc' => 'application/vnd.wap.wmlc',
|
||||
'wmlsc' => 'application/vnd.wap.wmlscriptc',
|
||||
'wtb' => 'application/vnd.webturbo',
|
||||
'nbp' => 'application/vnd.wolfram.player',
|
||||
'wpd' => 'application/vnd.wordperfect',
|
||||
'wqd' => 'application/vnd.wqd',
|
||||
'stf' => 'application/vnd.wt.stf',
|
||||
'xar' => 'application/vnd.xara',
|
||||
'xfdl' => 'application/vnd.xfdl',
|
||||
'hvd' => 'application/vnd.yamaha.hv-dic',
|
||||
'hvs' => 'application/vnd.yamaha.hv-script',
|
||||
'hvp' => 'application/vnd.yamaha.hv-voice',
|
||||
'osf' => 'application/vnd.yamaha.openscoreformat',
|
||||
'osfpvg' => 'application/vnd.yamaha.openscoreformat.osfpvg+xml',
|
||||
'saf' => 'application/vnd.yamaha.smaf-audio',
|
||||
'spf' => 'application/vnd.yamaha.smaf-phrase',
|
||||
'cmp' => 'application/vnd.yellowriver-custom-menu',
|
||||
'zir' => 'application/vnd.zul',
|
||||
'zaz' => 'application/vnd.zzazz.deck+xml',
|
||||
'vxml' => 'application/voicexml+xml',
|
||||
'wgt' => 'application/widget',
|
||||
'hlp' => 'application/winhlp',
|
||||
'wsdl' => 'application/wsdl+xml',
|
||||
'wspolicy' => 'application/wspolicy+xml',
|
||||
'7z' => 'application/x-7z-compressed',
|
||||
'abw' => 'application/x-abiword',
|
||||
'ace' => 'application/x-ace-compressed',
|
||||
'dmg' => 'application/x-apple-diskimage',
|
||||
'aab' => 'application/x-authorware-bin',
|
||||
'aam' => 'application/x-authorware-map',
|
||||
'aas' => 'application/x-authorware-seg',
|
||||
'bcpio' => 'application/x-bcpio',
|
||||
'torrent' => 'application/x-bittorrent',
|
||||
'blb' => 'application/x-blorb',
|
||||
'bz' => 'application/x-bzip',
|
||||
'bz2' => 'application/x-bzip2',
|
||||
'cbr' => 'application/x-cbr',
|
||||
'vcd' => 'application/x-cdlink',
|
||||
'cfs' => 'application/x-cfs-compressed',
|
||||
'chat' => 'application/x-chat',
|
||||
'pgn' => 'application/x-chess-pgn',
|
||||
'nsc' => 'application/x-conference',
|
||||
'cpio' => 'application/x-cpio',
|
||||
'csh' => 'application/x-csh',
|
||||
'deb' => 'application/x-debian-package',
|
||||
'dgc' => 'application/x-dgc-compressed',
|
||||
'dir' => 'application/x-director',
|
||||
'wad' => 'application/x-doom',
|
||||
'ncx' => 'application/x-dtbncx+xml',
|
||||
'dtb' => 'application/x-dtbook+xml',
|
||||
'res' => 'application/x-dtbresource+xml',
|
||||
'dvi' => 'application/x-dvi',
|
||||
'evy' => 'application/x-envoy',
|
||||
'eva' => 'application/x-eva',
|
||||
'bdf' => 'application/x-font-bdf',
|
||||
'gsf' => 'application/x-font-ghostscript',
|
||||
'psf' => 'application/x-font-linux-psf',
|
||||
'otf' => 'application/x-font-otf',
|
||||
'pcf' => 'application/x-font-pcf',
|
||||
'snf' => 'application/x-font-snf',
|
||||
'ttf' => 'application/x-font-ttf',
|
||||
'pfa' => 'application/x-font-type1',
|
||||
'woff' => 'application/x-font-woff',
|
||||
'arc' => 'application/x-freearc',
|
||||
'spl' => 'application/x-futuresplash',
|
||||
'gca' => 'application/x-gca-compressed',
|
||||
'ulx' => 'application/x-glulx',
|
||||
'gnumeric' => 'application/x-gnumeric',
|
||||
'gramps' => 'application/x-gramps-xml',
|
||||
'gtar' => 'application/x-gtar',
|
||||
'hdf' => 'application/x-hdf',
|
||||
'install' => 'application/x-install-instructions',
|
||||
'iso' => 'application/x-iso9660-image',
|
||||
'jnlp' => 'application/x-java-jnlp-file',
|
||||
'latex' => 'application/x-latex',
|
||||
'lzh' => 'application/x-lzh-compressed',
|
||||
'mie' => 'application/x-mie',
|
||||
'prc' => 'application/x-mobipocket-ebook',
|
||||
'application' => 'application/x-ms-application',
|
||||
'lnk' => 'application/x-ms-shortcut',
|
||||
'wmd' => 'application/x-ms-wmd',
|
||||
'wmz' => 'application/x-ms-wmz',
|
||||
'xbap' => 'application/x-ms-xbap',
|
||||
'mdb' => 'application/x-msaccess',
|
||||
'obd' => 'application/x-msbinder',
|
||||
'crd' => 'application/x-mscardfile',
|
||||
'clp' => 'application/x-msclip',
|
||||
'exe' => 'application/x-msdownload',
|
||||
'mvb' => 'application/x-msmediaview',
|
||||
'wmf' => 'application/x-msmetafile',
|
||||
'mny' => 'application/x-msmoney',
|
||||
'pub' => 'application/x-mspublisher',
|
||||
'scd' => 'application/x-msschedule',
|
||||
'trm' => 'application/x-msterminal',
|
||||
'wri' => 'application/x-mswrite',
|
||||
'nc' => 'application/x-netcdf',
|
||||
'nzb' => 'application/x-nzb',
|
||||
'p12' => 'application/x-pkcs12',
|
||||
'p7b' => 'application/x-pkcs7-certificates',
|
||||
'p7r' => 'application/x-pkcs7-certreqresp',
|
||||
'rar' => 'application/x-rar',
|
||||
'ris' => 'application/x-research-info-systems',
|
||||
'sh' => 'application/x-sh',
|
||||
'shar' => 'application/x-shar',
|
||||
'swf' => 'application/x-shockwave-flash',
|
||||
'xap' => 'application/x-silverlight-app',
|
||||
'sql' => 'application/x-sql',
|
||||
'sit' => 'application/x-stuffit',
|
||||
'sitx' => 'application/x-stuffitx',
|
||||
'srt' => 'application/x-subrip',
|
||||
'sv4cpio' => 'application/x-sv4cpio',
|
||||
'sv4crc' => 'application/x-sv4crc',
|
||||
't3' => 'application/x-t3vm-image',
|
||||
'gam' => 'application/x-tads',
|
||||
'tar' => 'application/x-tar',
|
||||
'tcl' => 'application/x-tcl',
|
||||
'tex' => 'application/x-tex',
|
||||
'tfm' => 'application/x-tex-tfm',
|
||||
'texinfo' => 'application/x-texinfo',
|
||||
'obj' => 'application/x-tgif',
|
||||
'ustar' => 'application/x-ustar',
|
||||
'src' => 'application/x-wais-source',
|
||||
'der' => 'application/x-x509-ca-cert',
|
||||
'fig' => 'application/x-xfig',
|
||||
'xlf' => 'application/x-xliff+xml',
|
||||
'xpi' => 'application/x-xpinstall',
|
||||
'xz' => 'application/x-xz',
|
||||
'z1' => 'application/x-zmachine',
|
||||
'xaml' => 'application/xaml+xml',
|
||||
'xdf' => 'application/xcap-diff+xml',
|
||||
'xenc' => 'application/xenc+xml',
|
||||
'xhtml' => 'application/xhtml+xml',
|
||||
'xml' => 'application/xml',
|
||||
'dtd' => 'application/xml-dtd',
|
||||
'xop' => 'application/xop+xml',
|
||||
'xpl' => 'application/xproc+xml',
|
||||
'xslt' => 'application/xslt+xml',
|
||||
'xspf' => 'application/xspf+xml',
|
||||
'mxml' => 'application/xv+xml',
|
||||
'yang' => 'application/yang',
|
||||
'yin' => 'application/yin+xml',
|
||||
'zip' => 'application/zip',
|
||||
'adp' => 'audio/adpcm',
|
||||
'au' => 'audio/basic',
|
||||
'mid' => 'audio/midi',
|
||||
'mp4a' => 'audio/mp4',
|
||||
'mpga' => 'audio/mpeg',
|
||||
'oga' => 'audio/ogg',
|
||||
's3m' => 'audio/s3m',
|
||||
'sil' => 'audio/silk',
|
||||
'uva' => 'audio/vnd.dece.audio',
|
||||
'eol' => 'audio/vnd.digital-winds',
|
||||
'dra' => 'audio/vnd.dra',
|
||||
'dts' => 'audio/vnd.dts',
|
||||
'dtshd' => 'audio/vnd.dts.hd',
|
||||
'lvp' => 'audio/vnd.lucent.voice',
|
||||
'pya' => 'audio/vnd.ms-playready.media.pya',
|
||||
'ecelp4800' => 'audio/vnd.nuera.ecelp4800',
|
||||
'ecelp7470' => 'audio/vnd.nuera.ecelp7470',
|
||||
'ecelp9600' => 'audio/vnd.nuera.ecelp9600',
|
||||
'rip' => 'audio/vnd.rip',
|
||||
'weba' => 'audio/webm',
|
||||
'aac' => 'audio/x-aac',
|
||||
'aif' => 'audio/x-aiff',
|
||||
'caf' => 'audio/x-caf',
|
||||
'flac' => 'audio/x-flac',
|
||||
'mka' => 'audio/x-matroska',
|
||||
'm3u' => 'audio/x-mpegurl',
|
||||
'wax' => 'audio/x-ms-wax',
|
||||
'wma' => 'audio/x-ms-wma',
|
||||
'ram' => 'audio/x-pn-realaudio',
|
||||
'rmp' => 'audio/x-pn-realaudio-plugin',
|
||||
'wav' => 'audio/x-wav',
|
||||
'xm' => 'audio/xm',
|
||||
'cdx' => 'chemical/x-cdx',
|
||||
'cif' => 'chemical/x-cif',
|
||||
'cmdf' => 'chemical/x-cmdf',
|
||||
'cml' => 'chemical/x-cml',
|
||||
'csml' => 'chemical/x-csml',
|
||||
'xyz' => 'chemical/x-xyz',
|
||||
'bmp' => 'image/bmp',
|
||||
'cgm' => 'image/cgm',
|
||||
'g3' => 'image/g3fax',
|
||||
'gif' => 'image/gif',
|
||||
'ief' => 'image/ief',
|
||||
'jpg' => 'image/jpeg',
|
||||
'jpeg' => 'image/jpeg',
|
||||
'ktx' => 'image/ktx',
|
||||
'png' => 'image/png',
|
||||
'btif' => 'image/prs.btif',
|
||||
'sgi' => 'image/sgi',
|
||||
'svg' => 'image/svg+xml',
|
||||
'tiff' => 'image/tiff',
|
||||
'psd' => 'image/vnd.adobe.photoshop',
|
||||
'uvi' => 'image/vnd.dece.graphic',
|
||||
'djvu' => 'image/vnd.djvu',
|
||||
'dwg' => 'image/vnd.dwg',
|
||||
'dxf' => 'image/vnd.dxf',
|
||||
'fbs' => 'image/vnd.fastbidsheet',
|
||||
'fpx' => 'image/vnd.fpx',
|
||||
'fst' => 'image/vnd.fst',
|
||||
'mmr' => 'image/vnd.fujixerox.edmics-mmr',
|
||||
'rlc' => 'image/vnd.fujixerox.edmics-rlc',
|
||||
'mdi' => 'image/vnd.ms-modi',
|
||||
'wdp' => 'image/vnd.ms-photo',
|
||||
'npx' => 'image/vnd.net-fpx',
|
||||
'wbmp' => 'image/vnd.wap.wbmp',
|
||||
'xif' => 'image/vnd.xiff',
|
||||
'webp' => 'image/webp',
|
||||
'3ds' => 'image/x-3ds',
|
||||
'ras' => 'image/x-cmu-raster',
|
||||
'cmx' => 'image/x-cmx',
|
||||
'fh' => 'image/x-freehand',
|
||||
'ico' => 'image/x-icon',
|
||||
'sid' => 'image/x-mrsid-image',
|
||||
'pcx' => 'image/x-pcx',
|
||||
'pic' => 'image/x-pict',
|
||||
'pnm' => 'image/x-portable-anymap',
|
||||
'pbm' => 'image/x-portable-bitmap',
|
||||
'pgm' => 'image/x-portable-graymap',
|
||||
'ppm' => 'image/x-portable-pixmap',
|
||||
'rgb' => 'image/x-rgb',
|
||||
'tga' => 'image/x-tga',
|
||||
'xbm' => 'image/x-xbitmap',
|
||||
'xpm' => 'image/x-xpixmap',
|
||||
'xwd' => 'image/x-xwindowdump',
|
||||
'eml' => 'message/rfc822',
|
||||
'igs' => 'model/iges',
|
||||
'msh' => 'model/mesh',
|
||||
'dae' => 'model/vnd.collada+xml',
|
||||
'dwf' => 'model/vnd.dwf',
|
||||
'gdl' => 'model/vnd.gdl',
|
||||
'gtw' => 'model/vnd.gtw',
|
||||
'mts' => 'model/vnd.mts',
|
||||
'vtu' => 'model/vnd.vtu',
|
||||
'wrl' => 'model/vrml',
|
||||
'x3db' => 'model/x3d+binary',
|
||||
'x3dv' => 'model/x3d+vrml',
|
||||
'x3d' => 'model/x3d+xml',
|
||||
'appcache' => 'text/cache-manifest',
|
||||
'ics' => 'text/calendar',
|
||||
'css' => 'text/css',
|
||||
'csv' => 'text/csv',
|
||||
'html' => 'text/html',
|
||||
'n3' => 'text/n3',
|
||||
'txt' => 'text/plain',
|
||||
'dsc' => 'text/prs.lines.tag',
|
||||
'rtx' => 'text/richtext',
|
||||
'rtf' => 'text/rtf',
|
||||
'sgml' => 'text/sgml',
|
||||
'tsv' => 'text/tab-separated-values',
|
||||
't' => 'text/troff',
|
||||
'ttl' => 'text/turtle',
|
||||
'uri' => 'text/uri-list',
|
||||
'vcard' => 'text/vcard',
|
||||
'curl' => 'text/vnd.curl',
|
||||
'dcurl' => 'text/vnd.curl.dcurl',
|
||||
'scurl' => 'text/vnd.curl.scurl',
|
||||
'mcurl' => 'text/vnd.curl.mcurl',
|
||||
'sub' => 'text/vnd.dvb.subtitle',
|
||||
'fly' => 'text/vnd.fly',
|
||||
'flx' => 'text/vnd.fmi.flexstor',
|
||||
'gv' => 'text/vnd.graphviz',
|
||||
'3dml' => 'text/vnd.in3d.3dml',
|
||||
'spot' => 'text/vnd.in3d.spot',
|
||||
'jad' => 'text/vnd.sun.j2me.app-descriptor',
|
||||
'wml' => 'text/vnd.wap.wml',
|
||||
'wmls' => 'text/vnd.wap.wmlscript',
|
||||
's' => 'text/x-asm',
|
||||
'c' => 'text/x-c',
|
||||
'f' => 'text/x-fortran',
|
||||
'p' => 'text/x-pascal',
|
||||
'java' => 'text/x-java-source',
|
||||
'opml' => 'text/x-opml',
|
||||
'nfo' => 'text/x-nfo',
|
||||
'etx' => 'text/x-setext',
|
||||
'sfv' => 'text/x-sfv',
|
||||
'uu' => 'text/x-uuencode',
|
||||
'vcs' => 'text/x-vcalendar',
|
||||
'vcf' => 'text/x-vcard',
|
||||
'3gp' => 'video/3gpp',
|
||||
'3g2' => 'video/3gpp2',
|
||||
'h261' => 'video/h261',
|
||||
'h263' => 'video/h263',
|
||||
'h264' => 'video/h264',
|
||||
'jpgv' => 'video/jpeg',
|
||||
'jpm' => 'video/jpm',
|
||||
'mj2' => 'video/mj2',
|
||||
'mp4' => 'video/mp4',
|
||||
'mpeg' => 'video/mpeg',
|
||||
'ogv' => 'video/ogg',
|
||||
'qt' => 'video/quicktime',
|
||||
'uvh' => 'video/vnd.dece.hd',
|
||||
'uvm' => 'video/vnd.dece.mobile',
|
||||
'uvp' => 'video/vnd.dece.pd',
|
||||
'uvs' => 'video/vnd.dece.sd',
|
||||
'uvv' => 'video/vnd.dece.video',
|
||||
'dvb' => 'video/vnd.dvb.file',
|
||||
'fvt' => 'video/vnd.fvt',
|
||||
'mxu' => 'video/vnd.mpegurl',
|
||||
'pyv' => 'video/vnd.ms-playready.media.pyv',
|
||||
'uvu' => 'video/vnd.uvvu.mp4',
|
||||
'viv' => 'video/vnd.vivo',
|
||||
'webm' => 'video/webm',
|
||||
'f4v' => 'video/x-f4v',
|
||||
'fli' => 'video/x-fli',
|
||||
'flv' => 'video/x-flv',
|
||||
'm4v' => 'video/x-m4v',
|
||||
'mkv' => 'video/x-matroska',
|
||||
'mng' => 'video/x-mng',
|
||||
'asf' => 'video/x-ms-asf',
|
||||
'vob' => 'video/x-ms-vob',
|
||||
'wm' => 'video/x-ms-wm',
|
||||
'wmv' => 'video/x-ms-wmv',
|
||||
'wmx' => 'video/x-ms-wmx',
|
||||
'wvx' => 'video/x-ms-wvx',
|
||||
'avi' => 'video/x-msvideo',
|
||||
'movie' => 'video/x-sgi-movie',
|
||||
'smv' => 'video/x-smv',
|
||||
'ice' => 'x-conference/x-cooltalk',
|
||||
];
|
||||
|
||||
/**
|
||||
* Get the MIME type for a file based on the file's extension.
|
||||
*
|
||||
* @param string $filename
|
||||
* @return string
|
||||
*/
|
||||
public static function from($filename)
|
||||
{
|
||||
$extension = pathinfo($filename, PATHINFO_EXTENSION);
|
||||
|
||||
return collect(self::$mimes)->get($extension, 'application/octet-stream');
|
||||
}
|
||||
}
|
||||
122
vendor/laravel/framework/src/Illuminate/Http/UploadedFile.php
vendored
Normal file
122
vendor/laravel/framework/src/Illuminate/Http/UploadedFile.php
vendored
Normal file
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Http;
|
||||
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Container\Container;
|
||||
use Illuminate\Support\Traits\Macroable;
|
||||
use Illuminate\Contracts\Filesystem\Factory as FilesystemFactory;
|
||||
use Symfony\Component\HttpFoundation\File\UploadedFile as SymfonyUploadedFile;
|
||||
|
||||
class UploadedFile extends SymfonyUploadedFile
|
||||
{
|
||||
use FileHelpers, Macroable;
|
||||
|
||||
/**
|
||||
* Begin creating a new file fake.
|
||||
*
|
||||
* @return \Illuminate\Http\Testing\FileFactory
|
||||
*/
|
||||
public static function fake()
|
||||
{
|
||||
return new Testing\FileFactory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Store the uploaded file on a filesystem disk.
|
||||
*
|
||||
* @param string $path
|
||||
* @param array $options
|
||||
* @return string|false
|
||||
*/
|
||||
public function store($path, $options = [])
|
||||
{
|
||||
return $this->storeAs($path, $this->hashName(), $this->parseOptions($options));
|
||||
}
|
||||
|
||||
/**
|
||||
* Store the uploaded file on a filesystem disk with public visibility.
|
||||
*
|
||||
* @param string $path
|
||||
* @param array $options
|
||||
* @return string|false
|
||||
*/
|
||||
public function storePublicly($path, $options = [])
|
||||
{
|
||||
$options = $this->parseOptions($options);
|
||||
|
||||
$options['visibility'] = 'public';
|
||||
|
||||
return $this->storeAs($path, $this->hashName(), $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store the uploaded file on a filesystem disk with public visibility.
|
||||
*
|
||||
* @param string $path
|
||||
* @param string $name
|
||||
* @param array $options
|
||||
* @return string|false
|
||||
*/
|
||||
public function storePubliclyAs($path, $name, $options = [])
|
||||
{
|
||||
$options = $this->parseOptions($options);
|
||||
|
||||
$options['visibility'] = 'public';
|
||||
|
||||
return $this->storeAs($path, $name, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store the uploaded file on a filesystem disk.
|
||||
*
|
||||
* @param string $path
|
||||
* @param string $name
|
||||
* @param array $options
|
||||
* @return string|false
|
||||
*/
|
||||
public function storeAs($path, $name, $options = [])
|
||||
{
|
||||
$options = $this->parseOptions($options);
|
||||
|
||||
$disk = Arr::pull($options, 'disk');
|
||||
|
||||
return Container::getInstance()->make(FilesystemFactory::class)->disk($disk)->putFileAs(
|
||||
$path, $this, $name, $options
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new file instance from a base instance.
|
||||
*
|
||||
* @param \Symfony\Component\HttpFoundation\File\UploadedFile $file
|
||||
* @param bool $test
|
||||
* @return static
|
||||
*/
|
||||
public static function createFromBase(SymfonyUploadedFile $file, $test = false)
|
||||
{
|
||||
return $file instanceof static ? $file : new static(
|
||||
$file->getPathname(),
|
||||
$file->getClientOriginalName(),
|
||||
$file->getClientMimeType(),
|
||||
$file->getClientSize(),
|
||||
$file->getError(),
|
||||
$test
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse and format the given options.
|
||||
*
|
||||
* @param array|string $options
|
||||
* @return array
|
||||
*/
|
||||
protected function parseOptions($options)
|
||||
{
|
||||
if (is_string($options)) {
|
||||
$options = ['disk' => $options];
|
||||
}
|
||||
|
||||
return $options;
|
||||
}
|
||||
}
|
||||
37
vendor/laravel/framework/src/Illuminate/Http/composer.json
vendored
Executable file
37
vendor/laravel/framework/src/Illuminate/Http/composer.json
vendored
Executable file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"name": "illuminate/http",
|
||||
"description": "The Illuminate Http package.",
|
||||
"license": "MIT",
|
||||
"homepage": "https://laravel.com",
|
||||
"support": {
|
||||
"issues": "https://github.com/laravel/framework/issues",
|
||||
"source": "https://github.com/laravel/framework"
|
||||
},
|
||||
"authors": [
|
||||
{
|
||||
"name": "Taylor Otwell",
|
||||
"email": "taylor@laravel.com"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.6.4",
|
||||
"illuminate/session": "5.4.*",
|
||||
"illuminate/support": "5.4.*",
|
||||
"symfony/http-foundation": "~3.2",
|
||||
"symfony/http-kernel": "~3.2"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Illuminate\\Http\\": ""
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "5.4-dev"
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"sort-packages": true
|
||||
},
|
||||
"minimum-stability": "dev"
|
||||
}
|
||||
Reference in New Issue
Block a user