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
a8727ab2
Commit
a8727ab2
authored
Mar 03, 2021
by
Hendrik Heneke
Browse files
Build phar in root dir.
parent
9273a161
Pipeline
#369
passed with stage
in 33 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
10 deletions
+3
-10
.gitignore
.gitignore
+1
-1
build-phar.php
build-phar.php
+2
-9
No files found.
.gitignore
View file @
a8727ab2
.idea
.phpunit.result.cache
/build/
cfgen.phar
/vendor/
build-phar.php
View file @
a8727ab2
<?php
if
(
!
file_exists
(
'build'
))
{
mkdir
(
'build'
);
}
if
(
file_exists
(
'build/cfgen.phar'
))
{
unlink
(
'build/cfgen.phar'
);
}
$pharName
=
'build/cfgen.phar'
;
$p
=
new
Phar
(
$pharName
,
FilesystemIterator
::
CURRENT_AS_FILEINFO
|
FilesystemIterator
::
KEY_AS_FILENAME
,
basename
(
$pharName
));
$pharName
=
'cfgen.phar'
;
$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(); ?>"
);
$p
->
buildFromDirectory
(
'.'
,
'/(src|vendor)\/(.*)\.php$/'
,
);
$p
->
stopBuffering
();
chmod
(
'build/cfgen.phar'
,
0755
);
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