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
28e937b9
Commit
28e937b9
authored
Apr 11, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes #298
parent
dcab3087
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
3 deletions
+11
-3
Mysql.php
lib/Doctrine/DataDict/Mysql.php
+7
-3
Builder.php
lib/Doctrine/Import/Builder.php
+3
-0
Mysql.php
lib/Doctrine/Import/Mysql.php
+1
-0
No files found.
lib/Doctrine/DataDict/Mysql.php
View file @
28e937b9
...
@@ -137,7 +137,7 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict
...
@@ -137,7 +137,7 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict
if
(
!
isset
(
$field
[
'type'
]))
{
if
(
!
isset
(
$field
[
'type'
]))
{
$field
[
'type'
]
=
null
;
$field
[
'type'
]
=
null
;
}
}
switch
(
$field
[
'type'
])
{
switch
(
$field
[
'type'
])
{
case
'char'
:
case
'char'
:
$length
=
(
!
empty
(
$field
[
'length'
]))
?
$field
[
'length'
]
:
false
;
$length
=
(
!
empty
(
$field
[
'length'
]))
?
$field
[
'length'
]
:
false
;
...
@@ -246,6 +246,8 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict
...
@@ -246,6 +246,8 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict
if
(
!
isset
(
$field
[
'name'
]))
{
if
(
!
isset
(
$field
[
'name'
]))
{
$field
[
'name'
]
=
''
;
$field
[
'name'
]
=
''
;
}
}
$values
=
null
;
switch
(
$dbType
)
{
switch
(
$dbType
)
{
case
'tinyint'
:
case
'tinyint'
:
...
@@ -304,7 +306,7 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict
...
@@ -304,7 +306,7 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict
}
}
break
;
break
;
case
'enum'
:
case
'enum'
:
$type
[]
=
'
text
'
;
$type
[]
=
'
enum
'
;
preg_match_all
(
'/\'.+\'/U'
,
$field
[
'type'
],
$matches
);
preg_match_all
(
'/\'.+\'/U'
,
$field
[
'type'
],
$matches
);
$length
=
0
;
$length
=
0
;
$fixed
=
false
;
$fixed
=
false
;
...
@@ -317,6 +319,8 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict
...
@@ -317,6 +319,8 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict
if
(
preg_match
(
'/^(is|has)/'
,
$field
[
'name'
]))
{
if
(
preg_match
(
'/^(is|has)/'
,
$field
[
'name'
]))
{
$type
=
array_reverse
(
$type
);
$type
=
array_reverse
(
$type
);
}
}
}
else
{
$values
=
$matches
[
0
];
}
}
}
}
$type
[]
=
'integer'
;
$type
[]
=
'integer'
;
...
@@ -369,7 +373,7 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict
...
@@ -369,7 +373,7 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict
$length
=
((
int
)
$length
==
0
)
?
null
:
(
int
)
$length
;
$length
=
((
int
)
$length
==
0
)
?
null
:
(
int
)
$length
;
return
array
(
'type'
=>
$type
,
'length'
=>
$length
,
'unsigned'
=>
$unsigned
,
'fixed'
=>
$fixed
);
return
array
(
'type'
=>
$type
,
'length'
=>
$length
,
'unsigned'
=>
$unsigned
,
'fixed'
=>
$fixed
,
'values'
=>
$values
);
}
}
/**
/**
* Obtain DBMS specific SQL code portion needed to set the CHARACTER SET
* Obtain DBMS specific SQL code portion needed to set the CHARACTER SET
...
...
lib/Doctrine/Import/Builder.php
View file @
28e937b9
...
@@ -121,6 +121,9 @@ class Doctrine_Import_Builder
...
@@ -121,6 +121,9 @@ class Doctrine_Import_Builder
if
(
isset
(
$column
[
'unsigned'
])
&&
$column
[
'unsigned'
])
{
if
(
isset
(
$column
[
'unsigned'
])
&&
$column
[
'unsigned'
])
{
$a
[]
=
'\'unsigned\' => true'
;
$a
[]
=
'\'unsigned\' => true'
;
}
}
if
(
$column
[
'ptype'
][
0
]
==
'enum'
&&
isset
(
$column
[
'values'
])
&&
$column
[
'values'
])
{
$a
[]
=
'\'values\' => array('
.
implode
(
','
,
$column
[
'values'
])
.
')'
;
}
if
(
!
empty
(
$a
))
{
if
(
!
empty
(
$a
))
{
$columns
[
$i
]
.=
', '
.
'array('
;
$columns
[
$i
]
.=
', '
.
'array('
;
...
...
lib/Doctrine/Import/Mysql.php
View file @
28e937b9
...
@@ -129,6 +129,7 @@ class Doctrine_Import_Mysql extends Doctrine_Import
...
@@ -129,6 +129,7 @@ class Doctrine_Import_Mysql extends Doctrine_Import
'length'
=>
$decl
[
'length'
],
'length'
=>
$decl
[
'length'
],
'fixed'
=>
$decl
[
'fixed'
],
'fixed'
=>
$decl
[
'fixed'
],
'unsigned'
=>
$decl
[
'unsigned'
],
'unsigned'
=>
$decl
[
'unsigned'
],
'values'
=>
$decl
[
'values'
],
'primary'
=>
(
strtolower
(
$val
[
'key'
])
==
'pri'
),
'primary'
=>
(
strtolower
(
$val
[
'key'
])
==
'pri'
),
'default'
=>
$val
[
'default'
],
'default'
=>
$val
[
'default'
],
'notnull'
=>
(
bool
)
(
$val
[
'null'
]
!=
'YES'
),
'notnull'
=>
(
bool
)
(
$val
[
'null'
]
!=
'YES'
),
...
...
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