/** * App init * * @param int $bearMode * * @return void */ public static function init($bearMode = 1) { $app = BEAR::loadConfig(_BEAR_APP_HOME . '/App/app.yml'); switch ($bearMode) { case 1: //debug mode (cache disabled) $app['BEAR_Cache']['adapter'] = 0; case 2: //debug mode (cache enabled) $app['core']['debug'] = true; $app['App_Db']['dsn']['default'] = $app['App_Db']['dsn']['slave'] = $app['App_Db']['dsn']['test']; $app['BEAR_Ro_Prototype']['__class'] = 'BEAR_Ro_Prototype_Debug'; break; case 100: // for HTTP access UNIT test $app['core']['debug'] = true; $app['BEAR_Log']['__class'] = 'BEAR_Log_Test'; $app['BEAR_Resource_Request']['__class'] = 'BEAR_Resource_Request_Test'; break; case 0: default: // live $app['core']['debug'] = false; break; } BEAR::init($app); }
/** * アプリケーション実行 * * @param int $mode 動作モード * * @return void */ public static function init($mode = 1) { $app = BEAR::loadConfig(_BEAR_APP_HOME . '/App/app.yml'); switch ($mode) { case 2: case 1: //開発モード (キャッシュ有効) $app['core']['debug'] = true; $app['App_Db']['dsn']['default'] = $app['App_Db']['dsn']['slave'] = $app['App_Db']['dsn']['test']; $app['BEAR_Ro_Prototype']['__class'] = 'BEAR_Ro_Prototype_Debug'; break; case 0: default: //ライブ $app['core']['debug'] = false; break; } BEAR::init($app); // 開発モード(キャッシュクリア) if ($mode == 1) { BEAR_Util::clearAllCache(false); } }
<?php /** * Live App * * optimaized for fastest boot. * * @category BEAR * @package BEAR.app * @author $Author:$ <*****@*****.**> * @license @license@ http://@license_url@ * @version Release: @package_version@ $Id:$ * @link http://@link_url@ */ require_once 'BEAR.php'; define('_BEAR_APP_HOME', realpath(dirname(dirname(__FILE__)))); BEAR::init(BEAR::loadConfig(_BEAR_APP_HOME . '/App/app.yml', true));
/** * BEAR初期化 * * @return void */ private function _initBear() { if (!class_exists('BEAR')) { include_once 'BEAR.php'; } BEAR::init(); }