コード例 #1
0
 public function createApplication()
 {
     $app = new \Eccube\Application();
     $app->register(new MonologServiceProvider(), array('monolog.handler' => $app->share(function () use($app) {
         return new TestHandler($app['monolog.level']);
     })));
     return $app;
 }
コード例 #2
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;
 }
コード例 #3
0
ファイル: index_dev.php プロジェクト: geany-y/LikeNiko
Debug::enable();
// load configs.
$app = new Eccube\Application();
// debug enable.
$app['debug'] = true;
// initialize servicies.
$app->initialize();
$app->initializePlugin();
// load config dev
$conf = $app['config'];
$app['config'] = $app->share(function () use($conf) {
    $confarray = array();
    $config_dev_file = __DIR__ . '/../app/config/eccube/config_dev.yml';
    if (file_exists($config_dev_file)) {
        $config_dev = Yaml::parse(file_get_contents($config_dev_file));
        if (isset($config_dev)) {
            $confarray = array_replace_recursive($confarray, $config_dev);
        }
    }
    return array_replace_recursive($conf, $confarray);
});
// config_dev.ymlにmailが設定されていた場合、config_dev.ymlの設定内容を反映
$app['swiftmailer.options'] = $app['config']['mail'];
// Mail
if (isset($app['config']['delivery_address'])) {
    $app['mailer']->registerPlugin(new \Swift_Plugins_RedirectingPlugin($app['config']['delivery_address']));
}
// Silex Web Profiler
$app->register(new \Silex\Provider\WebProfilerServiceProvider(), array('profiler.cache_dir' => __DIR__ . '/../app/cache/profiler', 'profiler.mount_prefix' => '/_profiler'));
$app->register(new \Saxulum\SaxulumWebProfiler\Provider\SaxulumWebProfilerProvider());
$app->run();