Meh, 저는 애플리케이션에 대해 많이 알지 못하지만, 제 의견으로는 Bootstrap 개체라는 것이 잘못되었습니다. 내 덤프를 보면 Zend_Application이 실제로 연관되어있는 것 같습니다. 또한 당신이 찾고있는 정보를 갖고있는 것 같다 :
object(Bootstrap)[3]
protected '_appNamespace' => string '' (length=0)
protected '_resourceLoader' =>
object(Zend_Application_Module_Autoloader)[7]
protected '_application' =>
object(Zend_Application)[1]
protected '_classResources' =>
protected '_container' =>
object(Zend_Registry)[15]
protected '_environment' => null
protected '_optionKeys' =>
array
protected '_options' =>
array
'phpSettings' =>
array
'display_startup_errors' => string '1' (length=1)
'display_errors' => string '1' (length=1)
'date' =>
array
...
'bootstrap' =>
array
'path' => string 'C:\sites\mysite\application/Bootstrap.php' (length=39)
'class' => string 'Bootstrap' (length=9)
'resources' =>
array
'frontController' =>
array
...
'modules' =>
array
...
'layout' =>
array
...
'view' =>
array
...
'session' =>
array
...
'log' =>
array
...
'doctrine' =>
array
...
'appnamespace' => string '' (length=0)
'autoloadernamespaces' =>
protected '_pluginLoader' =>
object(Zend_Loader_PluginLoader)[35]
당신이 우리에게 약간의 덤프를 제공해야 할 것, 문제가 왜 실제로하지 않습니다.
<?php
class Admin_Bootstrap extends Zend_Application_Module_Bootstrap
{
protected function _initApp()
{
$app = $this->getApplication();
echo '1:';
// die(var_dump($app->getOptions()));
var_dump($app->getOption('phpSettings'));
$app->setOptions(array('phpSettings'=>array('date'=>array('timezone'=>'America/New York'))));
echo '2:';
var_dump($app->getOption('phpSettings'));
}
}
이 내 레이아웃에 있습니다 :
그것은 내가 그것을 할 때 작동
<?php
echo 'in layout';
$bootstrap = Zend_Controller_Front::getInstance()->getParam('bootstrap');
var_dump($bootstrap->getOptions());
?>
이 내 출력 : 나를 위해
1:
array
'display_startup_errors' => string '1' (length=1)
'display_errors' => string '1' (length=1)
'date' =>
array
'timezone' => string 'Africa/Johannesburg' (length=19)
2:
array
'display_startup_errors' => string '1' (length=1)
'display_errors' => string '1' (length=1)
'date' =>
array
'timezone' => string 'America/New York' (length=16)
in layout
array
'phpSettings' =>
array
'display_startup_errors' => string '1' (length=1)
'display_errors' => string '1' (length=1)
'date' =>
array
'timezone' => string 'America/New York' (length=16)
작품 잘. 당신이 정말로/오프의 PHP display_error 설정에 전환되는 돌보는 일을 가정
는
내 응용 프로그램/부트 스트랩에서 $ this-> getAPplication()을 제대로 얻을 수 있습니다. PHP 설정이 적용됩니다. while Im on application/modules/module5/Bootstrap.php 응용 프로그램 객체가 느슨해지며 getApplication()은 Bootstrap을 반환하지만 아무것도하지 않으면 php 설정이 활성화되지 않습니다. – thevikas