Ver Mensaje Individual
  #1 (permalink)  
Antiguo 06/03/2010, 08:50
niewpendejo
 
Fecha de Ingreso: agosto-2009
Mensajes: 138
Antigüedad: 14 años, 8 meses
Puntos: 0
Cargar Plugins en Zend framework

Estoy intentado cargar los plugins en zend framework pero no consigo cargarlo siempre me da el error de clase no encontrada , se que el error esta en el APPLICATION_PATH, y en el autoloader...he probado de mil maneras pero me he quedado atascado y no sale.

En el boostrap tengo:

Código PHP:
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
    protected function 
_initAutoload()
    {
       
$autoloader = new Zend_Application_Module_Autoloader(array(
                
'namespace' => 'My_',
                    
'basePath'  => APPLICATION_PATH '/library/My_',
                
'resourceTypes' => array(
                        
'forms'=>array('path'=>'Plugins_/',
                    
'namespace'=>'My_Plugins/')
                )
            )
        );
         
var_dump(APPLICATION_PATH);
    }


en el .ini hay.
Código:
[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
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
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"

autoloaderNamespaces[] = "Mis_"
resources.frontController.plugins.Primero = "My_Plugins_Primero"
y en el index esta:
Código 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') : 'production'));



set_include_path(implode(PATH_SEPARATOR, array(
    
realpath(APPLICATION_PATH '/../library'),
    
get_include_path(),
)));

require_once 
'Zend/Application.php';

// Create application, bootstrap, and run
$application = new Zend_Application(
    
APPLICATION_ENV,
    
APPLICATION_PATH '/configs/application.ini'
);
$application->bootstrap()
            ->
run(); 
y mi carpeta de plugins esta en .

A)-application

B)-libray
B.1-Zend
-library
B.2-MY
B.2.1-Plugins
-Primero.php
C-public


Saludos y espero esta ayudita...segurie probando para dar con la solucion

Última edición por niewpendejo; 07/03/2010 a las 04:32 Razón: Dar mas detalles