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
579a25e7
Commit
579a25e7
authored
Mar 03, 2021
by
Hendrik Heneke
Browse files
Removed auto discovery and composer binary.
parent
6c5e0e8f
Pipeline
#371
passed with stage
in 31 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
22 deletions
+2
-22
composer.json
composer.json
+0
-3
src/cfgen.php
src/cfgen.php
+2
-19
No files found.
composer.json
View file @
579a25e7
...
...
@@ -40,9 +40,6 @@
"HHIT\\ConfigGenerator\\Tests\\"
:
"tests/"
}
},
"bin"
:
[
"bin/cfgen"
],
"scripts"
:
{
"build:phar"
:
"php -d phar.readonly=0 build-phar.php"
,
"test-run:bin"
:
"bin/cfgen generate-configs --env test --project fixture --overwrite"
,
...
...
src/cfgen.php
View file @
579a25e7
...
...
@@ -11,28 +11,11 @@ if (!in_array(PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {
set_time_limit
(
0
);
$candidates
=
[
dirname
(
__DIR__
)
.
'/../../autoload.php'
=>
dirname
(
__DIR__
)
.
'/../../../'
,
dirname
(
__DIR__
)
.
'/vendor/autoload.php'
=>
dirname
(
__DIR__
)
];
$autoloaderPath
=
null
;
$projectDir
=
null
;
foreach
(
$candidates
as
$autoloaderPathCandidate
=>
$projectDirCandidate
)
{
if
(
file_exists
(
$autoloaderPathCandidate
))
{
$autoloaderPath
=
$autoloaderPathCandidate
;
$projectDir
=
$projectDirCandidate
;
break
;
}
}
if
(
null
===
$autoloaderPath
)
{
throw
new
RuntimeException
(
'Unable to locate autoload.php file.'
);
}
require_once
$autoloaderPath
;
require_once
__DIR__
.
'/../vendor/autoload.php'
;
unset
(
$candidates
,
$autoloaderPathCandidate
,
$pojectDirCandidate
);
$application
=
new
Application
(
'Configuration Generator'
);
$application
->
add
(
new
GenerateConfigsCommand
(
$projectDir
));
$application
->
add
(
new
GenerateConfigsCommand
(
getcwd
()
));
$input
=
new
ArgvInput
();
if
(
null
!==
$env
=
$input
->
getParameterOption
([
'--env'
,
'-e'
],
'dev'
,
true
))
{
...
...
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