update : 2015.11.03
php.shukuma.com

검색:
 
 
The Yaf_Bootstrap_Abstract class

The Yaf_Bootstrap_Abstract class

(No version information available, might only be in Git)

소개

Bootstrap is a mechanism used to do some intial config before a Application run.

User may define their own Bootstrap class by inheriting Yaf_Bootstrap_Abstract

Any method declared in Bootstrap class with leading "_init", will be called by Yaf_Application::bootstrap() one by one according to their defined order.

예제

Example #1 Bootstrap example

<?php
   
/* bootstrap class should be defined under ./application/Bootstrap.php */
   
class Bootstrap extends Yaf_Bootstrap_Abstract {
        public function 
_initConfig(Yaf_Dispatcher $dispatcher) {
            
var_dump(__METHOD__);
        }
        public function 
_initPlugin(Yaf_Dispatcher $dispatcher) {
            
var_dump(__METHOD__);
        }
   }

   
$config = array(
       
"application" => array(
           
"directory" => dirname(__FILE__) . "/application/",
       ),
   );
 
   
$app = new Yaf_Application($config);
   
$app->bootstrap();
?>

위 예제의 출력 예시:

string(22) "Bootstrap::_initConfig"
string(22) "Bootstrap::_initPlugin"

클래스 개요

abstract Yaf_Bootstrap_Abstract {
/* 프로퍼티 */
/* 메소드 */
}