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
a3c09d4c
Commit
a3c09d4c
authored
Oct 07, 2009
by
jwage
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0] Adding better docs for some tasks
parent
a7d4e1e4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
4 deletions
+22
-4
Cli.php
lib/Doctrine/ORM/Tools/Cli.php
+3
-1
MappingTask.php
lib/Doctrine/ORM/Tools/Cli/Tasks/MappingTask.php
+0
-0
SchemaToolTask.php
lib/Doctrine/ORM/Tools/Cli/Tasks/SchemaToolTask.php
+19
-3
No files found.
lib/Doctrine/ORM/Tools/Cli.php
View file @
a3c09d4c
...
...
@@ -153,7 +153,7 @@ class Cli
$processedArgs
=
$this
->
_processArguments
(
$args
);
try
{
$this
->
_printer
->
writeln
(
'Doctrine Command Line Interface'
,
'HEADER'
);
$this
->
_printer
->
writeln
(
'Doctrine Command Line Interface'
.
PHP_EOL
,
'HEADER'
);
// Handle possible multiple tasks on a single command
foreach
(
$processedArgs
as
$taskData
)
{
...
...
@@ -177,7 +177,9 @@ class Cli
}
else
if
(
$this
->
_isTaskValid
(
$task
))
{
$task
->
run
();
}
else
{
$this
->
_printer
->
write
(
PHP_EOL
);
$task
->
basicHelp
();
// Fallback of not-valid task arguments
$this
->
_printer
->
write
(
PHP_EOL
);
}
}
else
{
throw
\Doctrine\Common\DoctrineException
::
taskDoesNotExist
(
$taskName
);
...
...
lib/Doctrine/ORM/Tools/Cli/Tasks/
Convert
MappingTask.php
→
lib/Doctrine/ORM/Tools/Cli/Tasks/MappingTask.php
View file @
a3c09d4c
File moved
lib/Doctrine/ORM/Tools/Cli/Tasks/SchemaToolTask.php
View file @
a3c09d4c
...
...
@@ -72,7 +72,11 @@ class SchemaToolTask extends AbstractTask
->
writeln
(
"
\t\t
Instead of try to apply generated SQLs into EntityManager, output them."
)
->
write
(
PHP_EOL
)
->
write
(
'--class-dir=<path>'
,
'OPT_ARG'
)
->
writeln
(
"
\t
Optional class directory to fetch for Entities."
);
->
writeln
(
"
\t
Optional class directory to fetch for Entities."
)
->
write
(
PHP_EOL
)
->
write
(
'--re-create'
,
'OPT_ARG'
)
->
writeln
(
"
\t\t
Runs --drop then --create to re-create the database."
)
->
write
(
PHP_EOL
);
}
/**
...
...
@@ -87,7 +91,8 @@ class SchemaToolTask extends AbstractTask
{
$printer
->
write
(
'schema-tool'
,
'KEYWORD'
)
->
write
(
' (--create | --drop | --update)'
,
'REQ_ARG'
)
->
writeln
(
' [--dump-sql] [--class-dir=<path>]'
,
'OPT_ARG'
);
->
write
(
' [--dump-sql] [--class-dir=<path>]'
,
'OPT_ARG'
)
->
writeln
(
' [--re-create]'
,
'OPT_ARG'
);
}
/**
...
...
@@ -105,6 +110,12 @@ class SchemaToolTask extends AbstractTask
if
(
!
$this
->
_requireEntityManager
())
{
return
false
;
}
if
(
array_key_exists
(
're-create'
,
$args
))
{
$args
[
'drop'
]
=
true
;
$args
[
'create'
]
=
true
;
$this
->
setArguments
(
$args
);
}
$isCreate
=
isset
(
$args
[
'create'
]);
$isDrop
=
isset
(
$args
[
'drop'
]);
...
...
@@ -114,6 +125,11 @@ class SchemaToolTask extends AbstractTask
$printer
->
writeln
(
"You can't use --update with --create or --drop"
,
'ERROR'
);
return
false
;
}
if
(
!
(
$isCreate
||
$isDrop
||
$isUpdate
))
{
$printer
->
writeln
(
'You must specify at a minimum one of the options (--create, --drop, --update, --re-create).'
,
'ERROR'
);
return
false
;
}
$metadataDriver
=
$this
->
_em
->
getConfiguration
()
->
getMetadataDriverImpl
();
if
(
$metadataDriver
instanceof
\Doctrine\ORM\Mapping\Driver\AnnotationDriver
)
{
...
...
@@ -135,7 +151,7 @@ class SchemaToolTask extends AbstractTask
public
function
run
()
{
$args
=
$this
->
getArguments
();
$isCreate
=
isset
(
$args
[
'create'
]);
$isDrop
=
isset
(
$args
[
'drop'
]);
$isUpdate
=
isset
(
$args
[
'update'
]);
...
...
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