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
60b31c7a
Commit
60b31c7a
authored
Sep 04, 2009
by
guilhermeblanco
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0] Implemented CLI Task Version. Added support to DECIMAL datatype.
parent
eb254226
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
58 additions
and
26 deletions
+58
-26
AbstractPlatform.php
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
+21
-2
AnnotationDriver.php
lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php
+7
-2
XmlDriver.php
lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php
+7
-2
YamlDriver.php
lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php
+7
-2
VersionTask.php
lib/Doctrine/ORM/Tools/Cli/Tasks/VersionTask.php
+16
-18
No files found.
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
View file @
60b31c7a
...
@@ -753,17 +753,34 @@ abstract class AbstractPlatform
...
@@ -753,17 +753,34 @@ abstract class AbstractPlatform
return
$name
.
' '
.
$typeDecl
.
$charset
.
$default
.
$notnull
.
$unique
.
$check
.
$collation
;
return
$name
.
' '
.
$typeDecl
.
$charset
.
$default
.
$notnull
.
$unique
.
$check
.
$collation
;
}
}
/**
* Gets the SQL snippet that declares a floating point column of arbitrary precision.
*
* @param array $columnDef
* @return string
*/
public
function
getDecimalTypeDeclarationSql
(
array
$columnDef
)
{
$columnDef
[
'precision'
]
=
(
!
isset
(
$columnDef
[
'precision'
])
||
empty
(
$columnDef
[
'precision'
]))
?
10
:
$columnDef
[
'precision'
];
$columnDef
[
'scale'
]
=
(
!
isset
(
$columnDef
[
'scale'
])
||
empty
(
$columnDef
[
'scale'
]))
?
0
:
$columnDef
[
'scale'
];
return
'NUMERIC('
.
$columnDef
[
'precision'
]
.
', '
.
$columnDef
[
'scale'
]
.
')'
;
}
/**
/**
* Gets the SQL snippet that declares a 4 byte integer column.
* Gets the SQL snippet that declares a 4 byte integer column.
*
*
* @param
<type> $name
* @param
array $columnDef
* @
param <type> $field
* @
return string
*/
*/
abstract
public
function
getIntegerTypeDeclarationSql
(
array
$columnDef
);
abstract
public
function
getIntegerTypeDeclarationSql
(
array
$columnDef
);
/**
/**
* Gets the SQL snippet that declares an 8 byte integer column.
* Gets the SQL snippet that declares an 8 byte integer column.
*
*
* @param array $columnDef
* @return string
* @return string
*/
*/
abstract
public
function
getBigIntTypeDeclarationSql
(
array
$columnDef
);
abstract
public
function
getBigIntTypeDeclarationSql
(
array
$columnDef
);
...
@@ -771,6 +788,7 @@ abstract class AbstractPlatform
...
@@ -771,6 +788,7 @@ abstract class AbstractPlatform
/**
/**
* Gets the SQL snippet that declares a 2 byte integer column.
* Gets the SQL snippet that declares a 2 byte integer column.
*
*
* @param array $columnDef
* @return string
* @return string
*/
*/
abstract
public
function
getSmallIntTypeDeclarationSql
(
array
$columnDef
);
abstract
public
function
getSmallIntTypeDeclarationSql
(
array
$columnDef
);
...
@@ -778,6 +796,7 @@ abstract class AbstractPlatform
...
@@ -778,6 +796,7 @@ abstract class AbstractPlatform
/**
/**
* Gets the SQL snippet that declares common properties of an integer column.
* Gets the SQL snippet that declares common properties of an integer column.
*
*
* @param array $columnDef
* @return string
* @return string
*/
*/
abstract
protected
function
_getCommonIntegerTypeDeclarationSql
(
array
$columnDef
);
abstract
protected
function
_getCommonIntegerTypeDeclarationSql
(
array
$columnDef
);
...
...
lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php
View file @
60b31c7a
...
@@ -32,8 +32,13 @@ require __DIR__ . '/DoctrineAnnotations.php';
...
@@ -32,8 +32,13 @@ require __DIR__ . '/DoctrineAnnotations.php';
/**
/**
* The AnnotationDriver reads the mapping metadata from docblock annotations.
* The AnnotationDriver reads the mapping metadata from docblock annotations.
*
*
* @author Roman Borschel <roman@code-factory.org>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @since 2.0
* @version $Revision$
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
*/
class
AnnotationDriver
implements
Driver
class
AnnotationDriver
implements
Driver
{
{
...
...
lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php
View file @
60b31c7a
...
@@ -26,8 +26,13 @@ use Doctrine\ORM\Mapping\ClassMetadata;
...
@@ -26,8 +26,13 @@ use Doctrine\ORM\Mapping\ClassMetadata;
/**
/**
* XmlDriver is a metadata driver that enables mapping through XML files.
* XmlDriver is a metadata driver that enables mapping through XML files.
*
*
* @author Roman Borschel <roman@code-factory.org>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @since 2.0
* @version $Revision$
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
*/
class
XmlDriver
extends
AbstractFileDriver
class
XmlDriver
extends
AbstractFileDriver
{
{
...
...
lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php
View file @
60b31c7a
...
@@ -33,8 +33,13 @@ if ( ! class_exists('sfYaml', false)) {
...
@@ -33,8 +33,13 @@ if ( ! class_exists('sfYaml', false)) {
/**
/**
* The YamlDriver reads the mapping metadata from yaml schema files.
* The YamlDriver reads the mapping metadata from yaml schema files.
*
*
* @author Jonathan H. Wage <jonwage@gmail.com>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @since 2.0
* @version $Revision$
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
*/
class
YamlDriver
extends
AbstractFileDriver
class
YamlDriver
extends
AbstractFileDriver
{
{
...
...
lib/Doctrine/ORM/Tools/Cli/Tasks/VersionTask.php
View file @
60b31c7a
...
@@ -39,12 +39,15 @@ class VersionTask extends AbstractTask
...
@@ -39,12 +39,15 @@ class VersionTask extends AbstractTask
*/
*/
public
function
extendedHelp
()
public
function
extendedHelp
()
{
{
$this
->
getPrinter
()
->
writeln
(
'version extended help.'
,
'INFO'
);
$printer
=
$this
->
getPrinter
();
/*$this->getPrinter()->write('version extended help' . PHP_EOL, 'HEADER');
$this->getPrinter()->write('version extended help' . PHP_EOL, 'ERROR');
$printer
->
write
(
'Task: '
)
->
writeln
(
'version'
,
'KEYWORD'
)
$this->getPrinter()->write('version extended help' . PHP_EOL, 'INFO');
->
write
(
'Synopsis: '
);
$this->getPrinter()->write('version extended help' . PHP_EOL, 'COMMENT');
$this
->
_writeSynopsis
(
$printer
);
$this->getPrinter()->write('version extended help' . PHP_EOL, 'NONE');*/
$printer
->
writeln
(
'Description: Displays the current installed Doctrine version.'
)
->
writeln
(
'Options:'
)
->
writeln
(
'No available options'
,
'INFO'
);
}
}
/**
/**
...
@@ -52,12 +55,12 @@ class VersionTask extends AbstractTask
...
@@ -52,12 +55,12 @@ class VersionTask extends AbstractTask
*/
*/
public
function
basicHelp
()
public
function
basicHelp
()
{
{
$this
->
getPrinter
()
->
writeln
(
'version'
,
'KEYWORD'
);
$this
->
_writeSynopsis
(
$this
->
getPrinter
()
);
/*$this->getPrinter()->write('version basic help' . PHP_EOL, 'HEADER');
}
$this->getPrinter()->write('version basic help' . PHP_EOL, 'ERROR');
$this->getPrinter()->write('version basic help' . PHP_EOL, 'INFO');
private
function
_writeSynopsis
(
$printer
)
$this->getPrinter()->write('version basic help' . PHP_EOL, 'COMMENT');
{
$
this->getPrinter()->write('version basic help' . PHP_EOL, 'NONE');*/
$
printer
->
writeln
(
'version'
,
'KEYWORD'
);
}
}
/**
/**
...
@@ -74,11 +77,6 @@ class VersionTask extends AbstractTask
...
@@ -74,11 +77,6 @@ class VersionTask extends AbstractTask
*/
*/
public
function
run
()
public
function
run
()
{
{
$this
->
getPrinter
()
->
writeln
(
'version normal flow.'
,
'INFO'
);
$this
->
getPrinter
()
->
writeln
(
'You are currently running Doctrine 2.0.0 Alpha 1'
,
'INFO'
);
/*$this->getPrinter()->write('version run' . PHP_EOL, 'HEADER');
$this->getPrinter()->write('version run' . PHP_EOL, 'ERROR');
$this->getPrinter()->write('version run' . PHP_EOL, 'INFO');
$this->getPrinter()->write('version run' . PHP_EOL, 'COMMENT');
$this->getPrinter()->write('version run' . PHP_EOL, 'NONE');*/
}
}
}
}
\ 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