Esempio n. 1
0
 public function getItemTable($type)
 {
     if ($type == 'event_album') {
         return Engine_Loader::getInstance()->load('Ynevent_Model_DbTable_Albums');
     } else {
         if ($type == 'event_category') {
             return Engine_Loader::getInstance()->load('Ynevent_Model_DbTable_Categories');
         } else {
             if ($type == 'event_post') {
                 return Engine_Loader::getInstance()->load('Ynevent_Model_DbTable_Posts');
             } else {
                 if ($type == 'event_topic') {
                     return Engine_Loader::getInstance()->load('Ynevent_Model_DbTable_Topics');
                 } else {
                     if ($type == 'event_photo') {
                         return Engine_Loader::getInstance()->load('Ynevent_Model_DbTable_Photos');
                     } else {
                         if ($type == 'event_sponsor') {
                             return Engine_Loader::getInstance()->load('Ynevent_Model_DbTable_Sponsors');
                         } else {
                             if ($type == 'event_agent') {
                                 return Engine_Loader::getInstance()->load('Ynevent_Model_DbTable_Agents');
                             } else {
                                 $class = Engine_Api::_()->getItemTableClass($type);
                                 return Engine_Api::_()->loadClass($class);
                             }
                         }
                     }
                 }
             }
         }
     }
 }
Esempio n. 2
0
 public function getItemTable($type)
 {
     if ($type == 'group') {
         return Engine_Loader::getInstance()->load('Advgroup_Model_DbTable_Groups');
     } else {
         $class = Engine_Api::_()->getItemTableClass($type);
         return Engine_Api::_()->loadClass($class);
     }
 }
Esempio n. 3
0
 public function getItemTable($type)
 {
     if ($type == 'blog_category') {
         return Engine_Loader::getInstance()->load('Ynblog_Model_DbTable_Categories');
     } else {
         if ($type == 'blog') {
             return Engine_Loader::getInstance()->load('Ynblog_Model_DbTable_Blogs');
         } else {
             $class = Engine_Api::_()->getItemTableClass($type);
             return Engine_Api::_()->loadClass($class);
         }
     }
 }
Esempio n. 4
0
 public function __construct($options)
 {
     if ($options instanceof Zend_Config) {
         $options = $options->toArray();
     }
     if (!is_array($options)) {
         // require_once 'Zend/Loader/Exception.php';
         throw new Zend_Loader_Exception('Options must be passed to resource loader constructor');
     }
     $this->setOptions($options);
     $namespace = $this->getNamespace();
     if (null === $namespace || null === $this->getBasePath()) {
         // require_once 'Zend/Loader/Exception.php';
         throw new Zend_Loader_Exception('Resource loader requires both a namespace and a base path for initialization');
     }
     if (!empty($namespace)) {
         $namespace .= '_';
     }
     Engine_Loader::getInstance()->register(trim($namespace, '_'), $this->getBasePath());
     //Zend_Loader_Autoloader::getInstance()->unshiftAutoloader($this, $namespace);
 }
Esempio n. 5
0
 public function __construct($application, $options = null)
 {
     // Set application
     $this->setApplication($application);
     // Set custom module options (for dynamic bootstrapping)
     if (is_array($options)) {
         $this->setOptions($options);
     }
     // Use same plugin loader as parent bootstrap
     if ($application instanceof Zend_Application_Bootstrap_ResourceBootstrapper) {
         $this->setPluginLoader($application->getPluginLoader());
     }
     // Get the options from config
     $key = strtolower($this->getModuleName());
     if ($application->hasOption($key)) {
         // Don't run via setOptions() to prevent duplicate initialization
         $this->setOptions($application->getOption($key));
     }
     // Init resource loader
     if ($application->hasOption('resourceloader')) {
         $this->setOptions(array('resourceloader' => $application->getOption('resourceloader')));
     }
     //$this->initResourceLoader();
     Engine_Loader::getInstance()->register($this->getModuleName(), $this->getModulePath());
     $isDefaultModule = get_class($this->getApplication()) === 'Zend_Application';
     // ZF-6545: ensure front controller resource is loaded
     if (!$isDefaultModule && !$this->hasPluginResource('FrontController')) {
         $this->registerPluginResource('FrontController');
     }
     // ZF-6545: prevent recursive registration of modules
     if (!$isDefaultModule && $this->hasPluginResource('Modules')) {
         $this->unregisterPluginResource('Modules');
     }
     // Register with Engine_Api
     Engine_Api::_()->setModuleBootstrap($this);
     // Run internal hook
     $this->preBootstrap();
 }
Esempio n. 6
0
File: Api.php Progetto: robeendey/ce
 /**
  * Loads a singleton instance of a module resource using a full class name
  *
  * @param string $class The class name
  * @return mixed The requested singleton object
  */
 public function loadClass($class)
 {
     return Engine_Loader::getInstance()->load($class);
 }
Esempio n. 7
0
                    define('_ENGINE_R_MAIN', 'mobile.php');
                    define('_ENGINE_R_INIT', true);
                } else {
                    define('_ENGINE_R_MAIN', false);
                    define('_ENGINE_R_INIT', true);
                }
            }
        }
    }
}
// Boot
if (_ENGINE_R_INIT) {
    // Application
    require_once 'Engine/Loader.php';
    require_once 'Engine/Application.php';
    Engine_Loader::getInstance()->register('Zend', APPLICATION_PATH_COR . DS . 'libraries' . DS . 'Zend')->register('Engine', APPLICATION_PATH_COR . DS . 'libraries' . DS . 'Engine')->register('Facebook', APPLICATION_PATH_COR . DS . 'libraries' . DS . 'Facebook')->register('Plugin', APPLICATION_PATH_COR . DS . 'plugins')->register('Widget', APPLICATION_PATH_COR . DS . 'widgets');
    // Create application, bootstrap, and run
    $application = new Engine_Application(APPLICATION_ENV, array('bootstrap' => array('path' => APPLICATION_PATH_COR . DS . 'modules' . DS . APPLICATION_NAME . DS . 'Bootstrap.php', 'class' => ucfirst(APPLICATION_NAME) . '_Bootstrap')));
    Engine_Api::getInstance()->setApplication($application);
}
// config mode
if (defined('_ENGINE_R_CONF') && _ENGINE_R_CONF) {
    return;
}
if (!empty($_SERVER['_ENGINE_TRACE_ALLOW']) && extension_loaded('xdebug')) {
    xdebug_start_trace();
}
// Sub apps
if (_ENGINE_R_MAIN) {
    require dirname(__FILE__) . DS . _ENGINE_R_MAIN;
    exit;
Esempio n. 8
0
 /**
  * Get the loader object
  * 
  * @return Engine_Loader
  */
 public function getAutoloader()
 {
     if (null === $this->_autoloader) {
         $this->_autoloader = Engine_Loader::getInstance();
     }
     return $this->_autoloader;
 }