Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F6102113
OutputFileToString.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
798 B
Referenced Files
None
Subscribers
None
OutputFileToString.php
View Options
<?php
namespace
Shellbox\Command
;
use
Shellbox\FileUtils
;
use
Shellbox\Multipart\MultipartReader
;
use
Shellbox\ShellboxError
;
/**
* Encapsulation of an output file that is read into a string
*/
class
OutputFileToString
extends
OutputFileWithContents
{
/** @var string */
private
$contents
;
public
function
copyFromFile
(
$sourcePath
)
{
$this
->
contents
=
FileUtils
::
getContents
(
$sourcePath
);
$this
->
setReceived
();
}
public
function
getContents
()
{
if
(
$this
->
contents
===
null
)
{
throw
new
ShellboxError
(
__METHOD__
.
' was called too early or '
.
'on a non-existent file'
);
}
return
$this
->
contents
;
}
public
function
readFromMultipart
(
MultipartReader
$multipartReader
)
{
$this
->
contents
=
$multipartReader
->
readPartAsString
();
$this
->
setReceived
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Oct 6 2026, 09:47 (6 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
cc/ae/cc2b3b0ffde97420ab90714554af
Default Alt Text
OutputFileToString.php (798 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment