X-Git-Url: http://git.inspyration.org/?a=blobdiff_plain;f=vendor%2Fdoctrine%2Form%2Ftools%2Fsandbox%2Findex.php;fp=vendor%2Fdoctrine%2Form%2Ftools%2Fsandbox%2Findex.php;h=ad1cb9d6b1a6c586e0522a1f8420cedf5f891d5d;hb=8b04b2d11798dee4f3e1358e4f43e97a6df851f6;hp=0000000000000000000000000000000000000000;hpb=73568cf05a785a45f94ca3f2351d9e07bf917958;p=zf2.biz%2Fgalerie.git diff --git a/vendor/doctrine/orm/tools/sandbox/index.php b/vendor/doctrine/orm/tools/sandbox/index.php new file mode 100644 index 0000000..ad1cb9d --- /dev/null +++ b/vendor/doctrine/orm/tools/sandbox/index.php @@ -0,0 +1,62 @@ +register(); +$classLoader = new ClassLoader('Doctrine\DBAL', realpath(__DIR__ . '/../../lib/vendor/doctrine-dbal/lib')); +$classLoader->register(); +$classLoader = new ClassLoader('Doctrine\Common', realpath(__DIR__ . '/../../lib/vendor/doctrine-common/lib')); +$classLoader->register(); +$classLoader = new ClassLoader('Symfony', realpath(__DIR__ . '/../../lib/vendor')); +$classLoader->register(); +$classLoader = new ClassLoader('Entities', __DIR__); +$classLoader->register(); +$classLoader = new ClassLoader('Proxies', __DIR__); +$classLoader->register(); + +// Set up caches +$config = new Configuration; +$cache = new ApcCache; +$config->setMetadataCacheImpl($cache); +$driverImpl = $config->newDefaultAnnotationDriver(array(__DIR__."/Entities")); +$config->setMetadataDriverImpl($driverImpl); +$config->setQueryCacheImpl($cache); + +// Proxy configuration +$config->setProxyDir(__DIR__ . '/Proxies'); +$config->setProxyNamespace('Proxies'); +$config->setMetadataCacheImpl(new \Doctrine\Common\Cache\ArrayCache); + +// Database connection information +$connectionOptions = array( + 'driver' => 'pdo_sqlite', + 'path' => 'database.sqlite' +); + +// Create EntityManager +$em = EntityManager::create($connectionOptions, $config); + +## PUT YOUR TEST CODE BELOW + +$user = new User; +$address = new Address; + +echo 'Hello World!' . PHP_EOL;