gpt4 book ai didi

zend-framework - Zend Framework Bootstrap 函数从哪里得到

转载 作者:行者123 更新时间:2023-12-01 09:07:33 24 4
gpt4 key购买 nike

我发现 Zend Framework 应用程序的 Bootstrap 类中使用了许多函数喜欢:

_initRoute()
_initLocale()
_initLayout()
.......

但我搜索了它的引用,但我什么都不喜欢

Zend_Application_Bootstrap_BootstrapAbstract
Zend_Application_Bootstrap_Bootstrap

它们都不包含任何这些功能。

我在哪里可以找到这些函数的完整引用资料?

最佳答案

基本上,这些是 resource plugins位于 library/Zend/Application/Resource/。您也可以创建自定义的。

My detailed answervery similar question这也应该适合这个。

另外,请参阅 BootstrapAbstract.php:

/**
* Get class resources (as resource/method pairs)
*
* Uses get_class_methods() by default, reflection on prior to 5.2.6,
* as a bug prevents the usage of get_class_methods() there.
*
* @return array
*/
public function getClassResources()
{
if (null === $this->_classResources) {
if (version_compare(PHP_VERSION, '5.2.6') === -1) {
$class = new ReflectionObject($this);
$classMethods = $class->getMethods();
$methodNames = array();

foreach ($classMethods as $method) {
$methodNames[] = $method->getName();
}
} else {
$methodNames = get_class_methods($this);
}

$this->_classResources = array();
foreach ($methodNames as $method) {
if (5 < strlen($method) && '_init' === substr($method, 0, 5)) {
$this->_classResources[strtolower(substr($method, 5))] = $method;
}
}
}

return $this->_classResources;
}

关于zend-framework - Zend Framework Bootstrap 函数从哪里得到,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5070319/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com