Ver Mensaje Individual
  #1 (permalink)  
Antiguo 27/12/2010, 12:48
niewpendejo
 
Fecha de Ingreso: agosto-2009
Mensajes: 138
Antigüedad: 14 años, 8 meses
Puntos: 0
Integrar Doctrine 2 con Zend framework

hola buenas tardes, estoy intentando integrar doctrine 2 con zend framework , he leido varias documentacions y no consigo ejecutar...

Estoy siguiendo este manual para poder usar Zend tool con Doctrine:

http://christian.soronellas.es/2010/...-y-doctrine-2/
http://christian.soronellas.es/2010/...octrine-2-cli/

Ahora cuando hago Zf show version por ejemplo , salta este warning.

PHP Warning: include_once(Doctrine\Zend\Tool\Project\Provider\D octrineConfigProvider.php): failed to open stream: No such file or directory in C:\Arc
hivos de programa\Apache Software Foundation\Apache2.2\htdocs\zf\library\Zend\Loader .php on line 146

En la carpeta library/bin...
Tengo doctrine.php configurado asi.
Código PHP:
$lib ='C:/Archivos de programa/Apache Software Foundation/Apache2.2/htdocs/zf/library/';
require_once 
'C:/Archivos de programa/Apache Software Foundation/Apache2.2/htdocs/zf/library/Doctrine/Common/ClassLoader.php';
$classLoader = new DoctrineCommonClassLoader('Doctrine\Common'$lib);
$classLoader->register();

$classLoader = new DoctrineCommonClassLoader('C:/Archivos de programa/Apache Software Foundation/Apache2.2/htdocs/zf/library/Doctrine');
$classLoader->register();

$classLoader = new DoctrineCommonClassLoader('Doctrine\ORM'$lib);
$classLoader->register();

$classLoader = new DoctrineCommonClassLoader('Doctrine\DBAL'$lib);
$classLoader->register();


$classLoader = new DoctrineCommonClassLoader('Doctrine\Symfony''C:/Archivos de programa/Apache Software Foundation/Apache2.2/htdocs/zf/library/Doctrine');
$classLoader->register();

$configFile getcwd() . DIRECTORY_SEPARATOR 'cli-config.php';

$helperSet null;
if (
file_exists($configFile)) {
    if ( ! 
is_readable($configFile)) {
        
trigger_error(
            
'Configuration file [' $configFile '] does not have read permission.'E_ERROR
        
);
    }

    require 
$configFile;

    foreach (
$GLOBALS as $helperSetCandidate) {
        if (
$helperSetCandidate instanceof SymfonyComponentConsoleHelperHelperSet) {
            
$helperSet $helperSetCandidate;
            break;
        }
    }
}

$helperSet = ($helperSet) ?: new SymfonyComponentConsoleHelperHelperSet();

DoctrineORMToolsConsoleConsoleRunner::run($helperSet); 
Aqui salta el warning :

Fatal error: Class 'Symfony\Component\Console\Helper\HelperSet' not found in C:\Archivos de programa\Apache Software Foundation\Apache2.2\htdocs\zf\library\bin\cli-config.php on line 26


y el cli-config.php asi.
Código PHP:
require_once 'C:/Archivos de programa/Apache Software Foundation/Apache2.2/htdocs/zf/library/Doctrine/Common/ClassLoader.php';

$classLoader = new DoctrineCommonClassLoader('Application\Models'dirname(dirname(dirname(__FILE__))));
$classLoader->register();

$classLoader = new DoctrineCommonClassLoader('Application\Models\Proxies'dirname(dirname(dirname(__FILE__))));
$classLoader->register();

$config = new DoctrineORMConfiguration();
$cache = new DoctrineCommonCacheArrayCache();
$config->setMetadataCacheImpl($cache);
$driverImpl $config -> newDefaultAnnotationDriver(dirname(dirname(dirname(__FILE__))) . '/application/models');
$config->setMetadataDriverImpl($driverImpl);
$config->setProxyDir(dirname(dirname(dirname(__FILE__))) . '/application/models/proxies');
$config->setProxyNamespace('Application\Models\Proxies');

$connectionOptions = array(
    
'driver' => 'pdo_mysql',
    
'path' => dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR implode(DIRECTORY_SEPARATOR, array('data''db''database-dev.db'))
);

$em DoctrineORMEntityManager::create($connectionOptions$config);

$helperSet = new SymfonyComponentConsoleHelperHelperSet(array(
    
'db' => new DoctrineDBALToolsConsoleHelperConnectionHelper($em->getConnection()),
    
'em' => new DoctrineORMToolsConsoleHelperEntityManagerHelper($em)
)); 
Muchas gracias si alguien ha sabe como integrar doctrine con zend, aunq no haga falta el zend tool, podria ayudarme , muchas gracias