Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
4b9da747
Commit
4b9da747
authored
May 14, 2014
by
Marco Pivetta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#598 - Minor CS/cleanups in the DBAL CLI runner
parent
be370575
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
doctrine-dbal.php
bin/doctrine-dbal.php
+11
-8
No files found.
bin/doctrine-dbal.php
View file @
4b9da747
...
@@ -21,6 +21,10 @@ use Symfony\Component\Console\Helper\HelperSet;
...
@@ -21,6 +21,10 @@ use Symfony\Component\Console\Helper\HelperSet;
use
Doctrine\DBAL\Tools\Console\ConsoleRunner
;
use
Doctrine\DBAL\Tools\Console\ConsoleRunner
;
$files
=
array
(
__DIR__
.
'/../vendor/autoload.php'
,
__DIR__
.
'/../../../autoload.php'
);
$files
=
array
(
__DIR__
.
'/../vendor/autoload.php'
,
__DIR__
.
'/../../../autoload.php'
);
$loader
=
null
;
$cwd
=
getcwd
();
$directories
=
array
(
$cwd
,
$cwd
.
DIRECTORY_SEPARATOR
.
'config'
);
$configFile
=
null
;
foreach
(
$files
as
$file
)
{
foreach
(
$files
as
$file
)
{
if
(
file_exists
(
$file
))
{
if
(
file_exists
(
$file
))
{
...
@@ -30,13 +34,10 @@ foreach ($files as $file) {
...
@@ -30,13 +34,10 @@ foreach ($files as $file) {
}
}
}
}
if
(
!
$loader
)
{
if
(
!
$loader
)
{
throw
new
RuntimeException
(
'vendor/autoload.php could not be found. Did you run `php composer.phar install`?'
);
throw
new
RuntimeException
(
'vendor/autoload.php could not be found. Did you run `php composer.phar install`?'
);
}
}
$directories
=
array
(
getcwd
(),
getcwd
()
.
DIRECTORY_SEPARATOR
.
'config'
);
$configFile
=
null
;
foreach
(
$directories
as
$directory
)
{
foreach
(
$directories
as
$directory
)
{
$configFile
=
$directory
.
DIRECTORY_SEPARATOR
.
'cli-config.php'
;
$configFile
=
$directory
.
DIRECTORY_SEPARATOR
.
'cli-config.php'
;
...
@@ -47,22 +48,24 @@ foreach ($directories as $directory) {
...
@@ -47,22 +48,24 @@ foreach ($directories as $directory) {
if
(
!
file_exists
(
$configFile
))
{
if
(
!
file_exists
(
$configFile
))
{
ConsoleRunner
::
printCliConfigTemplate
();
ConsoleRunner
::
printCliConfigTemplate
();
exit
(
1
);
exit
(
1
);
}
}
if
(
!
is_readable
(
$configFile
))
{
if
(
!
is_readable
(
$configFile
))
{
echo
'Configuration file ['
.
$configFile
.
'] does not have read permission.'
.
PHP_EOL
;
echo
'Configuration file ['
.
$configFile
.
'] does not have read permission.'
.
PHP_EOL
;
exit
(
1
);
exit
(
1
);
}
}
$commands
=
array
();
$commands
=
array
();
$helperSet
=
require
$configFile
;
$helperSet
=
require
$configFile
;
if
(
!
(
$helperSet
instanceof
HelperSet
)
)
{
if
(
!
$helperSet
instanceof
HelperSet
)
{
foreach
(
$GLOBALS
as
$helperSetCandidate
)
{
foreach
(
$GLOBALS
as
$helperSetCandidate
)
{
if
(
$helperSetCandidate
instanceof
HelperSet
)
{
if
(
$helperSetCandidate
instanceof
HelperSet
)
{
$helperSet
=
$helperSetCandidate
;
$helperSet
=
$helperSetCandidate
;
break
;
break
;
}
}
}
}
...
...
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