コード例 #1
0
ファイル: SecurityTraitTest.php プロジェクト: ec-cube/ec-cube
 public function createApplication($users = array())
 {
     $app = new \Eccube\Application();
     // ログの内容をERRORレベルでしか出力しないように設定を上書き
     $app['config'] = $app->share($app->extend('config', function ($config, \Silex\Application $app) {
         $config['log']['log_level'] = 'ERROR';
         $config['log']['action_level'] = 'ERROR';
         $config['log']['passthru_level'] = 'ERROR';
         $channel = $config['log']['channel'];
         foreach (array('monolog', 'front', 'admin') as $key) {
             $channel[$key]['log_level'] = 'ERROR';
             $channel[$key]['action_level'] = 'ERROR';
             $channel[$key]['passthru_level'] = 'ERROR';
         }
         $config['log']['channel'] = $channel;
         return $config;
     }));
     $app->initLogger();
     $app->register(new SecurityServiceProvider(), array('security.firewalls' => array('default' => array('http' => true, 'users' => $users))));
     return $app;
 }