Yet Another Framework Yaf_Application::__construct
(Yaf >=1.0.0)
Yaf_Application::__construct — Yaf_Application constructor
설명
public Yaf_Application::__construct(mixed $config
, string $envrion
= ?)
Yaf_Application을 인스턴스화하십시오.
매개변수
config
- ini 구성 파일 경로 또는 구성 배열
ini 구성 파일인 경우 기본적으로 "product"인 yaf.environ에서 정의한 대로 이름이 지정된 섹션이 있어야 합니다.
메모: 응용 프로그램의 구성 컨테이너로 ini 구성 파일을 사용하는 경우. 성능을 향상시키려면 yaf.cache_config를 엽니다.
그리고 구성 항목(및 기본값) 목록 타격:
예제 #1 ini 구성 파일 예제
[product] ;this one should alway be defined, and have no default value application.directory=APPLICATION_PATH ;following configs have default value, you may no need to define them application.library = APPLICATION_PATH . "/library" application.dispatcher.throwException=1 application.dispatcher.catchException=1 application.baseUri="" ;the php script ext name ap.ext=php ;the view template ext name ap.view.ext=phtml ap.dispatcher.defaultModuel=Index ap.dispatcher.defaultController=Index ap.dispatcher.defaultAction=index ;defined modules ap.modules=Index
envrion
- 최종 구성으로 로드될 섹션
반환 값
Examples
예제 #2 Yaf_Application::__construct() 예제
<?php
defined('APPLICATION_PATH') // APPLICATION_PATH will be used in the ini config file
|| define('APPLICATION_PATH', __DIR__));
$application = new Yaf_Application(APPLICATION_PATH.'/conf/application.ini');
$application->bootstrap()->run();
?>
위의 예는 다음과 유사한 결과를 출력합니다.
예제 #3 Yaf_Application::__construct() 예제
<?php
$config = array(
"application" => array(
"directory" => realpath(dirname(__FILE__)) . "/application",
),
);
/** Yaf_Application */
$application = new Yaf_Application($config);
$application->bootstrap()->run();
?>
위의 예는 다음과 유사한 결과를 출력합니다.