Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Commit b99acdc

Browse files
author
jaw-sh
committed
Facade and service provider should work.
1 parent 28ba85d commit b99acdc

File tree

3 files changed

+10
-22
lines changed

3 files changed

+10
-22
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414

1515
"require": {
1616
"php": ">=5.4.0",
17-
"enshrined/svg-sanitize": "0.2.*"
17+
"enshrined/svg-sanitize": "0.2.*",
18+
"illuminate/support": "5.1.*"
1819
},
1920

2021
"require-dev": {

src/FileSleuth.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class FileSleuth
1212
protected $detectives = [
1313
'InfinityNext\Sleuth\Detectives\ImageGDDetective',
1414
'InfinityNext\Sleuth\Detectives\ffmpegDetective',
15+
'InfinityNext\Sleuth\Detectives\svgDetective',
1516
];
1617

1718
/**

src/Providers/SleuthServiceProvider.php

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,11 @@
77
class SleuthServiceProvider extends ServiceProvider
88
{
99
/**
10-
* Bootstrap the application events.
10+
* Indicates if loading of the provider is deferred.
1111
*
12-
* @return void
12+
* @var bool
1313
*/
14-
public function boot()
15-
{
16-
// $this->publishes(array(
17-
// __DIR__.'/../../config/config.php' => config_path('image.php')
18-
// ));
19-
}
14+
protected $defer = true;
2015

2116
/**
2217
* Register the service provider.
@@ -25,29 +20,20 @@ public function boot()
2520
*/
2621
public function register()
2722
{
28-
$app = $this->app;
29-
30-
// merge default config
31-
// $this->mergeConfigFrom(
32-
// __DIR__.'/../../config/config.php',
33-
// 'image'
34-
// );
35-
36-
// create image
37-
$app['sleuth'] = $app->share(function ($app) {
23+
$this->app->bindShared(function ($app) {
3824
return new FileSleuth(); //$app['config']->get('sleuth'));
3925
});
4026

41-
$app->alias('sleuth', 'InfinityNext\Sleuth\FileSleuth');
27+
$this->app->alias('sleuth', 'InfinityNext\Sleuth\FileSleuth');
4228
}
4329

44-
/**6
30+
/**
4531
* Get the services provided by the provider.
4632
*
4733
* @return array
4834
*/
4935
public function provides()
5036
{
51-
return array('sleuth');
37+
return array('sleuth', 'InfinityNext\Sleuth\FileSleuth');
5238
}
5339
}

0 commit comments

Comments
 (0)