From c627d79b5253e97deafec4bca077e307b16271fc Mon Sep 17 00:00:00 2001 From: zhiqiang Date: Sun, 2 Jul 2017 20:14:17 +0800 Subject: [PATCH] add service procider --- composer.json | 2 +- core/lib/Hunter/App/Application.php | 8 ++++++++ sites/config.php | 3 +++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 8c20ec7..a2ec908 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "zendframework/zend-diactoros": "^1.3", "symfony/yaml": "~2.7", "symfony/console": "^3.1", - "opis/session": "^3.1",, + "opis/session": "^3.1", "dmitrymomot/cookie-helper": "^1.0", "fzaninotto/faker": "^1.6", "creitive/breadcrumbs": "^3.1", diff --git a/core/lib/Hunter/App/Application.php b/core/lib/Hunter/App/Application.php index 04e1456..2f28721 100644 --- a/core/lib/Hunter/App/Application.php +++ b/core/lib/Hunter/App/Application.php @@ -210,6 +210,14 @@ protected function initializeContainer() { } } } + + if(!empty($services['providers'])){ + foreach ($services['providers'] as $name => $provider) { + if (class_exists($provider['class'])) { + $container->addServiceProvider($provider['class']); + } + } + } } } diff --git a/sites/config.php b/sites/config.php index b3a0181..bbc90c2 100644 --- a/sites/config.php +++ b/sites/config.php @@ -6,6 +6,9 @@ //配置: 开发模式 $hunter_debug = true; +//配置: 缓存目录 +$cache_dir = HUNTER_ROOT . '/sites/files'; + //配置: 数据库 $databases = array( 'default' => array(