本文整理汇总了PHP中Zend_Loader_Autoloader_Resource类的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Loader_Autoloader_Resource类的具体用法?PHP Zend_Loader_Autoloader_Resource怎么用?PHP Zend_Loader_Autoloader_Resource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Zend_Loader_Autoloader_Resource类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _initAutoloader
/**
* Добавляем ресурсы в автолоадер
*/
protected function _initAutoloader()
{
$resourceLoader = new Zend_Loader_Autoloader_Resource(array('basePath' => APPLICATION_PATH . '/library', 'namespace' => 'Library'));
$resourceLoader->addResourceType('helper', 'helpers/', 'Helper_');
$resourceLoader->addResourceType('class', 'classes/', 'Class_');
$resourceLoader->addResourceType('interface', 'interfaces/', 'Interface_');
}
示例2: _initAutoloader
/**
* 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']]);
}
示例3: run
public function run()
{
// Lade Konfig
$config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/application.ini', APPLICATION_ENV);
Zend_Registry::set('config', $config);
// Erstelle DB Adapter
$db = Zend_Db::factory($config->db);
Zend_Registry::set('db', $db);
Zend_Db_Table_Abstract::setDefaultAdapter(Zend_Registry::get('db'));
if (APPLICATION_ENV !== 'production') {
$profiler = new Zend_Db_Profiler_Firebug('All Database Queries:');
$profiler->setEnabled(true);
$db->setProfiler($profiler);
}
$resourceLoader = new Zend_Loader_Autoloader_Resource(array('basePath' => APPLICATION_PATH, 'namespace' => ''));
$resourceLoader->addResourceType('plugins', 'plugins', 'Plugins');
if (PHP_SAPI != 'cli') {
$front = Zend_Controller_Front::getInstance();
$front->registerPlugin(new Plugins_Stats());
if (APPLICATION_ENV == 'production') {
$front->registerPlugin(new Plugins_Cache());
}
}
Zend_View_Helper_PaginationControl::setDefaultViewPartial('_partials/controls.phtml');
parent::run();
}
示例4: _initResourceLoader
/**
*
*/
protected function _initResourceLoader()
{
$resourceLoader = new Zend_Loader_Autoloader_Resource(array('namespace' => '', 'basePath' => APPLICATION_PATH));
$resourceLoader->addResourceType('phrets', 'plugins/phrets/', 'Rets');
// $resourceLoader->addResourceType('helper', 'plugins/helper/', 'Helper');
return $resourceLoader;
}
示例5: _initAutoLoader
protected function _initAutoLoader()
{
$loader = new Zend_Loader_Autoloader_Resource(array("basePath" => APPLICATION_PATH, "namespace" => "App"));
$loader->addResourceTypes(array("form" => array("path" => "modules/default/forms", "namespace" => "Form"), "formp" => array("path" => "modules/painel/forms", "namespace" => "Painel_Form"), "class" => array("path" => "Class", "namespace" => "Class")));
$loader->addResourceType("model", "models/", "Model");
$loader->addResourceType("plugin", "plugins/", "Plugin");
$loader->addResourceType("class", "Class/", "Class");
}
示例6: _initAutoloader
protected function _initAutoloader()
{
$loader = new Zend_Loader_Autoloader_Resource(array('basePath' => APPLICATION_PATH, 'namespace' => ''));
$loader->addResourceType('amf', 'amf', 'Amf');
$loader->addResourceType('model', 'models', 'Model');
$loader->addResourceType('tool', 'tools', 'Tool');
return $loader;
}
示例7: _initAttributeExOpenIDPath
protected function _initAttributeExOpenIDPath()
{
$autoLoader = Zend_Loader_Autoloader::getInstance();
$resourceLoader = new Zend_Loader_Autoloader_Resource(array('basePath' => APPLICATION_PATH, 'namespace' => 'My_'));
$resourceLoader->addResourceType('openidextension', 'openid/extension/', 'OpenId_Extension');
$resourceLoader->addResourceType('authAdapter', 'auth/adapter', 'Auth_Adapter');
$autoLoader->pushAutoloader($resourceLoader);
}
示例8: _initAutoload
protected function _initAutoload()
{
$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader->setFallbackAutoloader(true);
$resourceLoader = new Zend_Loader_Autoloader_Resource(array("namespace" => "", "basePath" => APPLICATION_PATH));
$resourceLoader->addResourceType("filters", "/filters", "Filter_");
$resourceLoader->addResourceType("forms", "/filters/forms", "Filter_Form_");
$autoloader->pushAutoloader($resourceLoader);
return $autoloader;
}
示例9: _initAutoloader
/**
* 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']]);
}
示例10: setUp
protected function setUp()
{
_SF_Autloader_SetUp();
// configure the resource loader atuo load models
$loader = new Zend_Loader_Autoloader_Resource(array('basePath' => APPLICATION_PATH . '/modules/storefront', 'namespace' => 'Storefront'));
$loader->addResourceType('Model', 'models', 'Model');
// configure another loader so we can replace Model Resources
$loader = new Zend_Loader_Autoloader_Resource(array('basePath' => dirname(__FILE__), 'namespace' => 'Storefront'));
$loader->addResourceType('modelResource', 'TestResources', 'Resource');
$this->_model = new Storefront_Model_Catalog();
}
示例11: _initAutoloader
/**
* Initialize auto loader and add resource loaders
*/
public function _initAutoloader()
{
$resourceLoader = new Zend_Loader_Autoloader_Resource(array('basePath' => APPLICATION_PATH . '/models', 'namespace' => 'Model'));
$Dir = dirname(APPLICATION_PATH) . '/library/';
$D = opendir($Dir);
while ($LibraryDir = readdir($D)) {
if ($LibraryDir != '.' && $LibraryDir != '..' && $LibraryDir != 'Zend') {
$resourceLoader->addResourceType(strtolower($LibraryDir), dirname(APPLICATION_PATH) . '/library/' . $LibraryDir, $LibraryDir);
}
}
return $resourceLoader;
}
示例12: setUp
protected function setUp()
{
_SF_Autloader_SetUp();
Zend_Loader::loadClass('Zend_Session_Namespace');
// configure the resource loader atuo load models
$loader = new Zend_Loader_Autoloader_Resource(array('basePath' => APPLICATION_PATH . '/modules/storefront', 'namespace' => 'Storefront'));
$loader->addResourceType('Model', 'models', 'Model');
$loader->addResourceType('ModelResource', 'models/resources', 'Resource');
$loader->addResourceType('Form', 'forms', 'Form');
$loader->addResourceType('Service', 'services', 'Service');
$mockNS = $this->getMock('Zend_Session_Namespace');
$this->_model = new Storefront_Model_Cart(array('sessionNs' => $mockNS));
}
示例13: _initAutoloader
/**
* Initialize auto loader and add resource loaders(for models)
*/
public function _initAutoloader()
{
$autoloader = Zend_Loader_Autoloader::getInstance();
$resourceLoader = new Zend_Loader_Autoloader_Resource(array('basePath' => APPLICATION_PATH . '/models', 'namespace' => 'Model'));
$resourceLoader->addResourceType('DbTable', 'DbTable/', 'DbTable');
$resourceLoader->addResourceType('DbRow', 'DbRow/', 'DbRow');
$resourceLoader->addResourceType('Static', 'Static/', 'Static');
$Dir = dirname(APPLICATION_PATH) . '/library/';
$D = opendir($Dir);
while ($LibraryDir = readdir($D)) {
if ($LibraryDir != '.' && $LibraryDir != '..' && $LibraryDir != 'Zend') {
$resourceLoader->addResourceType(strtolower($LibraryDir), dirname(APPLICATION_PATH) . '/library/' . $LibraryDir, $LibraryDir);
}
}
}
示例14: _initDoctype
protected function _initDoctype()
{
$this->bootstrap('view');
$view = $this->getResource('view');
$view->doctype('XHTML1_STRICT');
//Pre - Load up the custom validators and forms etc.
$loader = new Zend_Loader_Autoloader_Resource(array('basePath' => APPLICATION_PATH, 'namespace' => 'Application'));
$loader->addResourceType('model', 'models', 'Model');
$loader->addResourceType('form', 'forms', 'Form');
// $loader = new Zend_Loader_Autoloader_Resource (array (
// 'basePath' => APPLICATION_PATH,
// 'namespace' => 'Application',
// ));
// $loader -> addResourceType ( 'model', 'models', 'Model');
// $loader -> addResourceType ( 'form', 'forms', 'Form');
}
示例15: _initAutoload
protected function _initAutoload()
{
// Inicializa o Resource do DB
$this->bootstrap('db');
// Recupera o Resource do DB
$dbAdapter = $this->getResource('db');
// Adicionar as configuracoes de Resource
$resourceLoader = new Zend_Loader_Autoloader_Resource(array('basePath' => APPLICATION_PATH, 'namespace' => ''));
$resourceLoader->addResourceType('model', 'models/', 'Model');
$resourceLoader->addResourceType('acl', 'acls/', 'Acl');
$resourceLoader->addResourceType('plugin', 'plugins/', 'Plugin');
// Registra o plugin de autenticação
//$frontController = Zend_Controller_Front::getInstance();
//$frontController->registerPlugin(new Plugin_Autenticacao($dbAdapter));
return $resourceLoader;
}