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
 protected function _initAutoload()
 {
     $autoloader = new Zend_Application_Module_Autoloader(array('namespace' => 'Gasestema', 'basePath' => dirname(__FILE__)));
     $autoloader->addResourceType('exception', 'exceptions', 'Exception');
     $autoloader->addResourceType('auth', 'auth', 'Auth');
     $autoloader->addResourceType('paginator', 'paginator', 'Paginator');
     return $autoloader;
 }
Ejemplo n.º 3
0
 protected function _initAppAutoload()
 {
     $loader = new Zend_Application_Module_Autoloader(['namespace' => '', 'basePath' => APPLICATION_PATH]);
     $loader->addResourceType('form', 'forms', 'Form')->addResourceType('model', 'models', 'Model')->addResourceType('dbtable', 'models/DbTable', 'Model_DbTable');
     $autoloader = Zend_Loader_Autoloader::getInstance();
     $autoloader->registerNamespace(["App_"]);
     return $loader;
 }
Ejemplo n.º 4
0
 public function _initServicesAndMappers()
 {
     $loader = new Zend_Application_Module_Autoloader(array('namespace' => 'Application', 'basePath' => APPLICATION_PATH));
     $loader->addResourceType('mapper', 'models/Mapper', 'Model_Mapper');
     $loader->addResourceType('service', 'models/Service', 'Model_Service');
     return $loader;
     return $resourceLoader;
 }
Ejemplo n.º 5
0
 /**
  * Cria uma instancia do Autoloader
  */
 protected function _initAutoloader()
 {
     $loader = new Zend_Application_Module_Autoloader(array('namespace' => '', 'basePath' => APPLICATION_PATH));
     $loader->addResourceType('acl', 'acls', 'Acl');
     $loader->addResourceType('validate', 'validators/', 'App_Validate_');
     $autoloader = Zend_Loader_Autoloader::getInstance();
     $autoloader->suppressNotFoundWarnings(false);
     $autoloader->setFallbackAutoloader(true);
 }
Ejemplo n.º 6
0
    /**
     * Auto load default module classes
     *
     * @author          Eddie Jaoude
     * @param           void
     * @return           object $moduleLoader
     *
     */
    protected function _initAutoload() {
        $moduleLoader = new Zend_Application_Module_Autoloader(array(
                    'namespace' => 'Auth_',
                    'basePath' => APPLICATION_PATH . '/modules/auth'));
        
        $moduleLoader->addResourceType('controllerhelper',
            'controllers/helpers', 'Controller_Helper');

        return $moduleLoader;
    }
Ejemplo n.º 7
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.º 8
0
 /**
  * Make the dispatcher prefix the default module
  */
 protected function _initFrontControllerSettings()
 {
     $this->bootstrap('frontController');
     $this->frontController->setResponse(new Zend_Controller_Response_Http());
     $this->frontController->setRequest(new Zend_Controller_Request_Http());
     $autoloader = Zend_Loader_Autoloader::getInstance();
     $autoloader->registerNamespace('App_');
     $front = Zend_Controller_Front::getInstance();
     $front->registerPlugin(new App_Plugin_Acl($front->getRequest()));
     $front->registerPlugin(new App_Controller_Plugin_Layout_Module($front->getRequest()));
 }
 protected function _initAutoload()
 {
     $this->options = $this->getOptions();
     Zend_Registry::set('config.recaptcha', $this->options['recaptcha']);
     Zend_Registry::set('config.message', $this->options['message']);
     $db = Zend_Db::factory('PDO_MYSQL', $this->options['db']);
     Zend_Db_Table_Abstract::setDefaultAdapter($db);
     $resourceLoader = new Zend_Application_Module_Autoloader(array('basePath' => APPLICATION_PATH . '/modules/admin', 'namespace' => 'Admin'));
     $resourceLoader->addResourceType('acl', 'acls/', 'Acl');
     $resourceLoader->addResourceType('acl_plugin', 'acls/plugins/', 'Acl_Plugin');
     $resourceLoader->addResourceType('filter', 'filters/', 'Filter');
     return $resourceLoader;
 }
Ejemplo n.º 10
0
 /**
  * Basic setup of module support and layout support.
  *
  * @return void
  */
 protected function _initBasicConfig()
 {
     // Set the timezone default
     date_default_timezone_set('Europe/London');
     //configure the front controller to use modules and throw exceptions
     Zend_Controller_Front::getInstance()->addModuleDirectory(APPLICATION_PATH . '/modules')->throwExceptions(true);
     // Configure the app namespace
     $this->setAppNamespace('Application');
     // create the app space autoloader
     $autoloader = new Zend_Application_Module_Autoloader(array('basePath' => APPLICATION_PATH, 'namespace' => 'Application'));
     $autoloader->addResourceType('table', 'tables', 'Table');
     //configure zend_layout
     Zend_Layout::startMvc(array('layoutPath' => APPLICATION_PATH . '/layouts/scripts'));
 }
 /**
  * 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')));
     }
 }
    /**
     * Bootstrap autoloader for application resources
     * 
     * @return Zend_Application_Module_Autoloader
     */
    protected function _initAutoload()
    {
        $autoloader = new Zend_Application_Module_Autoloader(array(
            'namespace' => 'Default',
            'basePath'  => dirname(__FILE__),
        ));

        // set up applicatio/validates as a place where the autoloader will
        // look. Forms has similar support baked in and would traditionally
        // have been the mechanism through which validates are used in MVC.
        // However with REST design forms aren't useful but validates are.
        $autoloader->addResourceType('validate', 'validates', 'Validate');
        
        return $autoloader;
    }
 public function routeStartup(Zend_Controller_Request_Abstract $request)
 {
     $front = Zend_Controller_Front::getInstance();
     $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
     if (!isset($viewRenderer->view)) {
         $viewRenderer->initView();
     }
     $view = $viewRenderer->view;
     foreach ($front->getControllerDirectory() as $moduleName => $controllerPath) {
         $loader = new Zend_Application_Module_Autoloader(array('namespace' => ucfirst($moduleName), 'basePath' => dirname($controllerPath)));
         $loader->addResourceType('controller', 'controllers', 'Controller');
         $loader->addResourceType('constant', 'constants', 'Constant');
         $loader->addResourceType('php', 'phps', 'Php');
         $loader->addResourceType('validate', 'validates', 'Validate');
         $loader->addResourceType('module_helper', 'helpers', 'Helper');
         $loader->addResourceType('helper', 'controllers/helpers', 'Controller_Helper');
         Zend_Controller_Action_HelperBroker::addPath($controllerPath . DS . 'helpers', ucfirst($moduleName) . '_Controller_Helper_');
         $viewHelpers = array('View' => dirname($controllerPath) . DS . 'views' . DS . 'helpers', 'Display' => dirname($controllerPath) . DS . 'display' . DS . 'helpers');
         foreach ($viewHelpers as $directory => $viewHelper) {
             if (is_dir($viewHelper)) {
                 $view->addHelperPath($viewHelper);
                 $prefix = ucfirst($moduleName) . '_' . $directory . '_Helper';
                 $view->addHelperPath($viewHelper, $prefix);
             }
         }
     }
 }
 protected function _initAutoload()
 {
     $autoloader = new Zend_Application_Module_Autoloader(array('basePath' => dirname(__FILE__), 'namespace' => 'Library_'));
     $autoloader->removeResourceType('dbtable');
     $autoloader->removeResourceType('model');
     $autoloader->addResourceType('facade', 'business/facades', 'Business_Facade');
     $autoloader->addResourceType('datamapper', 'business/datamappers', 'Business_DataMapper');
     $autoloader->addResourceType('dbtable', 'business/dbtable', 'Business_DbTable');
     $autoloader->addResourceType('model', 'business/models', 'Business_Model');
     return $autoloader;
 }
Ejemplo n.º 15
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')));
 }
Ejemplo n.º 16
0
 /**
  * Fungsi untuk inisialisasi autoload
  */
 protected function _initAutoload()
 {
     // Create an autoloader that will enable us to automatically load resources
     $moduleLoader = new Zend_Application_Module_Autoloader(array('namespace' => '', 'basePath' => APPLICATION_PATH));
     Zend_Controller_Action_HelperBroker::addPrefix('Budpar_Action_Helper');
     $moduleLoader->addResourceType('library', '../library/Budpar/', 'Budpar');
     $moduleLoader->addResourceType('adminLibrary', 'modules/admin/library', 'Library_');
     $moduleLoader->addResourceType('adminForms', 'modules/admin/forms', 'Admin_Form_');
     $moduleLoader->addResourceType('adminModels', 'modules/admin/models', 'Admin_Model_');
     return $moduleLoader;
 }
Ejemplo n.º 17
0
 /**
  * Инициализация автозагрузки
  */
 protected function _initAutoload()
 {
     $loader = new Zend_Application_Module_Autoloader(array('namespace' => '', 'basePath' => APPLICATION_PATH));
     $loader->addResourceType('classes_type', 'classes', 'Class');
 }
Ejemplo n.º 18
0
 public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request)
 {
     $moduleLoader = new Zend_Application_Module_Autoloader(array('namespace' => '', 'basePath' => APPLICATION_PATH));
     switch ($request->getModuleName()) {
         case 'admin':
             $moduleLoader->addResourceType('adminLibrary', 'modules/admin/library', 'Library_');
             $moduleLoader->addResourceType('adminForms', 'modules/admin/forms', 'Admin_Form_');
             break;
         case 'manage':
             $moduleLoader->addResourceType('manageLibrary', 'modules/manage/library', 'Manage_');
             $moduleLoader->addResourceType('manageForms', 'modules/manage/models/forms', 'Manage_Model_Form_');
             $moduleLoader->addResourceType('manageTable', 'modules/manage/models/DbTable', 'Manage_Model_DbTable_');
             $moduleLoader->addResourceType('manageObject', 'modules/manage/models/object', 'Manage_Model_Object_');
             $moduleLoader->addResourceType('manageTools', 'modules/manage/models/tools', 'Manage_Model_Tools_');
             $moduleLoader->addResourceType('miceLibrary', 'modules/mice/library', 'Mice_');
             $moduleLoader->addResourceType('miceTable', 'modules/mice/models/DbTable', 'Mice_Model_DbTable_');
             break;
         case 'mice':
             $moduleLoader->addResourceType('miceLibrary', 'modules/mice/library', 'Mice_');
             $moduleLoader->addResourceType('miceTable', 'modules/mice/models/DbTable', 'Mice_Model_DbTable_');
             break;
     }
 }
Ejemplo n.º 19
0
 /**
  * Start Autoloader
  *
  * @access protected
  * @return Zend_Application_Module_Autoloader
  */
 protected function _initAutoload()
 {
     $autoloader = new Zend_Application_Module_Autoloader(array('namespace' => '', 'basePath' => dirname(__FILE__)));
     $autoloader->addResourceType('objects', 'models/objects/', 'Model');
     $autoloader->addResourceType('managers', 'models/managers/', 'Manager');
     $autoloader->addResourceType('datasources', 'models/datasources/', 'Datasource');
     $autoloader->addResourceType('services', 'models/services/', 'Service');
     $autoloader->addResourceType('authentication', 'models/authentication/', 'Auth');
     $autoloader->addResourceType('forms', 'forms/', 'Form');
     // $autoloader->addResourceType('subforms', 'subforms/', 'Subform');
     return $autoloader;
 }
Ejemplo n.º 20
0
 /**
  * Initialize default resource types for module resource classes.
  * @return void
  */
 public function initDefaultResourceTypes()
 {
     parent::initDefaultResourceTypes();
     $this->addResourceTypes(array('controllershelpers' => array('namespace' => 'Controller_Action_Helper', 'path' => 'controllers/helpers'), 'signals' => array('namespace' => 'Signal', 'path' => 'signals'), 'traits' => array('namespace' => 'Traits', 'path' => 'traits'), 'routes' => array('namespace' => 'Route', 'path' => 'routes'), 'tests' => array('namespace' => 'Test', 'path' => 'tests')));
 }
Ejemplo n.º 21
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.º 22
0
 /**
  * Bootstrap autoloader for application resources
  * 
  * @return Zend_Application_Module_Autoloader
  */
 protected function _initAutoload()
 {
     $autoloader = new Zend_Application_Module_Autoloader(array('namespace' => 'Default', 'basePath' => dirname(__FILE__)));
     $autoloader->addResourceType('dao', 'models/Daos/', 'Dao')->addResourceType('dto', 'models/Dtos/', 'Dto')->addResourceType('helper', 'helpers/', 'Helper');
     return $autoloader;
 }
 protected function _initAutoloaders()
 {
     $this->bootstrap('config');
     $autoloader = Zend_Loader_Autoloader::getInstance();
     $moduleAutoloader = new Zend_Application_Module_Autoloader(array('namespace' => '', 'basePath' => dirname(__FILE__)));
     $moduleAutoloader->addResourceType('infra', 'Infra', 'Infra');
     $autoloader->pushAutoloader($moduleAutoloader);
     $autoloader->pushAutoloader(new Infra_InfraLoader());
     $baseSettings = Zend_Registry::get('config')->settings;
     $clientBasePath = $baseSettings->basePath;
     $clientAutoloader = new Zend_Application_Module_Autoloader(array('namespace' => '', 'basePath' => $clientBasePath));
     $clientAutoloader->addResourceType('kaltura', 'lib/Kaltura', 'Kaltura');
     $autoloader->pushAutoloader($clientAutoloader);
     //		$autoloader->pushAutoloader(new Infra_ClientLoader());
 }
Ejemplo n.º 24
0
 * @section Copyright
 * 
 * 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);
Ejemplo n.º 25
0
 protected function _initAutoloaders()
 {
     $autoloader = Zend_Loader_Autoloader::getInstance();
     $config = $this->getConfig();
     $moduleAutoloader = new Zend_Application_Module_Autoloader(array('namespace' => '', 'basePath' => dirname(__FILE__)));
     $moduleAutoloader->addResourceType('infra', 'Infra', 'Infra');
     $autoloader->pushAutoloader($moduleAutoloader);
     $autoloader->pushAutoloader(new Infra_InfraLoader($config->settings));
     $clientAutoloader = new Zend_Application_Module_Autoloader(array('namespace' => '', 'basePath' => APPLICATION_PATH));
     $clientAutoloader->addResourceType('kaltura', 'lib/Kaltura', 'Kaltura');
     $autoloader->pushAutoloader($clientAutoloader);
 }
Ejemplo n.º 26
0
 /**
  * Imposta l'auto-load per le classi della libreria Zwe.
  * @return Zend_Application_Module_Autoloader
  */
 protected function _initAppAutoload()
 {
     $Autoloader = new Zend_Application_Module_Autoloader(array('namespace' => 'App', 'basePath' => __DIR__));
     $Autoloader->addResourceType('zwe', dirname(__DIR__) . '/library/Zwe', 'Zwe');
     return $Autoloader;
 }
Ejemplo n.º 27
0
 /**
  * Initialize default resource types for module resource classes
  * 
  * @return void
  */
 public function initDefaultResourceTypes()
 {
     parent::initDefaultResourceTypes();
     $basePath = $this->getBasePath();
     $this->addResourceTypes(array('job' => array('namespace' => 'Job', 'path' => 'Alanstormdotcom/Job')));
 }
Ejemplo n.º 28
0
 protected function _initAutoload()
 {
     $moduleLoader = new Zend_Application_Module_Autoloader(array('namespace' => '', 'basePath' => APPLICATION_PATH));
     $moduleLoader->addResourceType('twig', '../library/Twig', 'Twig');
     return $moduleLoader;
 }
Ejemplo n.º 29
0
 protected function _initAutoloaders()
 {
     $autoloader = Zend_Loader_Autoloader::getInstance();
     $moduleAutoloader = new Zend_Application_Module_Autoloader(array('namespace' => '', 'basePath' => dirname(__FILE__)));
     $moduleAutoloader->addResourceType('kaltura', 'lib/Kaltura', 'Kaltura');
     $autoloader->pushAutoloader($moduleAutoloader);
     $autoloader->pushAutoloader(new Kaltura_ClientLoader());
     $autoloader->pushAutoloader(new Kaltura_InfraLoader());
 }
Ejemplo n.º 30
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')));
 }