예제 #1
0
 /**
  * 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);
 }
예제 #2
0
 /**
  * アプリケーション実行
  *
  * @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);
     }
 }
예제 #3
0
<?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));
예제 #4
0
 /**
  * BEAR初期化
  *
  * @return void
  */
 private function _initBear()
 {
     if (!class_exists('BEAR')) {
         include_once 'BEAR.php';
     }
     BEAR::init();
 }