本文整理汇总了PHP中Doctrine\Common\Annotations\AnnotationReader::setEnableParsePhpImports方法的典型用法代码示例。如果您正苦于以下问题:PHP AnnotationReader::setEnableParsePhpImports方法的具体用法?PHP AnnotationReader::setEnableParsePhpImports怎么用?PHP AnnotationReader::setEnableParsePhpImports使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Doctrine\Common\Annotations\AnnotationReader
的用法示例。
在下文中一共展示了AnnotationReader::setEnableParsePhpImports方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
public function setUp()
{
if (version_compare(\Doctrine\Common\Version::VERSION, '2.1.0RC4-DEV', '>=')) {
$this->markTestSkipped('Doctrine common is 2.1.0RC4-DEV version, skipping.');
} else {
if (version_compare(\Doctrine\Common\Version::VERSION, '2.1.0-BETA3-DEV', '>=')) {
$reader = new AnnotationReader();
$reader->setDefaultAnnotationNamespace('Doctrine\\ORM\\Mapping\\');
$reader->setIgnoreNotImportedAnnotations(true);
$reader->setAnnotationNamespaceAlias('Gedmo\\Mapping\\Annotation\\', 'gedmo');
$reader->setEnableParsePhpImports(false);
$reader->setAutoloadAnnotations(true);
$reader = new CachedReader(new \Doctrine\Common\Annotations\IndexedReader($reader), new ArrayCache());
} else {
$reader = new AnnotationReader();
$reader->setAutoloadAnnotations(true);
$reader->setAnnotationNamespaceAlias('Gedmo\\Mapping\\Annotation\\', 'gedmo');
$reader->setDefaultAnnotationNamespace('Doctrine\\ORM\\Mapping\\');
}
}
$config = new \Doctrine\ORM\Configuration();
$config->setProxyDir(TESTS_TEMP_DIR);
$config->setProxyNamespace('Gedmo\\Mapping\\Proxy');
$config->setMetadataDriverImpl(new AnnotationDriver($reader));
$conn = array('driver' => 'pdo_sqlite', 'memory' => true);
//$config->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger());
$evm = new \Doctrine\Common\EventManager();
$this->timestampable = new \Gedmo\Timestampable\TimestampableListener();
$evm->addEventSubscriber($this->timestampable);
$this->em = \Doctrine\ORM\EntityManager::create($conn, $config, $evm);
$schemaTool = new \Doctrine\ORM\Tools\SchemaTool($this->em);
$schemaTool->dropSchema(array());
$schemaTool->createSchema(array($this->em->getClassMetadata(self::ARTICLE)));
}
示例2: newDefaultAnnotationDriver
/**
* Add a new default annotation driver with a correctly configured annotation reader.
*
* @param array $paths
* @return Mapping\Driver\AnnotationDriver
*/
public function newDefaultAnnotationDriver($paths = array())
{
if (version_compare(\Doctrine\Common\Version::VERSION, '3.0.0-DEV', '>=')) {
// Register the ORM Annotations in the AnnotationRegistry
AnnotationRegistry::registerFile(__DIR__ . '/Mapping/Driver/DoctrineAnnotations.php');
$reader = new AnnotationReader();
$reader = new \Doctrine\Common\Annotations\CachedReader($reader, new ArrayCache());
} else {
if (version_compare(\Doctrine\Common\Version::VERSION, '2.1.0-DEV', '>=')) {
// Register the ORM Annotations in the AnnotationRegistry
AnnotationRegistry::registerFile(__DIR__ . '/Mapping/Driver/DoctrineAnnotations.php');
$reader = new AnnotationReader();
$reader->setDefaultAnnotationNamespace('Doctrine\\ORM\\Mapping\\');
$reader->setIgnoreNotImportedAnnotations(true);
$reader->setEnableParsePhpImports(false);
$reader = new \Doctrine\Common\Annotations\CachedReader(new \Doctrine\Common\Annotations\IndexedReader($reader), new ArrayCache());
} else {
$reader = new AnnotationReader();
$reader->setDefaultAnnotationNamespace('Doctrine\\ORM\\Mapping\\');
}
}
return new AnnotationDriver($reader, (array) $paths);
}
开发者ID:MarS2806,项目名称:Zend-Framework--Doctrine-ORM--PHPUnit--Ant--Jenkins-CI--TDD-,代码行数:29,代码来源:Configuration.php
示例3: getDefaultAnnotationReader
/**
* Create default annotation reader for extensions
*
* @return \Doctrine\Common\Annotations\AnnotationReader
*/
private function getDefaultAnnotationReader()
{
if (null === self::$defaultAnnotationReader) {
if (version_compare(\Doctrine\Common\Version::VERSION, '2.2.0-DEV', '>=')) {
$reader = new \Doctrine\Common\Annotations\AnnotationReader();
\Doctrine\Common\Annotations\AnnotationRegistry::registerAutoloadNamespace('Gedmo\\Mapping\\Annotation', __DIR__ . '/../../');
$reader = new \Doctrine\Common\Annotations\CachedReader($reader, new ArrayCache());
} else {
if (version_compare(\Doctrine\Common\Version::VERSION, '2.1.0RC4-DEV', '>=')) {
$reader = new \Doctrine\Common\Annotations\AnnotationReader();
\Doctrine\Common\Annotations\AnnotationRegistry::registerAutoloadNamespace('Gedmo\\Mapping\\Annotation', __DIR__ . '/../../');
$reader->setDefaultAnnotationNamespace('Doctrine\\ORM\\Mapping\\');
$reader = new \Doctrine\Common\Annotations\CachedReader($reader, new ArrayCache());
} else {
if (version_compare(\Doctrine\Common\Version::VERSION, '2.1.0-BETA3-DEV', '>=')) {
$reader = new \Doctrine\Common\Annotations\AnnotationReader();
$reader->setDefaultAnnotationNamespace('Doctrine\\ORM\\Mapping\\');
$reader->setIgnoreNotImportedAnnotations(true);
$reader->setAnnotationNamespaceAlias('Gedmo\\Mapping\\Annotation\\', 'gedmo');
$reader->setEnableParsePhpImports(false);
$reader->setAutoloadAnnotations(true);
$reader = new \Doctrine\Common\Annotations\CachedReader(new \Doctrine\Common\Annotations\IndexedReader($reader), new ArrayCache());
} else {
$reader = new \Doctrine\Common\Annotations\AnnotationReader();
$reader->setAutoloadAnnotations(true);
$reader->setAnnotationNamespaceAlias('Gedmo\\Mapping\\Annotation\\', 'gedmo');
$reader->setDefaultAnnotationNamespace('Doctrine\\ORM\\Mapping\\');
}
}
}
self::$defaultAnnotationReader = $reader;
}
return self::$defaultAnnotationReader;
}
示例4: newDefaultAnnotationDriver
/**
* Add a new default annotation driver with a correctly configured annotation reader.
*
* @param array $paths
* @return Mapping\Driver\AnnotationDriver
*/
public function newDefaultAnnotationDriver($paths = array())
{
if (version_compare(\Doctrine\Common\Version::VERSION, '3.0.0-DEV', '>=')) {
// Register the ORM Annotations in the AnnotationRegistry
AnnotationRegistry::registerFile(__DIR__ . '/Mapping/Driver/DoctrineAnnotations.php');
$reader = new AnnotationReader();
$reader = new \Doctrine\Common\Annotations\CachedReader($reader, new \Doctrine\Common\Cache\ApcCache());
} else {
if (version_compare(\Doctrine\Common\Version::VERSION, '2.3.0-DEV', '>=')) {
// Register the ORM Annotations in the AnnotationRegistry
// Done manually according to MongoDB ODM but that breaks existing code quickly
AnnotationRegistry::registerFile(__DIR__ . '/Mapping/Driver/DoctrineAnnotations.php');
$reader = new SimpleAnnotationReader();
$reader->addNamespace('Doctrine\\OXM\\Mapping');
$reader = new \Doctrine\Common\Annotations\CachedReader($reader, new \Doctrine\Common\Cache\ApcCache());
} else {
if (version_compare(\Doctrine\Common\Version::VERSION, '2.1.0-DEV', '>=')) {
// Register the ORM Annotations in the AnnotationRegistry
AnnotationRegistry::registerFile(__DIR__ . '/Mapping/Driver/DoctrineAnnotations.php');
$reader = new AnnotationReader();
$reader->setDefaultAnnotationNamespace('Doctrine\\OXM\\Mapping\\');
$reader->setIgnoreNotImportedAnnotations(true);
$reader->setEnableParsePhpImports(false);
$reader = new \Doctrine\Common\Annotations\CachedReader(new \Doctrine\Common\Annotations\IndexedReader($reader), new \Doctrine\Common\Cache\ApcCache());
} else {
$reader = new AnnotationReader();
$reader->setDefaultAnnotationNamespace('Doctrine\\OXM\\Mapping\\');
}
}
}
return new AnnotationDriver($reader, (array) $paths);
}