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
417b71f4
Commit
417b71f4
authored
Jun 28, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
f4842edd
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
12 deletions
+27
-12
Builder.php
lib/Doctrine/Import/Builder.php
+2
-2
Mssql.php
lib/Doctrine/Import/Mssql.php
+5
-2
Mysql.php
lib/Doctrine/Import/Mysql.php
+3
-2
Oracle.php
lib/Doctrine/Import/Oracle.php
+5
-2
Pgsql.php
lib/Doctrine/Import/Pgsql.php
+6
-3
Sqlite.php
lib/Doctrine/Import/Sqlite.php
+6
-1
No files found.
lib/Doctrine/Import/Builder.php
View file @
417b71f4
...
...
@@ -120,7 +120,7 @@ END;
$i = 1;
foreach ($tableColumns as $name => $column) {
$columns[$i] = ' $this->hasColumn(\'' . $name . '\', \'' . $column['
ptype'][0
] . '\'';
$columns[$i] = ' $this->hasColumn(\'' . $name . '\', \'' . $column['
type'
] . '\'';
if ($column['length']) {
$columns[$i] .= ', ' . $column['length'];
} else {
...
...
@@ -147,7 +147,7 @@ END;
if (isset($column['unsigned'])
&&
$column['unsigned']) {
$a[] = '\'unsigned\' => true';
}
if ($column['
ptype'][0
] == 'enum'
&&
isset($column['values'])
&&
$column['values']) {
if ($column['
type'
] == 'enum'
&&
isset($column['values'])
&&
$column['values']) {
$a[] = '\'values\' => array(' . implode(',', $column['values']) . ')';
}
...
...
lib/Doctrine/Import/Mssql.php
View file @
417b71f4
...
...
@@ -59,6 +59,8 @@ class Doctrine_Import_Mssql extends Doctrine_Import
$columns
=
array
();
foreach
(
$result
as
$key
=>
$val
)
{
$val
=
array_change_key_case
(
$val
,
CASE_LOWER
);
if
(
strstr
(
$val
[
'type_name'
],
' '
))
{
list
(
$type
,
$identity
)
=
explode
(
' '
,
$val
[
'type_name'
]);
}
else
{
...
...
@@ -74,8 +76,9 @@ class Doctrine_Import_Mssql extends Doctrine_Import
$description
=
array
(
'name'
=>
$val
[
'column_name'
],
'type'
=>
$type
,
'ptype'
=>
$decl
[
'type'
],
'ntype'
=>
$type
,
'type'
=>
$decl
[
'type'
][
0
],
'alltypes'
=>
$decl
[
'type'
],
'length'
=>
$decl
[
'length'
],
'fixed'
=>
$decl
[
'fixed'
],
'unsigned'
=>
$decl
[
'unsigned'
],
...
...
lib/Doctrine/Import/Mysql.php
View file @
417b71f4
...
...
@@ -124,8 +124,9 @@ class Doctrine_Import_Mysql extends Doctrine_Import
$description
=
array
(
'name'
=>
$val
[
'field'
],
'type'
=>
$val
[
'type'
],
'ptype'
=>
$decl
[
'type'
],
'type'
=>
$decl
[
'type'
][
0
],
'alltypes'
=>
$decl
[
'type'
],
'ntype'
=>
$val
[
'type'
],
'length'
=>
$decl
[
'length'
],
'fixed'
=>
$decl
[
'fixed'
],
'unsigned'
=>
$decl
[
'unsigned'
],
...
...
lib/Doctrine/Import/Oracle.php
View file @
417b71f4
...
...
@@ -122,13 +122,16 @@ class Doctrine_Import_Oracle extends Doctrine_Import
$result
=
$this
->
conn
->
fetchAssoc
(
$sql
);
foreach
(
$result
as
$val
)
{
$val
=
array_change_key_case
(
$val
,
CASE_LOWER
);
$decl
=
$this
->
conn
->
dataDict
->
getPortableDeclaration
(
$val
);
$descr
[
$val
[
'column_name'
]]
=
array
(
'name'
=>
$val
[
'column_name'
],
'notnull'
=>
(
bool
)
(
$val
[
'nullable'
]
===
'N'
),
'type'
=>
$val
[
'data_type'
],
'ptype'
=>
$decl
[
'type'
],
'ntype'
=>
$val
[
'data_type'
],
'type'
=>
$decl
[
'type'
][
0
],
'alltypes'
=>
$decl
[
'type'
],
'fixed'
=>
$decl
[
'fixed'
],
'unsigned'
=>
$decl
[
'unsigned'
],
'default'
=>
$val
[
'data_default'
],
...
...
lib/Doctrine/Import/Pgsql.php
View file @
417b71f4
...
...
@@ -154,7 +154,9 @@ class Doctrine_Import_Pgsql extends Doctrine_Import
$columns
=
array
();
foreach
(
$result
as
$key
=>
$val
)
{
if
(
$val
[
'type'
]
===
'varchar'
)
{
$val
=
array_change_key_case
(
$val
,
CASE_LOWER
);
if
(
strtolower
(
$val
[
'type'
])
===
'varchar'
)
{
// get length from varchar definition
$length
=
preg_replace
(
'~.*\(([0-9]*)\).*~'
,
'$1'
,
$val
[
'complete_type'
]);
$val
[
'length'
]
=
$length
;
...
...
@@ -164,8 +166,9 @@ class Doctrine_Import_Pgsql extends Doctrine_Import
$description
=
array
(
'name'
=>
$val
[
'field'
],
'type'
=>
$val
[
'type'
],
'ptype'
=>
$decl
[
'type'
],
'ntype'
=>
$val
[
'type'
],
'type'
=>
$decl
[
'type'
][
0
],
'alltypes'
=>
$decl
[
'type'
],
'length'
=>
$decl
[
'length'
],
'fixed'
=>
$decl
[
'fixed'
],
'unsigned'
=>
$decl
[
'unsigned'
],
...
...
lib/Doctrine/Import/Sqlite.php
View file @
417b71f4
...
...
@@ -130,9 +130,14 @@ class Doctrine_Import_Sqlite extends Doctrine_Import
$description
=
array
();
$columns
=
array
();
foreach
(
$result
as
$key
=>
$val
)
{
$val
=
array_change_key_case
(
$val
,
CASE_LOWER
);
$decl
=
$this
->
conn
->
dataDict
->
getPortableDeclaration
(
$val
);
$description
=
array
(
'name'
=>
$val
[
'name'
],
'type'
=>
$val
[
'type'
],
'ntype'
=>
$val
[
'type'
],
'type'
=>
$decl
[
'type'
][
0
],
'alltypes'
=>
$decl
[
'type'
],
'notnull'
=>
(
bool
)
$val
[
'notnull'
],
'default'
=>
$val
[
'dflt_value'
],
'primary'
=>
(
bool
)
$val
[
'pk'
],
...
...
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