Ejemplo n.º 1
0
 /**
  * Initialize pseudo-namespaces,
  * auto-loader and resource groups
  *
  * @return void
  */
 protected function _initAutoloader()
 {
     $moduleLoader = new Zend_Application_Module_Autoloader(['namespace' => ucfirst('Default'), 'basePath' => APPLICATION_PATH . '/modules/default']);
     $moduleLoader->addResourceTypes(['controller' => ['namespace' => 'Controller', 'path' => 'controllers']]);
     $appResources = new Zend_Loader_Autoloader_Resource(['basePath' => APPLICATION_PATH, 'namespace' => 'App']);
     $appResources->addResourceTypes(['models' => ['namespace' => 'Model', 'path' => 'models']]);
 }
Ejemplo n.º 2
0
 /**
  * Initialize pseudo-namespaces,
  * auto-loader and resource groups
  *
  * @return void
  */
 protected function _initAutoloader()
 {
     $modules = ['default'];
     foreach ($modules as $module) {
         $moduleLoader = new Zend_Application_Module_Autoloader(['namespace' => ucfirst($module), 'basePath' => APPLICATION_PATH . '/modules/' . $module]);
         $moduleLoader->addResourceTypes(['controller' => ['namespace' => 'Controller', 'path' => 'controllers']]);
     }
     $appResources = new Zend_Loader_Autoloader_Resource(['basePath' => APPLICATION_PATH, 'namespace' => 'App']);
     $appResources->addResourceTypes(['exceptions' => ['namespace' => 'Exception', 'path' => 'exceptions'], 'mappers' => ['namespace' => 'Map', 'path' => 'mappers'], 'helpers' => ['namespace' => 'Helper', 'path' => 'helpers'], 'models' => ['namespace' => 'Model', 'path' => 'models'], 'plugins' => ['namespace' => 'Plugin', 'path' => 'plugins'], 'services' => ['namespace' => 'Service', 'path' => 'services']]);
 }
Ejemplo n.º 3
0
 /**
  * Configure the default modules autoloading, here we first create
  * a new module autoloader specifiying the base path and namespace
  * for our default module. This will automatically add the default
  * resource types for us. We also add two custom resources for Services
  * and Model Resources.
  */
 protected function X_initDefaultModuleAutoloader()
 {
     $this->_logger->info('Bootstrap ' . __METHOD__);
     //          $this->_resourceLoader = new Zend_Application_Module_Autoloader( array
     //               ( 'namespace' => 'Iads'
     //               , 'basePath'  => APPLICATION_PATH . '/modules/iads'
     //               ,
     //               )
     //          );
     $this->_resourceLoader->addResourceTypes(array('modelResource' => array('namespace' => 'Resource', 'path' => 'models/resources')));
 }
 /**
  * Configura os módulos
  */
 protected function _initAutoload()
 {
     $oIniConfig = new Zend_Config_Ini(APPLICATION_PATH . '/configs/application.ini');
     $aIniConfig = $oIniConfig->toArray();
     $aModules = array();
     if (isset($aIniConfig['production']['app']['module'])) {
         $aModules = $aIniConfig['production']['app']['module'];
     }
     // Estancia os modulos
     foreach ($aModules as $sModule => $sNamespace) {
         $oModule = new Zend_Application_Module_Autoloader(array('namespace' => (string) ucfirst($sNamespace), 'basePath' => APPLICATION_PATH . "/modules/{$sModule}"));
         $oModule->addResourceTypes(array('library' => array('path' => 'library/', 'namespace' => 'Lib'), 'dao' => array('path' => 'dao/', 'namespace' => 'Dao'), 'form' => array('path' => 'forms/', 'namespace' => 'Form'), 'model' => array('path' => 'models/', 'namespace' => 'Model'), 'interface' => array('path' => 'interfaces/', 'namespace' => 'Interface')));
     }
 }
Ejemplo n.º 5
0
 /**
  * This will autoload based on the folder structure to files
  * 
  * @return Zend_Application_Module_Autoloader
  */
 protected function _initAutoload()
 {
     $autoloader = new Zend_Application_Module_Autoloader(array('namespace' => 'Default_', 'basePath' => dirname(__FILE__)));
     $autoloader->addResourceTypes(array('Ifphp' => array('namespace' => 'Ifphp', 'path' => APPLICATION_PATH . '/../library')));
     return $autoloader;
 }
Ejemplo n.º 6
0
 protected function _initAutoload()
 {
     $moduleAutoloader = new Zend_Application_Module_Autoloader(array('namespace' => 'Backend', 'basePath' => realpath(dirname(__FILE__))));
     $moduleAutoloader->addResourceTypes(array('grids' => array('namespace' => 'Grid', 'path' => 'grids')));
 }
Ejemplo n.º 7
0
 * 
 * Copyright 2010 Université d'Avignon et des Pays de Vaucluse, Arnaud Didry and others.
 * 
 */
define('FZ_VERSION', '3.0-alpha');
/**
 * Loading Zend for i18n classes and autoloader
 */
set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lib' . PATH_SEPARATOR . dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'pear' . PATH_SEPARATOR . dirname(__FILE__) . DIRECTORY_SEPARATOR . 'plugins');
require_once 'Zend/Loader/Autoloader.php';
// Autoloading for Fz_* classes in lib/ dir
Zend_Loader_Autoloader::getInstance()->registerNamespace('Fz_');
// Autoloading for App_Model_* & App_Controller_* classes in app/ dir
//(automagicaly added to Zend autoloaders)
$autoloader = new Zend_Application_Module_Autoloader(array('namespace' => 'App', 'basePath' => 'app'));
$autoloader->addResourceTypes(array('controller' => array('namespace' => 'Controller', 'path' => 'controllers')));
/**
 * Configuration of the limonade framework. Automatically called by run()
 */
function configure()
{
    option('session', 'filez');
    // specific session name
    option('views_dir', option('root_dir') . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR);
    // Layout settings
    error_layout('layout' . DIRECTORY_SEPARATOR . 'error.html.php');
    layout('layout' . DIRECTORY_SEPARATOR . 'default.html.php');
    require_once_dir(option('lib_dir'));
    // error handling
    set_error_handler('fz_php_error_handler', E_ALL ^ E_NOTICE);
    // Log every error