Cachet/app/Providers/ConsoleServiceProvider.php

42 lines
1.1 KiB
PHP
Raw Normal View History

2015-01-01 17:47:53 +00:00
<?php
/*
* This file is part of Cachet.
*
* (c) James Brooks <james@cachethq.io>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
2015-01-01 17:47:53 +00:00
namespace CachetHQ\Cachet\Providers;
2015-01-17 19:44:39 +00:00
use CachetHQ\Cachet\Console\Commands\FixPermissionsCommand;
2015-01-01 17:47:53 +00:00
use Illuminate\Support\ServiceProvider;
class ConsoleServiceProvider extends ServiceProvider
{
/**
* Boot the service provider.
*/
public function boot()
{
2015-03-20 18:30:45 -06:00
//
2015-01-01 17:47:53 +00:00
}
/**
* Register the service provider.
*/
public function register()
{
2015-01-17 19:44:39 +00:00
$this->app->singleton('CachetHQ\Cachet\Console\Commands\FixPermissionsCommand', function ($app) {
2015-03-20 18:30:45 -06:00
$storageDirectory = storage_path();
$databaseDirectory = base_path('database');
2015-01-17 19:44:39 +00:00
$databasePath = $app->config->get('database.connections.sqlite.database');
$databaseDefault = $app->config->get('database.default');
2015-01-17 21:56:01 +00:00
return new FixPermissionsCommand($storageDirectory, $databaseDirectory, $databasePath, $databaseDefault);
2015-01-17 19:44:39 +00:00
});
2015-01-01 17:47:53 +00:00
}
}