프로젝트/index.php에젠드 프레임 워크의 일부 코드를 이해하려고 노력
<?php
error_reporting(E_ALL|E_STRICT);
date_default_timezone_set('Europe/London');
set_include_path('.' . PATH_SEPARATOR . './library'
. PATH_SEPARATOR . './application/models/'
. PATH_SEPARATOR . get_include_path());
include "Zend/Loader.php";
Zend_Loader::loadClass('Zend_Controller_Front');
// setup controller
$frontController = Zend_Controller_Front::getInstance();
$frontController->throwExceptions(true);
$frontController->setControllerDirectory('./application/controllers');
// run!
$frontController->dispatch();
?>
젠드/컨트롤러/Front.php
<?php
...
class Zend_Controller_Front
{
...
protected static $_instance = null;
...
protected $_throwExceptions = false;
...
protected function __construct()
{
$this->_plugins = new Zend_Controller_Plugin_Broker();
}
...
public static function getInstance()
{
if (null === self::$_instance) {
self::$_instance = new self();
}
return self::$_instance;
}
...
public function throwExceptions($flag = null)
{
if ($flag !== null) {
$this->_throwExceptions = (bool) $flag;
return $this;
}
return $this->_throwExceptions;
}
...
}
...
?>
질문 :
이$this->_plugins = new Zend_Controller_Plugin_Broker();
뭐라고이다 이 수업의 사용 :Zend_Controller_Plugin_Broker
? 그것은 프로젝트/index.php에서 anyhing하지 않는 것 같습니다public function throwExceptions($flag = null)
왜$flag !== null, return $this;
동안$flag == null, return $this->_throwExceptions;
? 둘 다 왜 이걸 돌려주지 않니?$frontController->setControllerDirectory('./application/controllers');
"." 현재 디렉토리를 의미합니까? 우리는 왜 "."을 가질 필요가 있습니까?