2009-02-17 11:01:34 +03:00
|
|
|
<?php
|
2009-05-29 18:46:53 +04:00
|
|
|
|
2009-09-11 23:50:48 +04:00
|
|
|
namespace Sandbox;
|
2009-09-01 12:18:36 +04:00
|
|
|
|
2009-09-11 23:50:48 +04:00
|
|
|
use Entities\User, Entities\Address;
|
|
|
|
|
|
|
|
require '../../lib/Doctrine/Common/GlobalClassLoader.php';
|
|
|
|
|
|
|
|
// Set up class loading, we could alternatively use 2 IsolatedClassLoaders
|
|
|
|
$classLoader = new \Doctrine\Common\GlobalClassLoader();
|
|
|
|
$classLoader->registerNamespace('Doctrine', realpath(__DIR__ . '/../../lib'));
|
|
|
|
$classLoader->registerNamespace('Entities', __DIR__);
|
|
|
|
$classLoader->register();
|
|
|
|
|
|
|
|
// Set up caches
|
|
|
|
$config = new \Doctrine\ORM\Configuration;
|
|
|
|
$cache = new \Doctrine\Common\Cache\ApcCache;
|
|
|
|
$config->setMetadataCacheImpl($cache);
|
|
|
|
$config->setQueryCacheImpl($cache);
|
|
|
|
|
|
|
|
// Database connection information
|
|
|
|
$connectionOptions = array(
|
|
|
|
'driver' => 'pdo_sqlite',
|
|
|
|
'path' => 'database.sqlite'
|
|
|
|
);
|
|
|
|
|
|
|
|
// Create EntityManager
|
|
|
|
$em = \Doctrine\ORM\EntityManager::create($connectionOptions, $config);
|
|
|
|
|
|
|
|
## PUT YOUR TEST CODE BELOW
|
|
|
|
|
|
|
|
$user = new User;
|
|
|
|
$address = new Address;
|
|
|
|
|
|
|
|
echo "Hello World!";
|