Ver Mensaje Individual
  #4 (permalink)  
Antiguo 10/10/2011, 11:41
pixel1
 
Fecha de Ingreso: julio-2008
Ubicación: México
Mensajes: 150
Antigüedad: 16 años, 4 meses
Puntos: 4
Respuesta: Zend Framework y Doctrine

Sigo investigando para ver cual puede ser el error. Pego el codigo de

Application.ini
Código:
[production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
appnamespace = "Application"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 0

autoloaderNamespaces[] = "Doctrine"

; ------------------------------------------
; database
; ------------------------------------------
doctrine.dsn                = "mysql://root:@localhost/catalogozend"
doctrine.data_fixtures_path = APPLICATION_PATH "/configs/data/fixtures"
doctrine.sql_path           = APPLICATION_PATH "/configs/data/sql"
doctrine.migrations_path    = APPLICATION_PATH "/configs/migrations"
doctrine.yaml_schema_path   = APPLICATION_PATH "/configs/schema.yml"
doctrine.models_path        = APPLICATION_PATH "/models"

resources.view[]=
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"
[staging : production]

[testing : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1

[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1
Boostrap.php
Código PHP:
<?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
    protected function 
_initAppAutoload()
    {
        
$autoloader = new Zend_Application_Module_Autoloader(array(
            
'namespace' => 'catalogozend',
            
'basePath'  => dirname(__FILE__),
        ));
        return 
$autoloader;
    }

    protected function 
_initDoctrine()
    {
        
$this->getApplication()->getAutoloader()
                               ->
pushAutoloader(array('Doctrine''autoload'));
        
spl_autoload_register(array('Doctrine''modelsAutoload'));
        
$manager Doctrine_Manager::getInstance();
        
$manager->setAttribute(Doctrine::ATTR_AUTO_ACCESSOR_OVERRIDEtrue);
        
$manager->setAttribute(
            
Doctrine::ATTR_MODEL_LOADING,
            
Doctrine::MODEL_LOADING_CONSERVATIVE
        
);
        
$manager->setAttribute(Doctrine::ATTR_AUTOLOAD_TABLE_CLASSEStrue);

        
$doctrine $this->getOption('doctrine');
        
$conn Doctrine_Manager::connection($doctrine['dsn'], 'doctrine');
        
Doctrine::loadModels($doctrine["models_path"]);  
        
$conn->setAttribute(Doctrine::ATTR_USE_NATIVE_ENUMtrue);
        return 
$conn;
    }

}
Index.php
Código PHP:
<?php

// Define path to application directory
defined('APPLICATION_PATH')
    || 
define('APPLICATION_PATH'realpath(dirname(__FILE__) . '/../application'));

// Define application environment
defined('APPLICATION_ENV')
    || 
define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'development'));

// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
    
realpath(APPLICATION_PATH '/../library'),
    
get_include_path(),
)));

/** Zend_Application */
require_once 'Zend/Application.php';

// Create application, bootstrap, and run
$application = new Zend_Application(
    
APPLICATION_ENV,
    
APPLICATION_PATH '/configs/application.ini'
);
$application->bootstrap()
            ->
run();
__________________
Blog blog.desarrollandoideas.com

Twitter
Sígueme en Twitter