Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92655102
PhutilBallOfPHP.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Nov 22, 10:49
Size
634 B
Mime Type
text/x-php
Expires
Sun, Nov 24, 10:49 (2 d)
Engine
blob
Format
Raw Data
Handle
22478827
Attached To
rPHU libphutil
PhutilBallOfPHP.php
View Options
<?php
/**
* Concatenates PHP files together into a single stream. Used by Phage to
* transmit bootloading code.
*/
final
class
PhutilBallOfPHP
{
private
$parts
=
array
();
public
function
addFile
(
$path
)
{
$data
=
Filesystem
::
readFile
(
$path
);
if
(
strncmp
(
$data
,
"<?php
\n
"
,
6
))
{
throw
new
Exception
(
pht
(
"Expected file '%s' to begin `%s`."
,
$path
,
'<?php
\n
'
));
}
$this
->
parts
[]
=
substr
(
$data
,
6
);
return
$this
;
}
public
function
addText
(
$text
)
{
$this
->
parts
[]
=
$text
;
}
public
function
toString
()
{
return
implode
(
''
,
$this
->
parts
);
}
}
Event Timeline
Log In to Comment