1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-18 03:31:19 +02:00

illuminate config for non-laravel use

This commit is contained in:
Oliver Vogel
2014-05-11 12:55:24 +02:00
parent 6d4e2aedd0
commit 0a94daba76
2 changed files with 13 additions and 3 deletions

View File

@@ -14,7 +14,8 @@
"require": {
"php": ">=5.3.0",
"ext-fileinfo": "*",
"illuminate/support": "4.1.*"
"illuminate/support": "4.1.*",
"illuminate/config": "4.1.*"
},
"require-dev": {
"phpunit/phpunit": "3.*",

View File

@@ -2,6 +2,10 @@
namespace Intervention\Image;
use Illuminate\Config\Repository as Config;
use Illuminate\Config\FileLoader;
use Illuminate\Filesystem\Filesystem;
class ImageManager
{
public $config;
@@ -15,8 +19,13 @@ class ImageManager
} else {
$loader = new FileLoader(new Filesystem, __DIR__.'/../../config');
$this->config = new Config($loader, null);
$config_path = __DIR__.'/../../config';
$env = 'production';
$file = new Filesystem;
$loader = new FileLoader($file, $config_path);
$this->config = new Config($loader, $env);
$this->config->package('intervention/image', $config_path, 'image');
}
}