Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5981993
InputFile.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
868 B
Referenced Files
None
Subscribers
None
InputFile.php
View Options
<?php
namespace
Shellbox\Command
;
use
Shellbox\ShellboxError
;
/**
* The base class for input files
*/
abstract
class
InputFile
{
use
UserDataTrait
;
/**
* Get data for JSON serialization by the client.
*
* @internal
* @return array
*/
public
function
getClientData
()
{
return
[];
}
/**
* Get an InputFile object to represent a file already created by the server.
*
* @internal
* @param array $data
* @return InputFile
*/
public
static
function
newFromClientData
(
$data
)
{
if
(
(
$data
[
'type'
]
??
''
)
===
'url'
)
{
if
(
!
isset
(
$data
[
'url'
]
)
)
{
throw
new
ShellboxError
(
'Missing required parameter for URL file: "url"'
);
}
$file
=
new
InputFileFromUrl
(
$data
[
'url'
]
);
if
(
isset
(
$data
[
'headers'
]
)
)
{
$file
->
headers
(
$data
[
'headers'
]
);
}
return
$file
;
}
return
new
InputFilePlaceholder
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Oct 3, 22:09 (1 w, 3 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
ef/4f/3f658169656b19d18cf60fe7ce21
Default Alt Text
InputFile.php (868 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment