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
25be43c3
Commit
25be43c3
authored
Aug 24, 2009
by
romanb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0] Some small cleanups on new CLI code. Added basic CLI file 'doctrine'.
parent
b3cb24aa
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
8 deletions
+14
-8
doctrine
doctrine
+10
-0
Cli.php
lib/Doctrine/ORM/Tools/Cli.php
+4
-4
AbstractPrinter.php
lib/Doctrine/ORM/Tools/Cli/AbstractPrinter.php
+0
-2
AbstractTask.php
lib/Doctrine/ORM/Tools/Cli/AbstractTask.php
+0
-2
No files found.
doctrine
0 → 100755
View file @
25be43c3
#!/usr/bin/env php
<?php
require
__DIR__
.
'/lib/Doctrine/Common/ClassLoader.php'
;
$classLoader
=
new
\Doctrine\Common\ClassLoader
();
$classLoader
->
setBasePath
(
'Doctrine'
,
__DIR__
.
'/lib'
);
$cli
=
new
\Doctrine\ORM\Tools\Cli
();
$cli
->
run
(
$_SERVER
[
'argv'
]);
lib/Doctrine/ORM/Tools/Cli.php
View file @
25be43c3
...
...
@@ -72,7 +72,7 @@ class Cli
public
function
__construct
(
$printer
=
null
)
{
//$this->_printer = new Printer\Normal();
$this
->
_printer
=
(
$printer
)
?:
new
Printer\AnsiColor
();
$this
->
_printer
=
$printer
?:
new
Printer\AnsiColor
();
// Include core tasks
$ns
=
'Doctrine\ORM\Tools\Cli\Task'
;
...
...
@@ -125,7 +125,7 @@ class Cli
$taskArguments
[
'availableTasks'
]
=
$this
->
_tasks
;
// Check if task exists
if
(
$this
->
_tasks
[
$taskName
]
&&
class_exists
(
$this
->
_tasks
[
$taskName
],
true
))
{
if
(
isset
(
$this
->
_tasks
[
$taskName
])
&&
class_exists
(
$this
->
_tasks
[
$taskName
],
true
))
{
// Instantiate and execute the task
$task
=
new
$this
->
_tasks
[
$taskName
]();
$task
->
setPrinter
(
$this
->
_printer
);
...
...
@@ -139,12 +139,12 @@ class Cli
$task
->
basicHelp
();
// Fallback of not-valid task arguments
}
}
else
{
throw
new
Doctrine\Exception
(
throw
\Doctrine\Common\DoctrineException
::
updateMe
(
'Unexistent task or attached task class does not exist.'
);
}
}
}
catch
(
\Doctrine\Exception
$e
)
{
}
catch
(
\Doctrine\
Common\Doctrine
Exception
$e
)
{
$this
->
_printer
->
write
(
$taskName
.
':'
.
$e
->
getMessage
()
.
PHP_EOL
,
'ERROR'
);
...
...
lib/Doctrine/ORM/Tools/Cli/AbstractPrinter.php
View file @
25be43c3
...
...
@@ -21,8 +21,6 @@
namespace
Doctrine\ORM\Tools\Cli
;
use
Doctrine\ORM\Tools\Cli\Style
;
abstract
class
AbstractPrinter
{
protected
$_stream
;
...
...
lib/Doctrine/ORM/Tools/Cli/AbstractTask.php
View file @
25be43c3
...
...
@@ -21,8 +21,6 @@
namespace
Doctrine\ORM\Tools\Cli
;
use
Doctrine\ORM\Tools\Cli\AbstractPrinter
;
abstract
class
AbstractTask
{
protected
$_printer
;
...
...
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