Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5978284
OutputGlobToUrl.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
OutputGlobToUrl.php
View Options
<?php
namespace
Shellbox\Command
;
use
GuzzleHttp\Psr7\Uri
;
use
Psr\Http\Message\UriInterface
;
/**
* An OutputGlob for files that are sent to a server with PUT requests.
* @since 4.1.0
*/
class
OutputGlobToUrl
extends
OutputGlob
{
/** @var UriInterface */
private
$destUri
;
/**
* @internal
* @param string $prefix
* @param string $extension
* @param string|UriInterface $destUrl
*/
public
function
__construct
(
string
$prefix
,
string
$extension
,
$destUrl
)
{
parent
::
__construct
(
$prefix
,
$extension
);
if
(
$destUrl
instanceof
UriInterface
)
{
$this
->
destUri
=
$destUrl
;
}
else
{
$this
->
destUri
=
new
Uri
(
$destUrl
);
}
}
public
function
getOutputFile
(
$boxedName
)
{
$path
=
$this
->
destUri
->
getPath
()
.
basename
(
$boxedName
);
$instance
=
new
OutputFileToUrl
(
$this
->
destUri
->
withPath
(
$path
)
);
$this
->
files
[
$boxedName
]
=
$instance
;
return
$instance
;
}
public
function
getClientData
()
{
return
parent
::
getClientData
()
+
[
'type'
=>
'url'
,
'url'
=>
(
string
)
$this
->
destUri
,
];
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Oct 3, 20:20 (3 d, 14 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
d5/d3/d61ec0d78a5289d513ef877ea747
Default Alt Text
OutputGlobToUrl.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment