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
ee9e79d0
Commit
ee9e79d0
authored
Nov 08, 2007
by
Jonathan.Wage
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix schema merging and fixed issue with fixtures saving.
parent
c50b2bc3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
5 deletions
+18
-5
Import.php
lib/Doctrine/Data/Import.php
+16
-3
Schema.php
lib/Doctrine/Import/Schema.php
+2
-2
No files found.
lib/Doctrine/Data/Import.php
View file @
ee9e79d0
...
...
@@ -64,7 +64,7 @@ class Doctrine_Data_Import extends Doctrine_Data
// If they specified a specific yml file
if
(
end
(
$e
)
==
'yml'
)
{
$array
=
array_merge
_recursive
(
Doctrine_Parser
::
load
(
$dir
,
$this
->
getFormat
()),
$array
);
$array
=
array_merge
(
Doctrine_Parser
::
load
(
$dir
,
$this
->
getFormat
()),
$array
);
// If they specified a directory
}
else
if
(
is_dir
(
$dir
))
{
$it
=
new
RecursiveIteratorIterator
(
new
RecursiveDirectoryIterator
(
$dir
),
...
...
@@ -73,7 +73,7 @@ class Doctrine_Data_Import extends Doctrine_Data
foreach
(
$it
as
$file
)
{
$e
=
explode
(
'.'
,
$file
->
getFileName
());
if
(
in_array
(
end
(
$e
),
$this
->
getFormats
()))
{
$array
=
array_merge
_recursive
(
Doctrine_Parser
::
load
(
$file
->
getPathName
(),
$this
->
getFormat
()),
$array
);
$array
=
array_merge
(
Doctrine_Parser
::
load
(
$file
->
getPathName
(),
$this
->
getFormat
()),
$array
);
}
}
}
...
...
@@ -172,7 +172,20 @@ class Doctrine_Data_Import extends Doctrine_Data
$manager
=
Doctrine_Manager
::
getInstance
();
foreach
(
$manager
as
$connection
)
{
$connection
->
flush
();
$objects
=
array
();
foreach
(
$this
->
_importedObjects
as
$object
)
{
$objects
[]
=
get_class
(
$object
);
}
$tree
=
$connection
->
unitOfWork
->
buildFlushTree
(
$objects
);
foreach
(
$tree
as
$model
)
{
foreach
(
$this
->
_importedObjects
as
$obj
)
{
if
(
$obj
instanceof
$model
)
{
$obj
->
save
();
}
}
}
}
}
...
...
lib/Doctrine/Import/Schema.php
View file @
ee9e79d0
...
...
@@ -103,7 +103,7 @@ class Doctrine_Import_Schema
foreach
((
array
)
$schema
AS
$s
)
{
if
(
is_file
(
$s
))
{
$array
=
array_merge
(
$
array
,
$this
->
parseSchema
(
$s
,
$format
)
);
$array
=
array_merge
(
$
this
->
parseSchema
(
$s
,
$format
),
$array
);
}
else
if
(
is_dir
(
$s
))
{
$it
=
new
RecursiveIteratorIterator
(
new
RecursiveDirectoryIterator
(
$s
),
RecursiveIteratorIterator
::
LEAVES_ONLY
);
...
...
@@ -111,7 +111,7 @@ class Doctrine_Import_Schema
foreach
(
$it
as
$file
)
{
$e
=
explode
(
'.'
,
$file
->
getFileName
());
if
(
end
(
$e
)
===
$format
)
{
$array
=
array_merge
(
$
array
,
$this
->
parseSchema
(
$file
->
getPathName
(),
$format
)
);
$array
=
array_merge
(
$
this
->
parseSchema
(
$file
->
getPathName
(),
$format
),
$array
);
}
}
}
...
...
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