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
317e84d8
Commit
317e84d8
authored
Apr 11, 2010
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DDC-510 - Moved AnnotationDriver Factory Method onto Configuration instance
parent
45cd2afd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
5 deletions
+17
-5
Configuration.php
lib/Doctrine/ORM/Configuration.php
+14
-0
OrmFunctionalTestCase.php
tests/Doctrine/Tests/OrmFunctionalTestCase.php
+1
-2
OrmTestCase.php
tests/Doctrine/Tests/OrmTestCase.php
+2
-3
No files found.
lib/Doctrine/ORM/Configuration.php
View file @
317e84d8
...
...
@@ -130,6 +130,20 @@ class Configuration extends \Doctrine\DBAL\Configuration
$this
->
_attributes
[
'metadataDriverImpl'
]
=
$driverImpl
;
}
/**
* Add a new default annotation driver with a correctly configured annotation reader.
*
* @param array $paths
* @return Mapping\Driver\AnnotationDriver
*/
public
function
newDefaultAnnotationDriver
(
$paths
=
array
())
{
$reader
=
new
\Doctrine\Common\Annotations\AnnotationReader
();
$reader
->
setDefaultAnnotationNamespace
(
'Doctrine\ORM\Mapping\\'
);
return
new
\Doctrine\ORM\Mapping\Driver\AnnotationDriver
(
$reader
,
(
array
)
$paths
);
}
/**
* Adds a namespace under a certain alias.
*
...
...
tests/Doctrine/Tests/OrmFunctionalTestCase.php
View file @
317e84d8
...
...
@@ -235,8 +235,7 @@ abstract class OrmFunctionalTestCase extends OrmTestCase
$config
->
setProxyDir
(
__DIR__
.
'/Proxies'
);
$config
->
setProxyNamespace
(
'Doctrine\Tests\Proxies'
);
$driverImpl
=
\Doctrine\ORM\Mapping\Driver\AnnotationDriver
::
create
();
$config
->
setMetadataDriverImpl
(
$driverImpl
);
$config
->
setMetadataDriverImpl
(
$config
->
newDefaultAnnotationDriver
());
$conn
=
$this
->
sharedFixture
[
'conn'
];
$conn
->
getConfiguration
()
->
setSQLLogger
(
$this
->
_sqlLoggerStack
);
...
...
tests/Doctrine/Tests/OrmTestCase.php
View file @
317e84d8
...
...
@@ -30,9 +30,8 @@ abstract class OrmTestCase extends DoctrineTestCase
}
else
{
$config
->
setMetadataCacheImpl
(
new
\Doctrine\Common\Cache\ArrayCache
);
}
$driverImpl
=
\Doctrine\ORM\Mapping\Driver\AnnotationDriver
::
create
();
$config
->
setMetadataDriverImpl
(
$driverImpl
);
$config
->
setMetadataDriverImpl
(
$config
->
newDefaultAnnotationDriver
());
$config
->
setQueryCacheImpl
(
self
::
getSharedQueryCacheImpl
());
$config
->
setProxyDir
(
__DIR__
.
'/Proxies'
);
...
...
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