I've got some problems with Doctrine 2 on my localhost. One page, which uses only one query, is loading on localhost in about 1.5s. Meanwhile, on remote server loading takes about 300ms (http://gieromaniak.pl/contact). I have no idea what could be wrong. Is it Doctrine 2 configuration or sth else? Or maybe I don't have some PHP extension on my server (WAMP - Apache 2.4.2, PHP 5.4.3)?
Nevertheless, I'm including source code of my Doctrine configuration file:
<?php
use Doctrine\Common\ClassLoader,
Doctrine\ORM\Configuration,
Doctrine\ORM\EntityManager,
Doctrine\DBAL\Types\Type,
Doctrine\Common\Cache\ArrayCache,
Doctrine\DBAL\Logging\EchoSqlLogger;
// include the class loader directly
require_once __DIR__ . '/Doctrine/Common/ClassLoader.php';
$doctrineClassLoader = new ClassLoader('Doctrine', __DIR__ . '/');
$doctrineClassLoader->register();
Config::load('base');
Config::load('database');
if(Config::get('base.mode') == 'development') {
$bProxyGen = TRUE;
} else {
$bProxyGen = FALSE;
}
// Set up caches
$cache = new ArrayCache;
$config = new Configuration;
$config->setMetadataCacheImpl($cache);
$config->setQueryCacheImpl($cache);
// Metadata Driver
$driverImpl = $config->newDefaultAnnotationDriver($models);
$config->setMetadataDriverImpl($driverImpl);
// Proxy configuration
$config->setProxyDir(PATH_ROOT.Config::get('database.proxy_dir'));
$config->setProxyNamespace(Config::get('database.proxy_namespace'));
$config->setAutoGenerateProxyClasses($bProxyGen);
// Database connection information
$connectionOptions = array(
'driver' => 'pdo_mysql',
'charset' => 'utf8',
'dbname' => 'dbname',
'user' => 'username',
'password' => 'password',
);
// Create EntityManager
$entityManager = EntityManager::create($connectionOptions, $config);
Thank You in advance for any help!