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 originalrequire_once '/../Doctrine/Common/ClassLoader.php';
$classLoader = new \Doctrine\Common\ClassLoader
('Doctrine\ORM', realpath(__DIR__
)); $classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader
('Doctrine\DBAL', realpath(__DIR__
)); $classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader
('Doctrine\Common', realpath(__DIR__
)); $classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader
('Symfony', realpath(__DIR__
)); $classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader('Entities', __DIR__);
$classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader('Proxies', __DIR__);
$classLoader->register();
$config = new \Doctrine\ORM\Configuration();
$config->setMetadataCacheImpl(new \Doctrine\Common\Cache\ArrayCache);
$driverImpl = $config->newDefaultAnnotationDriver(array(__DIR__
."/Entities")); $config->setMetadataDriverImpl($driverImpl);
$config->setProxyDir(__DIR__ . '/Proxies');
$config->setProxyNamespace('Proxies');
/*$connectionOptions = array(
'driver' => 'pdo_sqlite',
'path' => 'database.sqlite'
);*/
'driver' => 'pdo_mysql',
'user' => 'root',
'password' => '',
'dbname' => 'biblioteca',
);
$em = \Doctrine\ORM\EntityManager::create($dbParams, $config);
$helpers = new Symfony\Component\Console\Helper\HelperSet
(array( 'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()),
'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em)
));
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.