簡體   English   中英

bootstrap vs application.ini中的Zend自動加載配置

[英]Zend autoloading configurations in bootstrap vs application.ini

鑒於:

1。
引導程序:

$autoloader = Zend_Loader_Autoloader::getInstance();// Zend_Loader_Autoloader
$autoloader->registerNamespace('Ntk_');

等於

application.ini:
autoloaderNamespaces [] =“ Ntk_”


2。
引導程序:

$pluginLoader = $this->getPluginLoader();// Zend_Loader_PluginLoader     
$pluginLoader->addPrefixPath('My_Resource', APPLICATION_PATH . "/appResourcePlugins");

等於

application.ini:
pluginPaths.My_Resource = APPLICATION_PATH“ / appResourcePlugins”


3。
引導程序:

$moduleAutoloader = $this>getResourceLoader();//Zend_Application_Module_Autoloader      
$moduleAutoloader->addResourceType('need', 'needs', 'Needs');

等於

application.ini:
???



什么是用於配置Zend_Application_Module_Autoloader的application.ini方法?
(...如果存在)
我使用的是zend Framework版本1.11.10

也許這個例子可以幫助您:

    <?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{

protected function _initApplication()
{
$this->bootstrap('frontcontroller');
$front = $this->getResource('frontcontroller');
$front->addModuleDirectory(dirname(__FILE__) . '/modules');
}

protected function _initDoctype()
{
$this->bootstrap('view');
$view = $this->getResource('view');
$view->doctype('XHTML1_STRICT');
}
}

這是application.ini

[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.modules = ""

resources.layout.layout = "layout"
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts"
resources.view[] =

[staging : production]

[testing : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1

[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1 

參考: 有人有相同的問題,在這里得到了答案

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM