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
b2167985
Commit
b2167985
authored
Mar 24, 2010
by
guilhermeblanco
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0][DDC-274] Fixing Coding Standards for CLI tool.
parent
50c4e509
Changes
37
Hide whitespace changes
Inline
Side-by-side
Showing
37 changed files
with
155 additions
and
155 deletions
+155
-155
doctrine.php
bin/doctrine.php
+3
-3
AbstractNamespace.php
lib/Doctrine/Common/CLI/AbstractNamespace.php
+2
-2
CLIController.php
lib/Doctrine/Common/CLI/CLIController.php
+11
-11
CLIException.php
lib/Doctrine/Common/CLI/CLIException.php
+2
-2
Configuration.php
lib/Doctrine/Common/CLI/Configuration.php
+1
-1
Option.php
lib/Doctrine/Common/CLI/Option.php
+1
-1
OptionGroup.php
lib/Doctrine/Common/CLI/OptionGroup.php
+2
-2
AbstractPrinter.php
lib/Doctrine/Common/CLI/Printers/AbstractPrinter.php
+2
-2
AnsiColorPrinter.php
lib/Doctrine/Common/CLI/Printers/AnsiColorPrinter.php
+2
-2
NormalPrinter.php
lib/Doctrine/Common/CLI/Printers/NormalPrinter.php
+2
-2
Style.php
lib/Doctrine/Common/CLI/Style.php
+1
-1
TaskDocumentation.php
lib/Doctrine/Common/CLI/TaskDocumentation.php
+4
-4
TaskNamespace.php
lib/Doctrine/Common/CLI/TaskNamespace.php
+4
-4
AbstractTask.php
lib/Doctrine/Common/CLI/Tasks/AbstractTask.php
+3
-3
HelpTask.php
lib/Doctrine/Common/CLI/Tasks/HelpTask.php
+2
-2
VersionTask.php
lib/Doctrine/Common/CLI/Tasks/VersionTask.php
+1
-1
RunSqlTask.php
lib/Doctrine/DBAL/Tools/CLI/Tasks/RunSqlTask.php
+9
-9
VersionTask.php
lib/Doctrine/DBAL/Tools/CLI/Tasks/VersionTask.php
+2
-2
ClearCacheTask.php
lib/Doctrine/ORM/Tools/CLI/Tasks/ClearCacheTask.php
+9
-9
ConvertDoctrine1SchemaTask.php
...ctrine/ORM/Tools/CLI/Tasks/ConvertDoctrine1SchemaTask.php
+6
-6
ConvertMappingTask.php
lib/Doctrine/ORM/Tools/CLI/Tasks/ConvertMappingTask.php
+8
-8
EnsureProductionSettingsTask.php
...rine/ORM/Tools/CLI/Tasks/EnsureProductionSettingsTask.php
+4
-4
GenerateEntitiesTask.php
lib/Doctrine/ORM/Tools/CLI/Tasks/GenerateEntitiesTask.php
+7
-7
GenerateProxiesTask.php
lib/Doctrine/ORM/Tools/CLI/Tasks/GenerateProxiesTask.php
+7
-7
GenerateRepositoriesTask.php
...Doctrine/ORM/Tools/CLI/Tasks/GenerateRepositoriesTask.php
+6
-6
RunDqlTask.php
lib/Doctrine/ORM/Tools/CLI/Tasks/RunDqlTask.php
+10
-10
SchemaToolTask.php
lib/Doctrine/ORM/Tools/CLI/Tasks/SchemaToolTask.php
+10
-10
VersionTask.php
lib/Doctrine/ORM/Tools/CLI/Tasks/VersionTask.php
+2
-2
AllTests.php
tests/Doctrine/Tests/Common/AllTests.php
+1
-1
AllTests.php
tests/Doctrine/Tests/Common/CLI/AllTests.php
+7
-7
CLIControllerTest.php
tests/Doctrine/Tests/Common/CLI/CLIControllerTest.php
+12
-12
ConfigurationTest.php
tests/Doctrine/Tests/Common/CLI/ConfigurationTest.php
+2
-2
OptionGroupTest.php
tests/Doctrine/Tests/Common/CLI/OptionGroupTest.php
+4
-4
OptionTest.php
tests/Doctrine/Tests/Common/CLI/OptionTest.php
+2
-2
StyleTest.php
tests/Doctrine/Tests/Common/CLI/StyleTest.php
+2
-2
cli-config.php
tools/sandbox/cli-config.php
+1
-1
doctrine.php
tools/sandbox/doctrine.php
+1
-1
No files found.
bin/doctrine.php
View file @
b2167985
...
@@ -18,14 +18,14 @@ if (file_exists($configFile)) {
...
@@ -18,14 +18,14 @@ if (file_exists($configFile)) {
require
$configFile
;
require
$configFile
;
foreach
(
$GLOBALS
as
$configCandidate
)
{
foreach
(
$GLOBALS
as
$configCandidate
)
{
if
(
$configCandidate
instanceof
\Doctrine\Common\C
li
\Configuration
)
{
if
(
$configCandidate
instanceof
\Doctrine\Common\C
LI
\Configuration
)
{
$configuration
=
$configCandidate
;
$configuration
=
$configCandidate
;
break
;
break
;
}
}
}
}
}
}
$configuration
=
(
$configuration
)
?:
new
\Doctrine\Common\C
li
\Configuration
();
$configuration
=
(
$configuration
)
?:
new
\Doctrine\Common\C
LI
\Configuration
();
$cli
=
new
\Doctrine\Common\C
li\Cli
Controller
(
$configuration
);
$cli
=
new
\Doctrine\Common\C
LI\CLI
Controller
(
$configuration
);
$cli
->
run
(
$_SERVER
[
'argv'
]);
$cli
->
run
(
$_SERVER
[
'argv'
]);
\ No newline at end of file
lib/Doctrine/Common/C
li
/AbstractNamespace.php
→
lib/Doctrine/Common/C
LI
/AbstractNamespace.php
View file @
b2167985
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
* <http://www.doctrine-project.org>.
* <http://www.doctrine-project.org>.
*/
*/
namespace
Doctrine\Common\C
li
;
namespace
Doctrine\Common\C
LI
;
use
Doctrine\Common\Util\Inflector
;
use
Doctrine\Common\Util\Inflector
;
...
@@ -73,7 +73,7 @@ abstract class AbstractNamespace
...
@@ -73,7 +73,7 @@ abstract class AbstractNamespace
$name
=
self
::
formatName
(
$name
);
$name
=
self
::
formatName
(
$name
);
if
(
$this
->
hasNamespace
(
$name
))
{
if
(
$this
->
hasNamespace
(
$name
))
{
throw
C
li
Exception
::
cannotOverrideNamespace
(
$name
);
throw
C
LI
Exception
::
cannotOverrideNamespace
(
$name
);
}
}
return
$this
->
overrideNamespace
(
$name
);
return
$this
->
overrideNamespace
(
$name
);
...
...
lib/Doctrine/Common/C
li/Cli
Controller.php
→
lib/Doctrine/Common/C
LI/CLI
Controller.php
View file @
b2167985
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
* <http://www.doctrine-project.org>.
* <http://www.doctrine-project.org>.
*/
*/
namespace
Doctrine\Common\C
li
;
namespace
Doctrine\Common\C
LI
;
/**
/**
* Generic CLI Controller of Tasks execution
* Generic CLI Controller of Tasks execution
...
@@ -27,7 +27,7 @@ namespace Doctrine\Common\Cli;
...
@@ -27,7 +27,7 @@ namespace Doctrine\Common\Cli;
* To include a new Task support, create a task:
* To include a new Task support, create a task:
*
*
* [php]
* [php]
* class MyProject\Tools\C
li\Tasks\MyTask extends Doctrine\ORM\Tools\Cli
\Tasks\AbstractTask
* class MyProject\Tools\C
LI\Tasks\MyTask extends Doctrine\ORM\Tools\CLI
\Tasks\AbstractTask
* {
* {
* public function run();
* public function run();
* public function basicHelp();
* public function basicHelp();
...
@@ -38,9 +38,9 @@ namespace Doctrine\Common\Cli;
...
@@ -38,9 +38,9 @@ namespace Doctrine\Common\Cli;
* And then, load the namespace assoaicated an include the support to it in your command-line script:
* And then, load the namespace assoaicated an include the support to it in your command-line script:
*
*
* [php]
* [php]
* $cli = new Doctrine\Common\C
li\Cli
Controller();
* $cli = new Doctrine\Common\C
LI\CLI
Controller();
* $cliNS = $cli->getNamespace('custom');
* $cliNS = $cli->getNamespace('custom');
* $cliNS->addTask('myTask', 'MyProject\Tools\C
li
\Tasks\MyTask');
* $cliNS->addTask('myTask', 'MyProject\Tools\C
LI
\Tasks\MyTask');
*
*
* To execute, just type any classify-able name:
* To execute, just type any classify-able name:
*
*
...
@@ -55,7 +55,7 @@ namespace Doctrine\Common\Cli;
...
@@ -55,7 +55,7 @@ namespace Doctrine\Common\Cli;
* @author Jonathan Wage <jonwage@gmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
* @author Roman Borschel <roman@code-factory.org>
*/
*/
class
C
li
Controller
extends
AbstractNamespace
class
C
LI
Controller
extends
AbstractNamespace
{
{
/**
/**
* The CLI processor of tasks
* The CLI processor of tasks
...
@@ -69,12 +69,12 @@ class CliController extends AbstractNamespace
...
@@ -69,12 +69,12 @@ class CliController extends AbstractNamespace
$this
->
setConfiguration
(
$config
);
$this
->
setConfiguration
(
$config
);
// Include core namespaces of tasks
// Include core namespaces of tasks
$ns
=
'Doctrine\Common\C
li
\Tasks'
;
$ns
=
'Doctrine\Common\C
LI
\Tasks'
;
$this
->
addNamespace
(
'Core'
)
$this
->
addNamespace
(
'Core'
)
->
addTask
(
'help'
,
$ns
.
'\HelpTask'
)
->
addTask
(
'help'
,
$ns
.
'\HelpTask'
)
->
addTask
(
'version'
,
$ns
.
'\VersionTask'
);
->
addTask
(
'version'
,
$ns
.
'\VersionTask'
);
$ns
=
'Doctrine\ORM\Tools\C
li
\Tasks'
;
$ns
=
'Doctrine\ORM\Tools\C
LI
\Tasks'
;
$this
->
addNamespace
(
'Orm'
)
$this
->
addNamespace
(
'Orm'
)
->
addTask
(
'clear-cache'
,
$ns
.
'\ClearCacheTask'
)
->
addTask
(
'clear-cache'
,
$ns
.
'\ClearCacheTask'
)
->
addTask
(
'convert-mapping'
,
$ns
.
'\ConvertMappingTask'
)
->
addTask
(
'convert-mapping'
,
$ns
.
'\ConvertMappingTask'
)
...
@@ -87,7 +87,7 @@ class CliController extends AbstractNamespace
...
@@ -87,7 +87,7 @@ class CliController extends AbstractNamespace
->
addTask
(
'generate-entities'
,
$ns
.
'\GenerateEntitiesTask'
)
->
addTask
(
'generate-entities'
,
$ns
.
'\GenerateEntitiesTask'
)
->
addTask
(
'generate-repositories'
,
$ns
.
'\GenerateRepositoriesTask'
);
->
addTask
(
'generate-repositories'
,
$ns
.
'\GenerateRepositoriesTask'
);
$ns
=
'Doctrine\DBAL\Tools\C
li
\Tasks'
;
$ns
=
'Doctrine\DBAL\Tools\C
LI
\Tasks'
;
$this
->
addNamespace
(
'Dbal'
)
$this
->
addNamespace
(
'Dbal'
)
->
addTask
(
'run-sql'
,
$ns
.
'\RunSqlTask'
)
->
addTask
(
'run-sql'
,
$ns
.
'\RunSqlTask'
)
->
addTask
(
'version'
,
$ns
.
'\VersionTask'
);
->
addTask
(
'version'
,
$ns
.
'\VersionTask'
);
...
@@ -98,12 +98,12 @@ class CliController extends AbstractNamespace
...
@@ -98,12 +98,12 @@ class CliController extends AbstractNamespace
* Example of inclusion support to a single task:
* Example of inclusion support to a single task:
*
*
* [php]
* [php]
* $cli->addTask('my-custom-task', 'MyProject\C
li
\Tasks\MyCustomTask');
* $cli->addTask('my-custom-task', 'MyProject\C
LI
\Tasks\MyCustomTask');
*
*
* @param string $name CLI Task name
* @param string $name CLI Task name
* @param string $class CLI Task class (FQCN - Fully Qualified Class Name)
* @param string $class CLI Task class (FQCN - Fully Qualified Class Name)
*
*
* @return C
li
Controller This object instance
* @return C
LI
Controller This object instance
*/
*/
public
function
addTask
(
$name
,
$class
)
public
function
addTask
(
$name
,
$class
)
{
{
...
@@ -294,7 +294,7 @@ class CliController extends AbstractNamespace
...
@@ -294,7 +294,7 @@ class CliController extends AbstractNamespace
// If the given namespace returned "null", throw exception
// If the given namespace returned "null", throw exception
if
(
$taskNamespace
===
null
)
{
if
(
$taskNamespace
===
null
)
{
throw
C
li
Exception
::
namespaceDoesNotExist
(
$namespaceName
,
$currentNamespacePath
);
throw
C
LI
Exception
::
namespaceDoesNotExist
(
$namespaceName
,
$currentNamespacePath
);
}
}
$currentNamespacePath
=
((
!
empty
(
$currentNamespacePath
))
?
':'
:
''
)
$currentNamespacePath
=
((
!
empty
(
$currentNamespacePath
))
?
':'
:
''
)
...
...
lib/Doctrine/Common/C
li/Cli
Exception.php
→
lib/Doctrine/Common/C
LI/CLI
Exception.php
View file @
b2167985
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
* <http://www.doctrine-project.org>.
* <http://www.doctrine-project.org>.
*/
*/
namespace
Doctrine\Common\C
li
;
namespace
Doctrine\Common\C
LI
;
/**
/**
* CLI Exception class
* CLI Exception class
...
@@ -33,7 +33,7 @@ namespace Doctrine\Common\Cli;
...
@@ -33,7 +33,7 @@ namespace Doctrine\Common\Cli;
* @author Jonathan Wage <jonwage@gmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
* @author Roman Borschel <roman@code-factory.org>
*/
*/
class
C
liException
extends
\Doctrine\Common\Common
Exception
class
C
LIException
extends
\
Exception
{
{
public
static
function
namespaceDoesNotExist
(
$namespaceName
,
$namespacePath
=
''
)
public
static
function
namespaceDoesNotExist
(
$namespaceName
,
$namespacePath
=
''
)
{
{
...
...
lib/Doctrine/Common/C
li
/Configuration.php
→
lib/Doctrine/Common/C
LI
/Configuration.php
View file @
b2167985
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
* <http://www.doctrine-project.org>.
* <http://www.doctrine-project.org>.
*/
*/
namespace
Doctrine\Common\C
li
;
namespace
Doctrine\Common\C
LI
;
/**
/**
* CLI Configuration class
* CLI Configuration class
...
...
lib/Doctrine/Common/C
li
/Option.php
→
lib/Doctrine/Common/C
LI
/Option.php
View file @
b2167985
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
* <http://www.doctrine-project.org>.
* <http://www.doctrine-project.org>.
*/
*/
namespace
Doctrine\Common\C
li
;
namespace
Doctrine\Common\C
LI
;
/**
/**
* CLI Option definition
* CLI Option definition
...
...
lib/Doctrine/Common/C
li
/OptionGroup.php
→
lib/Doctrine/Common/C
LI
/OptionGroup.php
View file @
b2167985
...
@@ -19,9 +19,9 @@
...
@@ -19,9 +19,9 @@
* <http://www.doctrine-project.org>.
* <http://www.doctrine-project.org>.
*/
*/
namespace
Doctrine\Common\C
li
;
namespace
Doctrine\Common\C
LI
;
use
Doctrine\Common\C
li
\Printers\AbstractPrinter
;
use
Doctrine\Common\C
LI
\Printers\AbstractPrinter
;
/**
/**
* CLI Option Group definition
* CLI Option Group definition
...
...
lib/Doctrine/Common/C
li
/Printers/AbstractPrinter.php
→
lib/Doctrine/Common/C
LI
/Printers/AbstractPrinter.php
View file @
b2167985
...
@@ -19,9 +19,9 @@
...
@@ -19,9 +19,9 @@
* <http://www.doctrine-project.org>.
* <http://www.doctrine-project.org>.
*/
*/
namespace
Doctrine\Common\C
li
\Printers
;
namespace
Doctrine\Common\C
LI
\Printers
;
use
Doctrine\Common\C
li
\Style
;
use
Doctrine\Common\C
LI
\Style
;
/**
/**
* CLI Output Printer.
* CLI Output Printer.
...
...
lib/Doctrine/Common/C
li
/Printers/AnsiColorPrinter.php
→
lib/Doctrine/Common/C
LI
/Printers/AnsiColorPrinter.php
View file @
b2167985
...
@@ -19,9 +19,9 @@
...
@@ -19,9 +19,9 @@
* <http://www.doctrine-project.org>.
* <http://www.doctrine-project.org>.
*/
*/
namespace
Doctrine\Common\C
li
\Printers
;
namespace
Doctrine\Common\C
LI
\Printers
;
use
Doctrine\Common\C
li
\Style
;
use
Doctrine\Common\C
LI
\Style
;
/**
/**
* CLI Output Printer for ANSI Color terminal
* CLI Output Printer for ANSI Color terminal
...
...
lib/Doctrine/Common/C
li
/Printers/NormalPrinter.php
→
lib/Doctrine/Common/C
LI
/Printers/NormalPrinter.php
View file @
b2167985
...
@@ -19,9 +19,9 @@
...
@@ -19,9 +19,9 @@
* <http://www.doctrine-project.org>.
* <http://www.doctrine-project.org>.
*/
*/
namespace
Doctrine\Common\C
li
\Printers
;
namespace
Doctrine\Common\C
LI
\Printers
;
use
Doctrine\Common\C
li
\Style
;
use
Doctrine\Common\C
LI
\Style
;
/**
/**
* CLI Output Printer for Normal terminal
* CLI Output Printer for Normal terminal
...
...
lib/Doctrine/Common/C
li
/Style.php
→
lib/Doctrine/Common/C
LI
/Style.php
View file @
b2167985
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
* <http://www.doctrine-project.org>.
* <http://www.doctrine-project.org>.
*/
*/
namespace
Doctrine\Common\C
li
;
namespace
Doctrine\Common\C
LI
;
/**
/**
* CLI Output Style
* CLI Output Style
...
...
lib/Doctrine/Common/C
li
/TaskDocumentation.php
→
lib/Doctrine/Common/C
LI
/TaskDocumentation.php
View file @
b2167985
...
@@ -19,11 +19,11 @@
...
@@ -19,11 +19,11 @@
* <http://www.doctrine-project.org>.
* <http://www.doctrine-project.org>.
*/
*/
namespace
Doctrine\Common\C
li
;
namespace
Doctrine\Common\C
LI
;
use
Doctrine\Common\C
li
\Printers\AbstractPrinter
,
use
Doctrine\Common\C
LI
\Printers\AbstractPrinter
,
Doctrine\Common\C
li
\OptionGroup
,
Doctrine\Common\C
LI
\OptionGroup
,
Doctrine\Common\C
li
\Option
;
Doctrine\Common\C
LI
\Option
;
/**
/**
* CLI Task documentation
* CLI Task documentation
...
...
lib/Doctrine/Common/C
li
/TaskNamespace.php
→
lib/Doctrine/Common/C
LI
/TaskNamespace.php
View file @
b2167985
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
* <http://www.doctrine-project.org>.
* <http://www.doctrine-project.org>.
*/
*/
namespace
Doctrine\Common\C
li
;
namespace
Doctrine\Common\C
LI
;
/**
/**
* CLI Namespace class
* CLI Namespace class
...
@@ -81,7 +81,7 @@ class TaskNamespace extends AbstractNamespace
...
@@ -81,7 +81,7 @@ class TaskNamespace extends AbstractNamespace
return
new
$taskClass
(
$this
);
return
new
$taskClass
(
$this
);
}
}
throw
C
li
Exception
::
taskDoesNotExist
(
$name
,
$this
->
getFullName
());
throw
C
LI
Exception
::
taskDoesNotExist
(
$name
,
$this
->
getFullName
());
}
}
/**
/**
...
@@ -129,7 +129,7 @@ class TaskNamespace extends AbstractNamespace
...
@@ -129,7 +129,7 @@ class TaskNamespace extends AbstractNamespace
$name
=
self
::
formatName
(
$name
);
$name
=
self
::
formatName
(
$name
);
if
(
$this
->
hasTask
(
$name
))
{
if
(
$this
->
hasTask
(
$name
))
{
throw
C
li
Exception
::
cannotOverrideTask
(
$name
);
throw
C
LI
Exception
::
cannotOverrideTask
(
$name
);
}
}
return
$this
->
overrideTask
(
$name
,
$class
);
return
$this
->
overrideTask
(
$name
,
$class
);
...
@@ -228,7 +228,7 @@ class TaskNamespace extends AbstractNamespace
...
@@ -228,7 +228,7 @@ class TaskNamespace extends AbstractNamespace
}
else
if
(
$task
->
validate
())
{
}
else
if
(
$task
->
validate
())
{
$task
->
run
();
$task
->
run
();
}
}
}
catch
(
C
li
Exception
$e
)
{
}
catch
(
C
LI
Exception
$e
)
{
$message
=
$this
->
getFullName
()
.
':'
.
$name
.
' => '
.
$e
->
getMessage
();
$message
=
$this
->
getFullName
()
.
':'
.
$name
.
' => '
.
$e
->
getMessage
();
$printer
=
$this
->
getPrinter
();
$printer
=
$this
->
getPrinter
();
...
...
lib/Doctrine/Common/C
li
/Tasks/AbstractTask.php
→
lib/Doctrine/Common/C
LI
/Tasks/AbstractTask.php
View file @
b2167985
...
@@ -19,10 +19,10 @@
...
@@ -19,10 +19,10 @@
* <http://www.doctrine-project.org>.
* <http://www.doctrine-project.org>.
*/
*/
namespace
Doctrine\Common\C
li
\Tasks
;
namespace
Doctrine\Common\C
LI
\Tasks
;
use
Doctrine\Common\C
li
\AbstractNamespace
,
use
Doctrine\Common\C
LI
\AbstractNamespace
,
Doctrine\Common\C
li
\TaskDocumentation
;
Doctrine\Common\C
LI
\TaskDocumentation
;
/**
/**
* Base class for CLI Tasks.
* Base class for CLI Tasks.
...
...
lib/Doctrine/Common/C
li
/Tasks/HelpTask.php
→
lib/Doctrine/Common/C
LI
/Tasks/HelpTask.php
View file @
b2167985
...
@@ -19,9 +19,9 @@
...
@@ -19,9 +19,9 @@
* <http://www.doctrine-project.org>.
* <http://www.doctrine-project.org>.
*/
*/
namespace
Doctrine\Common\C
li
\Tasks
;
namespace
Doctrine\Common\C
LI
\Tasks
;
use
Doctrine\Common\C
li\Cli
Exception
;
use
Doctrine\Common\C
LI\CLI
Exception
;
/**
/**
* CLI Task to display available commands help
* CLI Task to display available commands help
...
...
lib/Doctrine/Common/C
li
/Tasks/VersionTask.php
→
lib/Doctrine/Common/C
LI
/Tasks/VersionTask.php
View file @
b2167985
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
* <http://www.doctrine-project.org>.
* <http://www.doctrine-project.org>.
*/
*/
namespace
Doctrine\Common\C
li
\Tasks
;
namespace
Doctrine\Common\C
LI
\Tasks
;
use
Doctrine\Common\Version
;
use
Doctrine\Common\Version
;
...
...
lib/Doctrine/DBAL/Tools/C
li
/Tasks/RunSqlTask.php
→
lib/Doctrine/DBAL/Tools/C
LI
/Tasks/RunSqlTask.php
View file @
b2167985
...
@@ -19,13 +19,13 @@
...
@@ -19,13 +19,13 @@
* <http://www.doctrine-project.org>.
* <http://www.doctrine-project.org>.
*/
*/
namespace
Doctrine\DBAL\Tools\C
li
\Tasks
;
namespace
Doctrine\DBAL\Tools\C
LI
\Tasks
;
use
Doctrine\Common\C
li
\Tasks\AbstractTask
,
use
Doctrine\Common\C
LI
\Tasks\AbstractTask
,
Doctrine\Common\C
li\Cli
Exception
,
Doctrine\Common\C
LI\CLI
Exception
,
Doctrine\Common\Util\Debug
,
Doctrine\Common\Util\Debug
,
Doctrine\Common\C
li
\Option
,
Doctrine\Common\C
LI
\Option
,
Doctrine\Common\C
li
\OptionGroup
;
Doctrine\Common\C
LI
\OptionGroup
;
/**
/**
* Task for executing arbitrary SQL that can come from a file or directly from
* Task for executing arbitrary SQL that can come from a file or directly from
...
@@ -78,13 +78,13 @@ class RunSqlTask extends AbstractTask
...
@@ -78,13 +78,13 @@ class RunSqlTask extends AbstractTask
$em
=
$this
->
getConfiguration
()
->
getAttribute
(
'em'
);
$em
=
$this
->
getConfiguration
()
->
getAttribute
(
'em'
);
if
(
$em
===
null
)
{
if
(
$em
===
null
)
{
throw
new
C
li
Exception
(
throw
new
C
LI
Exception
(
"Attribute 'em' of CLI Configuration is not defined or it is not a valid EntityManager."
"Attribute 'em' of CLI Configuration is not defined or it is not a valid EntityManager."
);
);
}
}
if
(
!
(
isset
(
$arguments
[
'sql'
])
^
isset
(
$arguments
[
'file'
])))
{
if
(
!
(
isset
(
$arguments
[
'sql'
])
^
isset
(
$arguments
[
'file'
])))
{
throw
new
C
li
Exception
(
'One of --sql or --file required, and only one.'
);
throw
new
C
LI
Exception
(
'One of --sql or --file required, and only one.'
);
}
}
return
true
;
return
true
;
...
@@ -107,9 +107,9 @@ class RunSqlTask extends AbstractTask
...
@@ -107,9 +107,9 @@ class RunSqlTask extends AbstractTask
foreach
(
$fileNames
as
$fileName
)
{
foreach
(
$fileNames
as
$fileName
)
{
if
(
!
file_exists
(
$fileName
))
{
if
(
!
file_exists
(
$fileName
))
{
throw
new
C
li
Exception
(
sprintf
(
'The SQL file [%s] does not exist.'
,
$fileName
));
throw
new
C
LI
Exception
(
sprintf
(
'The SQL file [%s] does not exist.'
,
$fileName
));
}
else
if
(
!
is_readable
(
$fileName
))
{
}
else
if
(
!
is_readable
(
$fileName
))
{
throw
new
C
li
Exception
(
sprintf
(
'The SQL file [%s] does not have read permissions.'
,
$fileName
));
throw
new
C
LI
Exception
(
sprintf
(
'The SQL file [%s] does not have read permissions.'
,
$fileName
));
}
}
$printer
->
write
(
'Processing file ['
.
$fileName
.
']... '
);
$printer
->
write
(
'Processing file ['
.
$fileName
.
']... '
);
...
...
lib/Doctrine/DBAL/Tools/C
li
/Tasks/VersionTask.php
→
lib/Doctrine/DBAL/Tools/C
LI
/Tasks/VersionTask.php
View file @
b2167985
...
@@ -19,9 +19,9 @@
...
@@ -19,9 +19,9 @@
* <http://www.doctrine-project.org>.
* <http://www.doctrine-project.org>.
*/
*/
namespace
Doctrine\DBAL\Tools\C
li
\Tasks
;
namespace
Doctrine\DBAL\Tools\C
LI
\Tasks
;
use
Doctrine\Common\C
li
\Tasks\AbstractTask
,
use
Doctrine\Common\C
LI
\Tasks\AbstractTask
,
Doctrine\Common\Version
;
Doctrine\Common\Version
;
/**
/**
...
...
lib/Doctrine/ORM/Tools/C
li
/Tasks/ClearCacheTask.php
→
lib/Doctrine/ORM/Tools/C
LI
/Tasks/ClearCacheTask.php
View file @
b2167985
...
@@ -19,12 +19,12 @@
...
@@ -19,12 +19,12 @@
* <http://www.doctrine-project.org>.
* <http://www.doctrine-project.org>.
*/
*/
namespace
Doctrine\ORM\Tools\C
li
\Tasks
;
namespace
Doctrine\ORM\Tools\C
LI
\Tasks
;
use
Doctrine\Common\C
li
\Tasks\AbstractTask
,
use
Doctrine\Common\C
LI
\Tasks\AbstractTask
,
Doctrine\Common\C
li
\CliException
,
Doctrine\Common\C
LI
\CliException
,
Doctrine\Common\C
li
\Option
,
Doctrine\Common\C
LI
\Option
,
Doctrine\Common\C
li
\OptionGroup
,
Doctrine\Common\C
LI
\OptionGroup
,
Doctrine\Common\Cache\AbstractDriver
;
Doctrine\Common\Cache\AbstractDriver
;
/**
/**
...
@@ -79,7 +79,7 @@ class ClearCacheTask extends AbstractTask
...
@@ -79,7 +79,7 @@ class ClearCacheTask extends AbstractTask
$em
=
$this
->
getConfiguration
()
->
getAttribute
(
'em'
);
$em
=
$this
->
getConfiguration
()
->
getAttribute
(
'em'
);
if
(
$em
===
null
)
{
if
(
$em
===
null
)
{
throw
new
C
li
Exception
(
throw
new
C
LI
Exception
(
"Attribute 'em' of CLI Configuration is not defined or it is not a valid EntityManager."
"Attribute 'em' of CLI Configuration is not defined or it is not a valid EntityManager."
);
);
}
}
...
@@ -90,7 +90,7 @@ class ClearCacheTask extends AbstractTask
...
@@ -90,7 +90,7 @@ class ClearCacheTask extends AbstractTask
(
isset
(
$arguments
[
'query'
])
||
isset
(
$arguments
[
'metadata'
]))
&&
(
isset
(
$arguments
[
'id'
])
||
(
isset
(
$arguments
[
'query'
])
||
isset
(
$arguments
[
'metadata'
]))
&&
(
isset
(
$arguments
[
'id'
])
||
isset
(
$arguments
[
'regex'
])
||
isset
(
$arguments
[
'prefix'
])
||
isset
(
$arguments
[
'suffix'
]))
isset
(
$arguments
[
'regex'
])
||
isset
(
$arguments
[
'prefix'
])
||
isset
(
$arguments
[
'suffix'
]))
)
{
)
{
throw
new
C
li
Exception
(
throw
new
C
LI
Exception
(
'When clearing the query or metadata cache do not '
.
'When clearing the query or metadata cache do not '
.
'specify any --id, --regex, --prefix or --suffix.'
'specify any --id, --regex, --prefix or --suffix.'
);
);
...
@@ -148,7 +148,7 @@ class ClearCacheTask extends AbstractTask
...
@@ -148,7 +148,7 @@ class ClearCacheTask extends AbstractTask
$printer
=
$this
->
getPrinter
();
$printer
=
$this
->
getPrinter
();
if
(
!
$cacheDriver
)
{
if
(
!
$cacheDriver
)
{
throw
new
C
li
Exception
(
'No driver has been configured for the '
.
$type
.
' cache.'
);
throw
new
C
LI
Exception
(
'No driver has been configured for the '
.
$type
.
' cache.'
);
}
}
if
(
$id
)
{
if
(
$id
)
{
...
@@ -197,7 +197,7 @@ class ClearCacheTask extends AbstractTask
...
@@ -197,7 +197,7 @@ class ClearCacheTask extends AbstractTask
$printer
->
writeln
(
' - '
.
$id
);
$printer
->
writeln
(
' - '
.
$id
);
}
}
}
else
{
}
else
{
throw
new
C
li
Exception
(
'No '
.
$type
.
' cache entries found.'
);
throw
new
C
LI
Exception
(
'No '
.
$type
.
' cache entries found.'
);
}
}
$printer
->
write
(
PHP_EOL
);
$printer
->
write
(
PHP_EOL
);
...
...
lib/Doctrine/ORM/Tools/C
li
/Tasks/ConvertDoctrine1SchemaTask.php
→
lib/Doctrine/ORM/Tools/C
LI
/Tasks/ConvertDoctrine1SchemaTask.php
View file @
b2167985
...
@@ -19,13 +19,13 @@
...
@@ -19,13 +19,13 @@
* <http://www.doctrine-project.org>.
* <http://www.doctrine-project.org>.
*/
*/
namespace
Doctrine\ORM\Tools\C
li
\Tasks
;
namespace
Doctrine\ORM\Tools\C
LI
\Tasks
;
use
Doctrine\Common\C
li
\Tasks\AbstractTask
,
use
Doctrine\Common\C
LI
\Tasks\AbstractTask
,
Doctrine\ORM\Tools\Export\ClassMetadataExporter
,
Doctrine\ORM\Tools\Export\ClassMetadataExporter
,
Doctrine\Common\C
li
\CliException
,
Doctrine\Common\C
LI
\CliException
,
Doctrine\Common\C
li
\Option
,
Doctrine\Common\C
LI
\Option
,
Doctrine\Common\C
li
\OptionGroup
,
Doctrine\Common\C
LI
\OptionGroup
,
Doctrine\ORM\Tools\ConvertDoctrine1Schema
,
Doctrine\ORM\Tools\ConvertDoctrine1Schema
,
Doctrine\ORM\Tools\EntityGenerator
;
Doctrine\ORM\Tools\EntityGenerator
;
...
@@ -70,7 +70,7 @@ class ConvertDoctrine1SchemaTask extends AbstractTask
...
@@ -70,7 +70,7 @@ class ConvertDoctrine1SchemaTask extends AbstractTask
$em
=
$this
->
getConfiguration
()
->
getAttribute
(
'em'
);
$em
=
$this
->
getConfiguration
()
->
getAttribute
(
'em'
);
if
(
!
isset
(
$arguments
[
'from'
])
||
!
isset
(
$arguments
[
'to'
])
||
!
isset
(
$arguments
[
'dest'
]))
{
if
(
!
isset
(
$arguments
[
'from'
])
||
!
isset
(
$arguments
[
'to'
])
||
!
isset
(
$arguments
[
'dest'
]))
{
throw
new
C
li
Exception
(
'You must specify a value for --from, --to and --dest'
);
throw
new
C
LI
Exception
(
'You must specify a value for --from, --to and --dest'
);
}
}
return
true
;
return
true
;
...
...
lib/Doctrine/ORM/Tools/C
li
/Tasks/ConvertMappingTask.php
→
lib/Doctrine/ORM/Tools/C
LI
/Tasks/ConvertMappingTask.php
View file @
b2167985
...
@@ -19,12 +19,12 @@
...
@@ -19,12 +19,12 @@
* <http://www.doctrine-project.org>.
* <http://www.doctrine-project.org>.
*/
*/
namespace
Doctrine\ORM\Tools\C
li
\Tasks
;
namespace
Doctrine\ORM\Tools\C
LI
\Tasks
;
use
Doctrine\Common\C
li
\Tasks\AbstractTask
,
use
Doctrine\Common\C
LI
\Tasks\AbstractTask
,
Doctrine\Common\C
li
\CliException
,
Doctrine\Common\C
LI
\CliException
,
Doctrine\Common\C
li
\Option
,
Doctrine\Common\C
LI
\Option
,
Doctrine\Common\C
li
\OptionGroup
,
Doctrine\Common\C
LI
\OptionGroup
,
Doctrine\ORM\Tools\Export\ClassMetadataExporter
,
Doctrine\ORM\Tools\Export\ClassMetadataExporter
,
Doctrine\ORM\Mapping\Driver\DriverChain
,
Doctrine\ORM\Mapping\Driver\DriverChain
,
Doctrine\ORM\Mapping\Driver\AnnotationDriver
,
Doctrine\ORM\Mapping\Driver\AnnotationDriver
,
...
@@ -78,13 +78,13 @@ class ConvertMappingTask extends AbstractTask
...
@@ -78,13 +78,13 @@ class ConvertMappingTask extends AbstractTask
}
}
if
(
!
(
isset
(
$arguments
[
'from'
])
&&
isset
(
$arguments
[
'to'
])
&&
isset
(
$arguments
[
'dest'
])))
{
if
(
!
(
isset
(
$arguments
[
'from'
])
&&
isset
(
$arguments
[
'to'
])
&&
isset
(
$arguments
[
'dest'
])))
{
throw
new
C
li
Exception
(
throw
new
C
LI
Exception
(
'You must include a value for all three options: --from, --to and --dest.'
'You must include a value for all three options: --from, --to and --dest.'
);
);
}
}
if
(
strtolower
(
$arguments
[
'to'
])
!=
'annotation'
&&
isset
(
$arguments
[
'extend'
]))
{
if
(
strtolower
(
$arguments
[
'to'
])
!=
'annotation'
&&
isset
(
$arguments
[
'extend'
]))
{
throw
new
C
li
Exception
(
throw
new
C
LI
Exception
(
'You can only use the --extend argument when converting to annotations.'
'You can only use the --extend argument when converting to annotations.'
);
);
}
}
...
@@ -94,7 +94,7 @@ class ConvertMappingTask extends AbstractTask
...
@@ -94,7 +94,7 @@ class ConvertMappingTask extends AbstractTask
$em
=
$this
->
getConfiguration
()
->
getAttribute
(
'em'
);
$em
=
$this
->
getConfiguration
()
->
getAttribute
(
'em'
);
if
(
$em
===
null
)
{
if
(
$em
===
null
)
{
throw
new
C
li
Exception
(
throw
new
C
LI
Exception
(
"Attribute 'em' of CLI Configuration is not defined or it is not a valid EntityManager."
"Attribute 'em' of CLI Configuration is not defined or it is not a valid EntityManager."
);
);
}
}
...
...
lib/Doctrine/ORM/Tools/C
li
/Tasks/EnsureProductionSettingsTask.php
→
lib/Doctrine/ORM/Tools/C
LI
/Tasks/EnsureProductionSettingsTask.php
View file @
b2167985
...
@@ -19,10 +19,10 @@
...
@@ -19,10 +19,10 @@
* <http://www.doctrine-project.org>.
* <http://www.doctrine-project.org>.
*/
*/
namespace
Doctrine\ORM\Tools\C
li
\Tasks
;
namespace
Doctrine\ORM\Tools\C
LI
\Tasks
;
use
Doctrine\Common\C
li
\Tasks\AbstractTask
,
use
Doctrine\Common\C
LI
\Tasks\AbstractTask
,
Doctrine\Common\C
li\Cli
Exception
;
Doctrine\Common\C
LI\CLI
Exception
;
/**
/**
* CLI Task to ensure that Doctrine is properly configured for a production environment.
* CLI Task to ensure that Doctrine is properly configured for a production environment.
...
@@ -57,7 +57,7 @@ class EnsureProductionSettingsTask extends AbstractTask
...
@@ -57,7 +57,7 @@ class EnsureProductionSettingsTask extends AbstractTask
$em
=
$this
->
getConfiguration
()
->
getAttribute
(
'em'
);
$em
=
$this
->
getConfiguration
()
->
getAttribute
(
'em'
);
if
(
$em
===
null
)
{
if
(
$em
===
null
)
{
throw
new
C
li
Exception
(
throw
new
C
LI
Exception
(
"Attribute 'em' of CLI Configuration is not defined or it is not a valid EntityManager."
"Attribute 'em' of CLI Configuration is not defined or it is not a valid EntityManager."
);
);
}
}
...
...
lib/Doctrine/ORM/Tools/C
li
/Tasks/GenerateEntitiesTask.php
→
lib/Doctrine/ORM/Tools/C
LI
/Tasks/GenerateEntitiesTask.php
View file @
b2167985
...
@@ -19,12 +19,12 @@
...
@@ -19,12 +19,12 @@
* <http://www.doctrine-project.org>.
* <http://www.doctrine-project.org>.
*/
*/
namespace
Doctrine\ORM\Tools\C
li
\Tasks
;
namespace
Doctrine\ORM\Tools\C
LI
\Tasks
;
use
Doctrine\Common\C
li
\Tasks\AbstractTask
,
use
Doctrine\Common\C
LI
\Tasks\AbstractTask
,
Doctrine\Common\C
li
\Option
,
Doctrine\Common\C
LI
\Option
,
Doctrine\Common\C
li
\OptionGroup
,
Doctrine\Common\C
LI
\OptionGroup
,
Doctrine\Common\C
li\Cli
Exception
,
Doctrine\Common\C
LI\CLI
Exception
,
Doctrine\ORM\Tools\EntityGenerator
,
Doctrine\ORM\Tools\EntityGenerator
,
Doctrine\ORM\Tools\ClassMetadataReader
;
Doctrine\ORM\Tools\ClassMetadataReader
;
...
@@ -67,7 +67,7 @@ class GenerateEntitiesTask extends AbstractTask
...
@@ -67,7 +67,7 @@ class GenerateEntitiesTask extends AbstractTask
$arguments
=
$this
->
getArguments
();
$arguments
=
$this
->
getArguments
();
if
(
!
isset
(
$arguments
[
'from'
])
||
!
isset
(
$arguments
[
'dest'
]))
{
if
(
!
isset
(
$arguments
[
'from'
])
||
!
isset
(
$arguments
[
'dest'
]))
{
throw
new
C
li
Exception
(
'You must specify a value for --from and --dest'
);
throw
new
C
LI
Exception
(
'You must specify a value for --from and --dest'
);
}
}
return
true
;
return
true
;
...
@@ -110,7 +110,7 @@ class GenerateEntitiesTask extends AbstractTask
...
@@ -110,7 +110,7 @@ class GenerateEntitiesTask extends AbstractTask
$entityGenerator
->
generate
(
$metadatas
,
$dest
);
$entityGenerator
->
generate
(
$metadatas
,
$dest
);
$printer
->
write
ln
(
''
);
$printer
->
write
(
PHP_EOL
);
$printer
->
writeln
(
$printer
->
writeln
(
sprintf
(
'Entity classes generated to "%s"'
,
sprintf
(
'Entity classes generated to "%s"'
,
$printer
->
format
(
$dest
,
'KEYWORD'
)
$printer
->
format
(
$dest
,
'KEYWORD'
)
...
...
lib/Doctrine/ORM/Tools/C
li
/Tasks/GenerateProxiesTask.php
→
lib/Doctrine/ORM/Tools/C
LI
/Tasks/GenerateProxiesTask.php
View file @
b2167985
<?php
<?php
namespace
Doctrine\ORM\Tools\C
li
\Tasks
;
namespace
Doctrine\ORM\Tools\C
LI
\Tasks
;
use
Doctrine\Common\C
li
\Tasks\AbstractTask
,
use
Doctrine\Common\C
LI
\Tasks\AbstractTask
,
Doctrine\Common\C
li\Cli
Exception
,
Doctrine\Common\C
LI\CLI
Exception
,
Doctrine\Common\C
li
\Option
,
Doctrine\Common\C
LI
\Option
,
Doctrine\Common\C
li
\OptionGroup
;
Doctrine\Common\C
LI
\OptionGroup
;
/**
/**
* Task to (re)generate the proxy classes used by doctrine.
* Task to (re)generate the proxy classes used by doctrine.
...
@@ -50,7 +50,7 @@ class GenerateProxiesTask extends AbstractTask
...
@@ -50,7 +50,7 @@ class GenerateProxiesTask extends AbstractTask
$em
=
$this
->
getConfiguration
()
->
getAttribute
(
'em'
);
$em
=
$this
->
getConfiguration
()
->
getAttribute
(
'em'
);
if
(
$em
===
null
)
{
if
(
$em
===
null
)
{
throw
new
C
li
Exception
(
throw
new
C
LI
Exception
(
"Attribute 'em' of CLI Configuration is not defined or it is not a valid EntityManager."
"Attribute 'em' of CLI Configuration is not defined or it is not a valid EntityManager."
);
);
}
}
...
@@ -61,7 +61,7 @@ class GenerateProxiesTask extends AbstractTask
...
@@ -61,7 +61,7 @@ class GenerateProxiesTask extends AbstractTask
if
(
isset
(
$arguments
[
'class-dir'
]))
{
if
(
isset
(
$arguments
[
'class-dir'
]))
{
$metadataDriver
->
addPaths
((
array
)
$arguments
[
'class-dir'
]);
$metadataDriver
->
addPaths
((
array
)
$arguments
[
'class-dir'
]);
}
else
{
}
else
{
throw
new
C
li
Exception
(
throw
new
C
LI
Exception
(
'The supplied configuration uses the annotation metadata driver. '
.
'The supplied configuration uses the annotation metadata driver. '
.
"The 'class-dir' argument is required for this driver."
"The 'class-dir' argument is required for this driver."
);
);
...
...
lib/Doctrine/ORM/Tools/C
li
/Tasks/GenerateRepositoriesTask.php
→
lib/Doctrine/ORM/Tools/C
LI
/Tasks/GenerateRepositoriesTask.php
View file @
b2167985
...
@@ -19,12 +19,12 @@
...
@@ -19,12 +19,12 @@
* <http://www.doctrine-project.org>.
* <http://www.doctrine-project.org>.
*/
*/
namespace
Doctrine\ORM\Tools\C
li
\Tasks
;
namespace
Doctrine\ORM\Tools\C
LI
\Tasks
;
use
Doctrine\Common\C
li
\Tasks\AbstractTask
,
use
Doctrine\Common\C
LI
\Tasks\AbstractTask
,
Doctrine\Common\C
li
\Option
,
Doctrine\Common\C
LI
\Option
,
Doctrine\Common\C
li
\OptionGroup
,
Doctrine\Common\C
LI
\OptionGroup
,
Doctrine\Common\C
li\Cli
Exception
,
Doctrine\Common\C
LI\CLI
Exception
,
Doctrine\ORM\Tools\ClassMetadataReader
;
Doctrine\ORM\Tools\ClassMetadataReader
;
/**
/**
...
@@ -84,7 +84,7 @@ class <className> extends EntityRepository
...
@@ -84,7 +84,7 @@ class <className> extends EntityRepository
$em
=
$this
->
getConfiguration
()
->
getAttribute
(
'em'
);
$em
=
$this
->
getConfiguration
()
->
getAttribute
(
'em'
);
if
(
!
isset
(
$arguments
[
'from'
])
||
!
isset
(
$arguments
[
'dest'
]))
{
if
(
!
isset
(
$arguments
[
'from'
])
||
!
isset
(
$arguments
[
'dest'
]))
{
throw
new
C
li
Exception
(
'You must specify a value for --from and --dest'
);
throw
new
C
LI
Exception
(
'You must specify a value for --from and --dest'
);
}
}
return
true
;
return
true
;
...
...
lib/Doctrine/ORM/Tools/C
li
/Tasks/RunDqlTask.php
→
lib/Doctrine/ORM/Tools/C
LI
/Tasks/RunDqlTask.php
View file @
b2167985
...
@@ -19,13 +19,13 @@
...
@@ -19,13 +19,13 @@
* <http://www.doctrine-project.org>.
* <http://www.doctrine-project.org>.
*/
*/
namespace
Doctrine\ORM\Tools\C
li
\Tasks
;
namespace
Doctrine\ORM\Tools\C
LI
\Tasks
;
use
Doctrine\Common\C
li
\Tasks\AbstractTask
,
use
Doctrine\Common\C
LI
\Tasks\AbstractTask
,
Doctrine\Common\C
li\Cli
Exception
,
Doctrine\Common\C
LI\CLI
Exception
,
Doctrine\Common\Util\Debug
,
Doctrine\Common\Util\Debug
,
Doctrine\Common\C
li
\Option
,
Doctrine\Common\C
LI
\Option
,
Doctrine\Common\C
li
\OptionGroup
,
Doctrine\Common\C
LI
\OptionGroup
,
Doctrine\ORM\Query
;
Doctrine\ORM\Query
;
/**
/**
...
@@ -90,29 +90,29 @@ class RunDqlTask extends AbstractTask
...
@@ -90,29 +90,29 @@ class RunDqlTask extends AbstractTask
$em
=
$this
->
getConfiguration
()
->
getAttribute
(
'em'
);
$em
=
$this
->
getConfiguration
()
->
getAttribute
(
'em'
);
if
(
$em
===
null
)
{
if
(
$em
===
null
)
{
throw
new
C
li
Exception
(
throw
new
C
LI
Exception
(
"Attribute 'em' of CLI Configuration is not defined or it is not a valid EntityManager."
"Attribute 'em' of CLI Configuration is not defined or it is not a valid EntityManager."
);
);
}
}
if
(
!
isset
(
$arguments
[
'dql'
]))
{
if
(
!
isset
(
$arguments
[
'dql'
]))
{
throw
new
C
li
Exception
(
'Argument --dql must be defined.'
);
throw
new
C
LI
Exception
(
'Argument --dql must be defined.'
);
}
}
if
(
isset
(
$arguments
[
'hydrate'
]))
{
if
(
isset
(
$arguments
[
'hydrate'
]))
{
$hydrationModeName
=
'Doctrine\ORM\Query::HYDRATE_'
.
strtoupper
(
str_replace
(
'-'
,
'_'
,
$arguments
[
'hydrate'
]));
$hydrationModeName
=
'Doctrine\ORM\Query::HYDRATE_'
.
strtoupper
(
str_replace
(
'-'
,
'_'
,
$arguments
[
'hydrate'
]));
if
(
!
defined
(
$hydrationModeName
))
{
if
(
!
defined
(
$hydrationModeName
))
{
throw
new
C
li
Exception
(
"Argument --hydrate must be either 'object', 'array', 'scalar' or 'single-scalar'."
);
throw
new
C
LI
Exception
(
"Argument --hydrate must be either 'object', 'array', 'scalar' or 'single-scalar'."
);
}
}
}
}
if
(
isset
(
$arguments
[
'first-result'
])
&&
!
ctype_digit
(
$arguments
[
'first-result'
]))
{
if
(
isset
(
$arguments
[
'first-result'
])
&&
!
ctype_digit
(
$arguments
[
'first-result'
]))
{
throw
new
C
li
Exception
(
'Argument --first-result must be an integer value.'
);
throw
new
C
LI
Exception
(
'Argument --first-result must be an integer value.'
);
}
}
if
(
isset
(
$arguments
[
'max-results'
])
&&
!
ctype_digit
(
$arguments
[
'max-results'
]))
{
if
(
isset
(
$arguments
[
'max-results'
])
&&
!
ctype_digit
(
$arguments
[
'max-results'
]))
{
throw
new
C
li
Exception
(
'Argument --max-results must be an integer value.'
);
throw
new
C
LI
Exception
(
'Argument --max-results must be an integer value.'
);
}
}
return
true
;
return
true
;
...
...
lib/Doctrine/ORM/Tools/C
li
/Tasks/SchemaToolTask.php
→
lib/Doctrine/ORM/Tools/C
LI
/Tasks/SchemaToolTask.php
View file @
b2167985
<?php
<?php
namespace
Doctrine\ORM\Tools\C
li
\Tasks
;
namespace
Doctrine\ORM\Tools\C
LI
\Tasks
;
use
Doctrine\Common\C
li
\Tasks\AbstractTask
,
use
Doctrine\Common\C
LI
\Tasks\AbstractTask
,
Doctrine\Common\C
li\Cli
Exception
,
Doctrine\Common\C
LI\CLI
Exception
,
Doctrine\Common\C
li
\Option
,
Doctrine\Common\C
LI
\Option
,
Doctrine\Common\C
li
\OptionGroup
,
Doctrine\Common\C
LI
\OptionGroup
,
Doctrine\ORM\Tools\SchemaTool
,
Doctrine\ORM\Tools\SchemaTool
,
Doctrine\Common\Annotations\AnnotationReader
,
Doctrine\Common\Annotations\AnnotationReader
,
Doctrine\ORM\Mapping\Driver\AnnotationDriver
,
Doctrine\ORM\Mapping\Driver\AnnotationDriver
,
...
@@ -105,7 +105,7 @@ class SchemaToolTask extends AbstractTask
...
@@ -105,7 +105,7 @@ class SchemaToolTask extends AbstractTask
$em
=
$this
->
getConfiguration
()
->
getAttribute
(
'em'
);
$em
=
$this
->
getConfiguration
()
->
getAttribute
(
'em'
);
if
(
$em
===
null
)
{
if
(
$em
===
null
)
{
throw
new
C
li
Exception
(
throw
new
C
LI
Exception
(
"Attribute 'em' of CLI Configuration is not defined or it is not a valid EntityManager."
"Attribute 'em' of CLI Configuration is not defined or it is not a valid EntityManager."
);
);
}
}
...
@@ -125,17 +125,17 @@ class SchemaToolTask extends AbstractTask
...
@@ -125,17 +125,17 @@ class SchemaToolTask extends AbstractTask
$isCompleteUpdate
=
isset
(
$arguments
[
'complete-update'
])
&&
$arguments
[
'complete-update'
];
$isCompleteUpdate
=
isset
(
$arguments
[
'complete-update'
])
&&
$arguments
[
'complete-update'
];
if
(
$isUpdate
&&
(
$isCreate
||
$isDrop
||
$isCompleteUpdate
))
{
if
(
$isUpdate
&&
(
$isCreate
||
$isDrop
||
$isCompleteUpdate
))
{
throw
new
C
li
Exception
(
throw
new
C
LI
Exception
(
'You cannot use --update with --create, --drop or --complete-update.'
'You cannot use --update with --create, --drop or --complete-update.'
);
);
}
}
if
(
$isCompleteUpdate
&&
(
$isCreate
||
$isDrop
||
$isUpdate
))
{
if
(
$isCompleteUpdate
&&
(
$isCreate
||
$isDrop
||
$isUpdate
))
{
throw
new
C
li
Exception
(
'You cannot use --complete-update with --create, --drop or --update.'
);
throw
new
C
LI
Exception
(
'You cannot use --complete-update with --create, --drop or --update.'
);
}
}
if
(
!
(
$isCreate
||
$isDrop
||
$isUpdate
||
$isCompleteUpdate
))
{
if
(
!
(
$isCreate
||
$isDrop
||
$isUpdate
||
$isCompleteUpdate
))
{
throw
new
C
li
Exception
(
throw
new
C
LI
Exception
(
'You must specify at a minimum one of the options: '
.
'You must specify at a minimum one of the options: '
.
'--create, --drop, --update, --re-create or --complete-update.'
'--create, --drop, --update, --re-create or --complete-update.'
);
);
...
@@ -147,7 +147,7 @@ class SchemaToolTask extends AbstractTask
...
@@ -147,7 +147,7 @@ class SchemaToolTask extends AbstractTask
if
(
isset
(
$arguments
[
'class-dir'
]))
{
if
(
isset
(
$arguments
[
'class-dir'
]))
{
$metadataDriver
->
addPaths
((
array
)
$arguments
[
'class-dir'
]);
$metadataDriver
->
addPaths
((
array
)
$arguments
[
'class-dir'
]);
}
else
{
}
else
{
throw
new
C
li
Exception
(
throw
new
C
LI
Exception
(
'The supplied configuration uses the annotation metadata driver. '
.
'The supplied configuration uses the annotation metadata driver. '
.
"The 'class-dir' argument is required for this driver."
"The 'class-dir' argument is required for this driver."
);
);
...
...
lib/Doctrine/ORM/Tools/C
li
/Tasks/VersionTask.php
→
lib/Doctrine/ORM/Tools/C
LI
/Tasks/VersionTask.php
View file @
b2167985
...
@@ -19,9 +19,9 @@
...
@@ -19,9 +19,9 @@
* <http://www.doctrine-project.org>.
* <http://www.doctrine-project.org>.
*/
*/
namespace
Doctrine\ORM\Tools\C
li
\Tasks
;
namespace
Doctrine\ORM\Tools\C
LI
\Tasks
;
use
Doctrine\Common\C
li
\Tasks\AbstractTask
,
use
Doctrine\Common\C
LI
\Tasks\AbstractTask
,
Doctrine\Common\Version
;
Doctrine\Common\Version
;
/**
/**
...
...
tests/Doctrine/Tests/Common/AllTests.php
View file @
b2167985
...
@@ -29,7 +29,7 @@ class AllTests
...
@@ -29,7 +29,7 @@ class AllTests
$suite
->
addTest
(
Collections\AllTests
::
suite
());
$suite
->
addTest
(
Collections\AllTests
::
suite
());
$suite
->
addTest
(
Annotations\AllTests
::
suite
());
$suite
->
addTest
(
Annotations\AllTests
::
suite
());
$suite
->
addTest
(
Cache\AllTests
::
suite
());
$suite
->
addTest
(
Cache\AllTests
::
suite
());
$suite
->
addTest
(
C
li
\AllTests
::
suite
());
$suite
->
addTest
(
C
LI
\AllTests
::
suite
());
return
$suite
;
return
$suite
;
}
}
...
...
tests/Doctrine/Tests/Common/C
li
/AllTests.php
→
tests/Doctrine/Tests/Common/C
LI
/AllTests.php
View file @
b2167985
<?php
<?php
namespace
Doctrine\Tests\Common\C
li
;
namespace
Doctrine\Tests\Common\C
LI
;
if
(
!
defined
(
'PHPUnit_MAIN_METHOD'
))
{
if
(
!
defined
(
'PHPUnit_MAIN_METHOD'
))
{
define
(
'PHPUnit_MAIN_METHOD'
,
'Common_Cli_AllTests::main'
);
define
(
'PHPUnit_MAIN_METHOD'
,
'Common_Cli_AllTests::main'
);
...
@@ -19,16 +19,16 @@ class AllTests
...
@@ -19,16 +19,16 @@ class AllTests
{
{
$suite
=
new
\Doctrine\Tests\DoctrineTestSuite
(
'Doctrine Common CLI Tests'
);
$suite
=
new
\Doctrine\Tests\DoctrineTestSuite
(
'Doctrine Common CLI Tests'
);
$suite
->
addTestSuite
(
'Doctrine\Tests\Common\C
li
\ConfigurationTest'
);
$suite
->
addTestSuite
(
'Doctrine\Tests\Common\C
LI
\ConfigurationTest'
);
$suite
->
addTestSuite
(
'Doctrine\Tests\Common\C
li
\OptionTest'
);
$suite
->
addTestSuite
(
'Doctrine\Tests\Common\C
LI
\OptionTest'
);
$suite
->
addTestSuite
(
'Doctrine\Tests\Common\C
li
\OptionGroupTest'
);
$suite
->
addTestSuite
(
'Doctrine\Tests\Common\C
LI
\OptionGroupTest'
);
$suite
->
addTestSuite
(
'Doctrine\Tests\Common\C
li
\StyleTest'
);
$suite
->
addTestSuite
(
'Doctrine\Tests\Common\C
LI
\StyleTest'
);
//$suite->addTestSuite('Doctrine\Tests\Common\C
li\Cli
ControllerTest');
//$suite->addTestSuite('Doctrine\Tests\Common\C
LI\CLI
ControllerTest');
return
$suite
;
return
$suite
;
}
}
}
}
if
(
PHPUnit_MAIN_METHOD
==
'Common_C
li
_AllTests::main'
)
{
if
(
PHPUnit_MAIN_METHOD
==
'Common_C
LI
_AllTests::main'
)
{
AllTests
::
main
();
AllTests
::
main
();
}
}
\ No newline at end of file
tests/Doctrine/Tests/Common/C
li/Cli
ControllerTest.php
→
tests/Doctrine/Tests/Common/C
LI/CLI
ControllerTest.php
View file @
b2167985
<?php
<?php
namespace
Doctrine\Tests\Common\C
li
;
namespace
Doctrine\Tests\Common\C
LI
;
use
Doctrine\Tests\Mocks\TaskMock
;
use
Doctrine\Tests\Mocks\TaskMock
;
use
Doctrine\Common\C
li
\Configuration
;
use
Doctrine\Common\C
LI
\Configuration
;
use
Doctrine\Common\C
li
\CliController
;
use
Doctrine\Common\C
LI
\CliController
;
require_once
__DIR__
.
'/../../TestInit.php'
;
require_once
__DIR__
.
'/../../TestInit.php'
;
/**
/**
* @author Nils Adermann <naderman@naderman.de>
* @author Nils Adermann <naderman@naderman.de>
*/
*/
class
C
li
ControllerTest
extends
\Doctrine\Tests\DoctrineTestCase
class
C
LI
ControllerTest
extends
\Doctrine\Tests\DoctrineTestCase
{
{
private
$cli
;
private
$cli
;
/**
/**
* Sets up a C
li
Controller instance with a task referencing the TaskMock
* Sets up a C
LI
Controller instance with a task referencing the TaskMock
* class. Instances of that class created by the C
li
Controller can be
* class. Instances of that class created by the C
LI
Controller can be
* inspected for correctness.
* inspected for correctness.
*/
*/
function
setUp
()
function
setUp
()
{
{
$config
=
$this
->
getMock
(
'\Doctrine\Common\C
li
\Configuration'
);
$config
=
$this
->
getMock
(
'\Doctrine\Common\C
LI
\Configuration'
);
$printer
=
$this
->
getMockForAbstractClass
(
'\Doctrine\Common\C
li
\Printers\AbstractPrinter'
);
$printer
=
$this
->
getMockForAbstractClass
(
'\Doctrine\Common\C
LI
\Printers\AbstractPrinter'
);
$this
->
cli
=
new
C
li
Controller
(
$config
,
$printer
);
$this
->
cli
=
new
C
LI
Controller
(
$config
,
$printer
);
TaskMock
::
$instances
=
array
();
TaskMock
::
$instances
=
array
();
...
@@ -36,7 +36,7 @@ class CliControllerTest extends \Doctrine\Tests\DoctrineTestCase
...
@@ -36,7 +36,7 @@ class CliControllerTest extends \Doctrine\Tests\DoctrineTestCase
* Data provider with a bunch of task-mock calls with different arguments
* Data provider with a bunch of task-mock calls with different arguments
* and their expected parsed format.
* and their expected parsed format.
*/
*/
static
public
function
dataC
li
ControllerArguments
()
static
public
function
dataC
LI
ControllerArguments
()
{
{
return
array
(
return
array
(
array
(
array
(
...
@@ -69,9 +69,9 @@ class CliControllerTest extends \Doctrine\Tests\DoctrineTestCase
...
@@ -69,9 +69,9 @@ class CliControllerTest extends \Doctrine\Tests\DoctrineTestCase
/**
/**
* Checks whether the arguments coming from the data provider are correctly
* Checks whether the arguments coming from the data provider are correctly
* parsed by the C
li
Controller and passed to the task to be run.
* parsed by the C
LI
Controller and passed to the task to be run.
*
*
* @dataProvider dataC
li
ControllerArguments
* @dataProvider dataC
LI
ControllerArguments
* @param array $rawArgs
* @param array $rawArgs
* @param array $parsedArgs
* @param array $parsedArgs
* @param string $message
* @param string $message
...
...
tests/Doctrine/Tests/Common/C
li
/ConfigurationTest.php
→
tests/Doctrine/Tests/Common/C
LI
/ConfigurationTest.php
View file @
b2167985
<?php
<?php
namespace
Doctrine\Tests\Common\C
li
;
namespace
Doctrine\Tests\Common\C
LI
;
use
Doctrine\Common\C
li
\Configuration
;
use
Doctrine\Common\C
LI
\Configuration
;
require_once
__DIR__
.
'/../../TestInit.php'
;
require_once
__DIR__
.
'/../../TestInit.php'
;
...
...
tests/Doctrine/Tests/Common/C
li
/OptionGroupTest.php
→
tests/Doctrine/Tests/Common/C
LI
/OptionGroupTest.php
View file @
b2167985
<?php
<?php
namespace
Doctrine\Tests\Common\C
li
;
namespace
Doctrine\Tests\Common\C
LI
;
use
Doctrine\Common\C
li
\Printers\NormalPrinter
,
use
Doctrine\Common\C
LI
\Printers\NormalPrinter
,
Doctrine\Common\C
li
\OptionGroup
,
Doctrine\Common\C
LI
\OptionGroup
,
Doctrine\Common\C
li
\Option
;
Doctrine\Common\C
LI
\Option
;
require_once
__DIR__
.
'/../../TestInit.php'
;
require_once
__DIR__
.
'/../../TestInit.php'
;
...
...
tests/Doctrine/Tests/Common/C
li
/OptionTest.php
→
tests/Doctrine/Tests/Common/C
LI
/OptionTest.php
View file @
b2167985
<?php
<?php
namespace
Doctrine\Tests\Common\C
li
;
namespace
Doctrine\Tests\Common\C
LI
;
use
Doctrine\Common\C
li
\Option
;
use
Doctrine\Common\C
LI
\Option
;
require_once
__DIR__
.
'/../../TestInit.php'
;
require_once
__DIR__
.
'/../../TestInit.php'
;
...
...
tests/Doctrine/Tests/Common/C
li
/StyleTest.php
→
tests/Doctrine/Tests/Common/C
LI
/StyleTest.php
View file @
b2167985
<?php
<?php
namespace
Doctrine\Tests\Common\C
li
;
namespace
Doctrine\Tests\Common\C
LI
;
use
Doctrine\Common\C
li
\Style
;
use
Doctrine\Common\C
LI
\Style
;
require_once
__DIR__
.
'/../../TestInit.php'
;
require_once
__DIR__
.
'/../../TestInit.php'
;
...
...
tools/sandbox/cli-config.php
View file @
b2167985
...
@@ -37,5 +37,5 @@ $connectionOptions = array(
...
@@ -37,5 +37,5 @@ $connectionOptions = array(
$em
=
\Doctrine\ORM\EntityManager
::
create
(
$connectionOptions
,
$config
);
$em
=
\Doctrine\ORM\EntityManager
::
create
(
$connectionOptions
,
$config
);
$configuration
=
new
\Doctrine\Common\C
li
\Configuration
();
$configuration
=
new
\Doctrine\Common\C
LI
\Configuration
();
$configuration
->
setAttribute
(
'em'
,
$em
);
$configuration
->
setAttribute
(
'em'
,
$em
);
\ No newline at end of file
tools/sandbox/doctrine.php
View file @
b2167985
...
@@ -8,5 +8,5 @@ $classLoader->register();
...
@@ -8,5 +8,5 @@ $classLoader->register();
// Variable $configuration is defined inside cli-config.php
// Variable $configuration is defined inside cli-config.php
require
__DIR__
.
'/cli-config.php'
;
require
__DIR__
.
'/cli-config.php'
;
$cli
=
new
\Doctrine\Common\C
li\Cli
Controller
(
$configuration
);
$cli
=
new
\Doctrine\Common\C
LI\CLI
Controller
(
$configuration
);
$cli
->
run
(
$_SERVER
[
'argv'
]);
$cli
->
run
(
$_SERVER
[
'argv'
]);
\ No newline at end of file
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