Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F484388
build-phar
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
build-phar
View Options
#!/usr/bin/php
<?php
include
(
'src/RESTful/Settings.php'
);
function
exit_unless
(
$condition
,
$msg
=
null
)
{
if
(
$condition
)
return
;
echo
"[FAIL] $msg"
;
exit
(
1
);
}
echo
"Building Phar... "
;
$base_dir
=
dirname
(
__FILE__
);
$source_dir
=
$base_dir
.
'/src/RESTful/'
;
$phar_name
=
'restful.phar'
;
$phar_path
=
$base_dir
.
'/'
.
$phar_name
;
$phar
=
new
Phar
(
$phar_path
,
0
,
$phar_name
);
$stub
=
<<<HEREDOC
<?php
// Phar Stub File
Phar::mapPhar('restful.phar');
include('phar://restful.phar/RESTful/Bootstrap.php');
\RESTful\Bootstrap::pharInit();
__HALT_COMPILER();
HEREDOC;
$phar
->
setStub
(
$stub
);
exit_unless
(
$phar
,
"Unable to create a phar. Make sure you have phar.readonly=0 set in your ini file."
);
$phar
->
buildFromDirectory
(
dirname
(
$source_dir
));
echo
"[ OK ]
\n
"
;
echo
"Renaming Phar... "
;
$phar_versioned_name
=
'restful-'
.
\RESTful\Settings
::
VERSION
.
'.phar'
;
$phar_versioned_path
=
$base_dir
.
'/'
.
$phar_versioned_name
;
rename
(
$phar_path
,
$phar_versioned_path
);
echo
"[ OK ]
\n
"
;
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, May 7, 3:51 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
66206
Default Alt Text
build-phar (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment