Skip to content

Commit

Permalink
Making Lumen-Safe!
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Engebretson <[email protected]>
  • Loading branch information
Adam Engebretson committed Jan 11, 2016
1 parent f1503b9 commit dd5097d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/RemoteManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Collective\Remote;

use Illuminate\Foundation\Application;
use Illuminate\Contracts\Container\Container;
use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Component\Console\Output\NullOutput;

Expand All @@ -11,16 +11,16 @@ class RemoteManager
/**
* The application instance.
*
* @var \Collective\Foundation\Application
* @var \Illuminate\Contracts\Container\Container
*/
protected $app;

/**
* Create a new remote manager instance.
*
* @param \Illuminate\Foundation\Application $app
* @param \Illuminate\Contracts\Container\Container $app
*/
public function __construct(Application $app)
public function __construct(Container $app)
{
$this->app = $app;
}
Expand Down
21 changes: 17 additions & 4 deletions src/RemoteServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@

class RemoteServiceProvider extends ServiceProvider
{

/**
* The commands to be registered.
*
* @var array
*/
protected $commands = [
'Tail' => 'command.tail',
'Tail' => 'command.tail',
];

/**
Expand All @@ -28,13 +29,25 @@ class RemoteServiceProvider extends ServiceProvider
*/
public function boot()
{
$this->publishes([
__DIR__.'/../config/remote.php' => config_path('remote.php'),
]);
if (! $this->isLumen()) {
$this->publishes([
__DIR__ . '/../config/remote.php' => config_path('remote.php'),
]);
}

$this->registerCommands();
}

/**
* Check if package is running under Lumen app
*
* @return bool
*/
protected function isLumen()
{
return str_contains($this->app->version(), 'Lumen') === true;
}

/**
* Register the service provider.
*
Expand Down

0 comments on commit dd5097d

Please sign in to comment.