(Yaf >=1.0.0)
Yaf_Application::bootstrap — ����bootstrap
ָʾYaf_ApplicationȥѰ��Bootstrap��������������˳��ִ��������Bootstrap���ж������_init��ͷ�ķ����� ���û���ṩ����bootstrap��YafĬ�ϻ�ȥapplication.directory��Ѱ��Bootstrap��
bootstrap
A Yaf_Bootstrap_Abstract instance
Yaf_Application instance
Example #1 A Bootstrap()example
<?php
/**
* This file should be under the APPLICATION_PATH . "/application/"(which was defined in the config passed to Yaf_Application).
* and named Bootstrap.php, so the Yaf_Application can find it
*/
class Bootstrap extends Yaf_Bootstrap_Abstract {
function _initConfig(Yaf_Dispatcher $dispatcher) {
echo "1st called\n";
}
function _initPlugin($dispatcher) {
echo "2nd called\n";
}
}
?>
Example #2 Yaf_Application::bootstrap()example
<?php
defined('APPLICATION_PATH') // APPLICATION_PATH will be used in the ini config file
|| define('APPLICATION_PATH', __DIR__)); //__DIR__ was introduced after PHP 5.3
$application = new Yaf_Application(APPLICATION_PATH.'/conf/application.ini');
$application->bootstrap();
?>
�������̵���������ڣ�
1st called 2nd called