http://doctrine-orm.readthedocs.org/en/lat...figuration.html
zastanawia mnie do czego ma prowadzic ta sciezka:
/path/to/entity-files
/path/to/entity-files
Warning: require(/\Doctrine\ORM\Configuration.php): failed to open stream: No such file or directory in C:\xampp\htdocs\doctrine\Doctrine\Common\ClassLoader.php on line 182 Fatal error: require(): Failed opening required '/\Doctrine\ORM\Configuration.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\doctrine\Doctrine\Common\ClassLoader.php on line 182
<?php use Doctrine\Common\ClassLoader, Doctrine\ORM\Configuration, Doctrine\ORM\EntityManager, Doctrine\Common\Cache\ArrayCache, Doctrine\DBAL\Logging\EchoSQLLogger; class Doctrine{ public $em = null; public function __construct() { require_once 'Doctrine/Common/ClassLoader.php'; $doctrineClassLoader = new ClassLoader('Doctrine', '/'); $doctrineClassLoader->register(); $entitiesClassLoader = new ClassLoader('models', '/models/'); $entitiesClassLoader->register(); $proxiesClassLoader = new ClassLoader('Proxies', '/proxies/'); $proxiesClassLoader->register(); // Set up caches $config = new Configuration; $cache = new ArrayCache; $config->setMetadataCacheImpl($cache); $config->setMetadataDriverImpl($driverImpl); $config->setQueryCacheImpl($cache); $config->setQueryCacheImpl($cache); // Proxy configuration $config->setProxyDir('/proxies'); $config->setProxyNamespace('Proxies'); // Set up logger $logger = new EchoSQLLogger; //$config->setSQLLogger($logger); $config->setAutoGenerateProxyClasses( TRUE ); // Database connection information 'driver' => 'pdo_mysql', 'user' => 'root', 'password' => '', 'host' => 'localhost', 'dbname' => 'baza' ); // Create EntityManager $this->em = EntityManager::create($connectionOptions, $config); } }
<?php require "doctrine.php"; $doctrine = new Doctrine(); $user = new models\User; $doctrine->em->persist($user); $doctrine->em->flush(); ?>