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
203b46de
Commit
203b46de
authored
Sep 04, 2009
by
guilhermeblanco
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0] Changed stylish of CLI tasks. Added CLI documentation for SchemaTool task
parent
1557f4e1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
10 deletions
+43
-10
AnsiColorPrinter.php
lib/Doctrine/ORM/Tools/Cli/Printers/AnsiColorPrinter.php
+3
-1
RunSqlTask.php
lib/Doctrine/ORM/Tools/Cli/Tasks/RunSqlTask.php
+7
-4
SchemaToolTask.php
lib/Doctrine/ORM/Tools/Cli/Tasks/SchemaToolTask.php
+33
-5
No files found.
lib/Doctrine/ORM/Tools/Cli/Printers/AnsiColorPrinter.php
View file @
203b46de
...
...
@@ -42,12 +42,14 @@ class AnsiColorPrinter extends AbstractPrinter
protected
function
_initStyles
()
{
$this
->
addStyles
(
array
(
'HEADER'
=>
new
Style
(
'DEFAULT'
,
'DEFAULT'
,
array
(
'BOLD'
=>
true
)),
'ERROR'
=>
new
Style
(
'WHITE'
,
'RED'
,
array
(
'BOLD'
=>
true
)),
'WARNING'
=>
new
Style
(
'DEFAULT'
,
'YELLOW'
),
'KEYWORD'
=>
new
Style
(
'BLUE'
,
'DEFAULT'
,
array
(
'BOLD'
=>
true
)),
'REQ_ARG'
=>
new
Style
(
'MAGENTA'
,
'DEFAULT'
,
array
(
'BOLD'
=>
true
)),
'OPT_ARG'
=>
new
Style
(
'CYAN'
,
'DEFAULT'
,
array
(
'BOLD'
=>
true
)),
'INFO'
=>
new
Style
(
'GREEN'
,
'DEFAULT'
,
array
(
'BOLD'
=>
true
)),
'COMMENT'
=>
new
Style
(
'DEFAULT'
,
'MAGENTA'
),
'HEADER'
=>
new
Style
(
'DEFAULT'
,
'DEFAULT'
,
array
(
'BOLD'
=>
true
)),
'NONE'
=>
new
Style
(),
));
}
...
...
lib/Doctrine/ORM/Tools/Cli/Tasks/RunSqlTask.php
View file @
203b46de
...
...
@@ -24,10 +24,13 @@ class RunSqlTask extends AbstractTask
$printer
->
writeln
(
'Description: Executes arbitrary SQL from a file or directly from the command line.'
)
->
writeln
(
'Options:'
)
->
write
(
'--sql=<SQL>'
,
'
KEYWORD
'
)
->
write
(
'--sql=<SQL>'
,
'
REQ_ARG
'
)
->
writeln
(
"
\t
The SQL to execute."
)
->
write
(
'--file=<path>'
,
'KEYWORD'
)
->
writeln
(
"
\t
The path to the file with the SQL to execute."
);
->
writeln
(
"
\t\t
If defined, --file can not be requested on same task"
)
->
write
(
PHP_EOL
)
->
write
(
'--file=<path>'
,
'REQ_ARG'
)
->
writeln
(
"
\t
The path to the file with the SQL to execute."
)
->
writeln
(
"
\t\t
If defined, --sql can not be requested on same task"
);
}
/**
...
...
@@ -41,7 +44,7 @@ class RunSqlTask extends AbstractTask
private
function
_writeSynopsis
(
$printer
)
{
$printer
->
write
(
'run-sql'
,
'KEYWORD'
)
->
writeln
(
' (--file=<path> | --sql=<SQL>)'
,
'
INFO
'
);
->
writeln
(
' (--file=<path> | --sql=<SQL>)'
,
'
REQ_ARG
'
);
}
/**
...
...
lib/Doctrine/ORM/Tools/Cli/Tasks/SchemaToolTask.php
View file @
203b46de
...
...
@@ -42,7 +42,31 @@ class SchemaToolTask extends AbstractTask
*/
public
function
extendedHelp
()
{
$this
->
basicHelp
();
$printer
=
$this
->
getPrinter
();
$printer
->
write
(
'Task: '
)
->
writeln
(
'schema-tool'
,
'KEYWORD'
)
->
write
(
'Synopsis: '
);
$this
->
_writeSynopsis
(
$printer
);
$printer
->
writeln
(
'Description: Processes the schema and either apply it directly on EntityManager or generate the SQL output.'
)
->
writeln
(
'Options:'
)
->
write
(
'--create'
,
'REQ_ARG'
)
->
writeln
(
"
\t\t
Creates the schema in EntityManager (create tables on Database)"
)
->
writeln
(
"
\t\t\t
If defined, --drop and --update can not be requested on same task"
)
->
write
(
PHP_EOL
)
->
write
(
'--drop'
,
'REQ_ARG'
)
->
writeln
(
"
\t\t\t
Drops the schema of EntityManager (drop tables on Database)"
)
->
writeln
(
"
\t\t\t
If defined, --create and --update can not be requested on same task"
)
->
write
(
PHP_EOL
)
->
write
(
'--update'
,
'REQ_ARG'
)
->
writeln
(
"
\t\t
Updates the schema in EntityManager (update tables on Database)"
)
->
writeln
(
"
\t\t\t
If defined, --create and --drop can not be requested on same task"
)
->
write
(
PHP_EOL
)
->
write
(
'--dump-sql'
,
'OPT_ARG'
)
->
writeln
(
"
\t\t
Instead of try to apply generated SQLs into EntityManager, output them."
)
->
write
(
PHP_EOL
)
->
write
(
'--classdir=<path>'
,
'OPT_ARG'
)
->
writeln
(
"
\t
Optional class directory to fetch for Entities."
);
}
/**
...
...
@@ -50,10 +74,14 @@ class SchemaToolTask extends AbstractTask
*/
public
function
basicHelp
()
{
$this
->
getPrinter
()
->
write
(
'schema-tool'
,
'KEYWORD'
);
$this
->
getPrinter
()
->
writeln
(
' (--create | --drop | --update) [--dump-sql] [--classdir=<path>]'
,
'INFO'
);
$this
->
_writeSynopsis
(
$this
->
getPrinter
());
}
private
function
_writeSynopsis
(
$printer
)
{
$printer
->
write
(
'schema-tool'
,
'KEYWORD'
)
->
write
(
' (--create | --drop | --update)'
,
'REQ_ARG'
)
->
writeln
(
' [--dump-sql] [--classdir=<path>]'
,
'OPT_ARG'
);
}
/**
...
...
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