本文整理汇总了PHP中Zend_Loader_Autoloader_Resource::addResourceType方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Loader_Autoloader_Resource::addResourceType方法的具体用法?PHP Zend_Loader_Autoloader_Resource::addResourceType怎么用?PHP Zend_Loader_Autoloader_Resource::addResourceType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Loader_Autoloader_Resource
的用法示例。
在下文中一共展示了Zend_Loader_Autoloader_Resource::addResourceType方法的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
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");
}
示例3: _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;
}
示例4: _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);
}
示例5: _initLoader
protected function _initLoader()
{
$resourceLoader = new Zend_Loader_Autoloader_Resource(array('basePath' => APPLICATION_PATH, 'namespace' => 'Reg2'));
$resourceLoader->addResourceType('model', 'models/', 'Model');
$resourceLoader->addResourceType('validate', '../library/Validate', 'Validate');
$resourceLoader->addResourceType('plugin', 'plugins/', 'Plugin');
$resourceLoader->addResourceType('form', 'forms/', 'Form');
return $resourceLoader;
}
示例6: _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;
}
示例7: 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));
}
示例8: _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);
}
}
}
示例9: _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');
}
示例10: _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;
}
示例11: _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;
}
示例12: 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();
}
示例13: 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();
}
示例14: _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;
}
示例15: _initModules
protected function _initModules()
{
$frontController = Zend_Controller_Front::getInstance();
//$frontController->addModuleDirectory(APPLICATION_PATH . '/modules');
// action helpers
Zend_Controller_Action_HelperBroker::addPath(APPLICATION_PATH . '/controllers/helpers');
// autoloaders
$autoloader = Zend_Loader_Autoloader::getInstance();
$modules = $frontController->getControllerDirectory();
$default = $frontController->getDefaultModule();
foreach (array_keys($modules) as $module) {
$autoloader->pushAutoloader(new Zend_Application_Module_Autoloader(array('namespace' => ucwords($module), 'basePath' => $frontController->getModuleDirectory($module))));
}
$resourceLoader = new Zend_Loader_Autoloader_Resource(array('basePath' => APPLICATION_PATH, 'namespace' => ''));
$resourceLoader->addResourceType('form', 'forms/', 'Form')->addResourceType('model', 'models/', 'Model')->addResourceType('model_table', 'models/Table/', 'Model_Table');
//$frontController->getRouter()
//->addroute('logout',new Zend_Controller_Router_Route('admin/logout',array('module'=>'admin', 'controller'=>'index', 'action'=>'logout')))
}