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
e1645efa
Commit
e1645efa
authored
Oct 07, 2009
by
jwage
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0] Misc. bug fixes
parent
d1228063
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
15 deletions
+37
-15
AbstractPrinter.php
lib/Doctrine/ORM/Tools/Cli/Printers/AbstractPrinter.php
+7
-6
AnsiColorPrinter.php
lib/Doctrine/ORM/Tools/Cli/Printers/AnsiColorPrinter.php
+2
-2
NormalPrinter.php
lib/Doctrine/ORM/Tools/Cli/Printers/NormalPrinter.php
+1
-1
ConvertMappingTask.php
lib/Doctrine/ORM/Tools/Cli/Tasks/ConvertMappingTask.php
+24
-5
SchemaTool.php
lib/Doctrine/ORM/Tools/SchemaTool.php
+3
-1
No files found.
lib/Doctrine/ORM/Tools/Cli/Printers/AbstractPrinter.php
View file @
e1645efa
...
...
@@ -123,9 +123,12 @@ abstract class AbstractPrinter
*/
public
function
getStyle
(
$name
)
{
$name
=
strtoupper
(
$name
);
return
isset
(
$this
->
_styles
[
$name
])
?
$this
->
_styles
[
$name
]
:
null
;
if
(
is_string
(
$name
))
{
$name
=
strtoupper
(
$name
);
return
isset
(
$this
->
_styles
[
$name
])
?
$this
->
_styles
[
$name
]
:
null
;
}
else
{
return
$name
;
}
}
/**
...
...
@@ -146,8 +149,6 @@ abstract class AbstractPrinter
*/
public
function
write
(
$message
,
$style
=
'NONE'
)
{
$style
=
is_string
(
$style
)
?
$this
->
getStyle
(
$style
)
:
$style
;
fwrite
(
$this
->
_stream
,
$this
->
format
(
$message
,
$style
));
return
$this
;
...
...
@@ -171,5 +172,5 @@ abstract class AbstractPrinter
* @param mixed $style Style to be applied in message
* @return string Formatted message
*/
abstract
public
function
format
(
$message
,
Style
$style
);
abstract
public
function
format
(
$message
,
$style
);
}
\ No newline at end of file
lib/Doctrine/ORM/Tools/Cli/Printers/AnsiColorPrinter.php
View file @
e1645efa
...
...
@@ -57,12 +57,12 @@ class AnsiColorPrinter extends AbstractPrinter
/**
* @inheritdoc
*/
public
function
format
(
$message
,
Style
$style
)
public
function
format
(
$message
,
$style
)
{
if
(
!
$this
->
_supportsColor
())
{
return
$message
;
}
$style
=
$this
->
getStyle
(
$style
);
$str
=
$this
->
_getForegroundString
(
$style
->
getForeground
())
.
$this
->
_getBackgroundString
(
$style
->
getBackground
())
.
$this
->
_getOptionsString
(
$style
->
getOptions
());
...
...
lib/Doctrine/ORM/Tools/Cli/Printers/NormalPrinter.php
View file @
e1645efa
...
...
@@ -39,7 +39,7 @@ class NormalPrinter extends AbstractPrinter
/**
* @inheritdoc
*/
public
function
format
(
$message
,
Style
$style
)
public
function
format
(
$message
,
$style
)
{
return
$message
;
}
...
...
lib/Doctrine/ORM/Tools/Cli/Tasks/ConvertMappingTask.php
View file @
e1645efa
...
...
@@ -139,7 +139,13 @@ class ConvertMappingTask extends AbstractTask
$type
=
$this
->
_determineSourceType
(
$sourceArg
);
$source
=
$this
->
_getSourceByType
(
$type
,
$sourceArg
);
$printer
->
writeln
(
sprintf
(
'Adding "%s" mapping source'
,
$sourceArg
),
'INFO'
);
$printer
->
writeln
(
sprintf
(
'Adding "%s" mapping source'
,
$printer
->
format
(
$sourceArg
,
'KEYWORD'
)
),
'INFO'
);
$cme
->
addMappingSource
(
$source
,
$type
);
}
...
...
@@ -147,11 +153,22 @@ class ConvertMappingTask extends AbstractTask
}
foreach
(
$metadatas
as
$metadata
)
{
$printer
->
write
(
'Processing entity "'
)
->
write
(
$metadata
->
name
,
'KEYWORD'
)
->
writeln
(
'"'
);
$printer
->
writeln
(
sprintf
(
'Processing entity "%s"'
,
$printer
->
format
(
$metadata
->
name
,
'KEYWORD'
)
)
);
}
$printer
->
writeln
(
sprintf
(
'Exporting %s mapping information to directory "%s"'
,
$args
[
'to'
],
$args
[
'dest'
]),
'INFO'
);
$printer
->
writeln
(
sprintf
(
'Exporting %s mapping information to directory "%s"'
,
$printer
->
format
(
$args
[
'to'
],
'KEYWORD'
),
$printer
->
format
(
$args
[
'dest'
],
'KEYWORD'
)
),
'INFO'
);
$exporter
->
setMetadatas
(
$metadatas
);
$exporter
->
export
();
...
...
@@ -179,7 +196,9 @@ class ConvertMappingTask extends AbstractTask
// Find the files in the directory
$files
=
glob
(
$source
.
'/*.*'
);
if
(
!
$files
)
{
throw
new
\InvalidArgumentException
(
sprintf
(
'No mapping files found in "%s"'
,
$source
));
throw
new
\InvalidArgumentException
(
sprintf
(
'No mapping files found in "%s"'
,
$source
)
);
}
// Get the contents of the first file
...
...
lib/Doctrine/ORM/Tools/SchemaTool.php
View file @
e1645efa
...
...
@@ -435,7 +435,8 @@ class SchemaTool
for
(
$i
=
count
(
$commitOrder
)
-
1
;
$i
>=
0
;
--
$i
)
{
$class
=
$commitOrder
[
$i
];
if
(
$class
->
isInheritanceTypeSingleTable
()
&&
$class
->
name
!=
$class
->
rootEntityName
)
{
if
((
$class
->
isInheritanceTypeSingleTable
()
&&
$class
->
name
!=
$class
->
rootEntityName
)
||
$class
->
isMappedSuperclass
)
{
continue
;
}
...
...
@@ -628,6 +629,7 @@ class SchemaTool
}
foreach
(
$newJoinColumns
as
$name
=>
$joinColumn
)
{
$joinColumn
[
'type'
]
=
Type
::
getType
(
$joinColumn
[
'type'
]);
$changes
[
'add'
][
$name
]
=
$joinColumn
;
}
$sql
[]
=
$this
->
_platform
->
getAlterTableSql
(
$tableName
,
$changes
);
...
...
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