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
4fa4d7a8
Commit
4fa4d7a8
authored
Sep 02, 2009
by
guilhermeblanco
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0] Added validation to RunSqlTask
parent
2e04cba8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
RunSqlTask.php
lib/Doctrine/ORM/Tools/Cli/Tasks/RunSqlTask.php
+23
-0
No files found.
lib/Doctrine/ORM/Tools/Cli/Tasks/RunSqlTask.php
View file @
4fa4d7a8
...
...
@@ -44,6 +44,29 @@ class RunSqlTask extends AbstractTask
->
writeln
(
' --file=<path> | --sql=<SQL>'
,
'INFO'
);
}
/**
* @inheritdoc
*/
public
function
validate
()
{
if
(
!
parent
::
validate
())
{
return
false
;
}
$args
=
$this
->
getArguments
();
$isSql
=
isset
(
$args
[
'sql'
]);
$isFile
=
isset
(
$args
[
'file'
]);
if
(
!
(
$isSql
^
$isFile
))
{
$printer
->
writeln
(
"One of --sql or --file required, and only one."
,
'ERROR'
);
return
false
;
}
return
true
;
}
/**
* Executes the task.
*/
...
...
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