Ver Mensaje Individual
  #1 (permalink)  
Antiguo 05/03/2013, 14:52
wilmer30
 
Fecha de Ingreso: enero-2010
Mensajes: 491
Antigüedad: 14 años, 3 meses
Puntos: 12
Doctrine 2.1.7 y zf 1.12

Hola:

he instalado Doctrine en C:\xampp\htdocs\biblioteca\library:
Cita:
bin
- cli-config.php
- doctrine
- doctrine.php
- doctrine.bat
Doctrine
- Common
- DBAL
- ORM
- Symfony
el cli-config.php es:
Código PHP:
Ver original
  1. require_once '/../Doctrine/Common/ClassLoader.php';
  2.  
  3. $classLoader = new \Doctrine\Common\ClassLoader('Doctrine\ORM', realpath(__DIR__));
  4. $classLoader->register();
  5. $classLoader = new \Doctrine\Common\ClassLoader('Doctrine\DBAL', realpath(__DIR__));
  6. $classLoader->register();
  7. $classLoader = new \Doctrine\Common\ClassLoader('Doctrine\Common', realpath(__DIR__));
  8. $classLoader->register();
  9. $classLoader = new \Doctrine\Common\ClassLoader('Symfony', realpath(__DIR__));
  10. $classLoader->register();
  11. $classLoader = new \Doctrine\Common\ClassLoader('Entities', __DIR__);
  12. $classLoader->register();
  13. $classLoader = new \Doctrine\Common\ClassLoader('Proxies', __DIR__);
  14. $classLoader->register();
  15.  
  16. $config = new \Doctrine\ORM\Configuration();
  17. $config->setMetadataCacheImpl(new \Doctrine\Common\Cache\ArrayCache);
  18. $driverImpl = $config->newDefaultAnnotationDriver(array(__DIR__."/Entities"));
  19. $config->setMetadataDriverImpl($driverImpl);
  20.  
  21. $config->setProxyDir(__DIR__ . '/Proxies');
  22. $config->setProxyNamespace('Proxies');
  23.  
  24. /*$connectionOptions = array(
  25.         'driver' => 'pdo_sqlite',
  26.         'path' => 'database.sqlite'
  27. );*/
  28. $dbParams = array(
  29.         'driver'   => 'pdo_mysql',
  30.         'user'     => 'root',
  31.         'password' => '',
  32.         'dbname'   => 'biblioteca',
  33. );
  34.  
  35. $em = \Doctrine\ORM\EntityManager::create($dbParams, $config);
  36.  
  37. $helpers = new Symfony\Component\Console\Helper\HelperSet(array(
  38.         'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()),
  39.         'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em)
  40. ));
la ejecución de 'php doctrine' no tiene ningun problema, pero cuando ejecuto: 'php doctrine orm:schema-tool:create' me lanza lo siguiente:
Cita:
[Doctrine\ORM\Mapping\MappingException]

File mapping drivers must have a valid directory path, however the given path
[C:\xampp\htdocs\biblioteca\library\bin/Entities] seems to be incorrect!
no se cuanto tenga que ver el siguiente comando 'php cli-config.php' me da esto:
Cita:
Warning: require(C:\xampp\htdocs\biblioteca\library\bin\Doc trine\ORM\Configuration.php): failed to open stream: No such file or directory in C:\xampp\htdocs\biblioteca\library\Doctrine\Common \ClassLoader.php on line 148

Fatal error: require(): Failed opening required 'C:\xampp\htdocs\biblioteca\library\bin\Doctrine\O RM\Configuration.php' (include_path='.;C:\xampp\php\library;C:\xampp\php \PEAR') in C:\xampp\htdocs\biblioteca\library\Doctrine\Common \ClassLoader.php on line 148
Quisiera aprender más sobre ORM, agradecería su ayuda.