Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F108384731
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
Wed, Apr 16, 10:10
Size
593 B
Mime Type
text/x-php
Expires
Fri, Apr 18, 10:10 (1 d, 7 h)
Engine
blob
Format
Raw Data
Handle
25585200
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
(
"Expected file '{$path}' to begin
\"
<?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