Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
hhit
config-generator
Commits
5cee5eab
Commit
5cee5eab
authored
Dec 22, 2022
by
Hendrik Heneke
Browse files
When building phar, unlink existing file only of it exists
parent
39b01411
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
build-phar.php
build-phar.php
+3
-1
No files found.
build-phar.php
View file @
5cee5eab
<?php
$pharName
=
'cfgen.phar'
;
unlink
(
$pharName
);
if
(
file_exists
(
$pharName
))
{
unlink
(
$pharName
);
}
$p
=
new
Phar
(
$pharName
,
FilesystemIterator
::
CURRENT_AS_FILEINFO
|
FilesystemIterator
::
KEY_AS_FILENAME
,
$pharName
);
$p
->
startBuffering
();
$p
->
setStub
(
"#!/usr/bin/env php
\n
<?php Phar::mapPhar(); include
\"
phar://
$pharName
/src/cfgen.php
\"
; __HALT_COMPILER(); ?>"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment