Cachet/app/Providers/ConsoleServiceProvider.php

34 lines
1010 B
PHP
Raw Normal View History

2015-01-01 17:47:53 +00:00
<?php
/*
* This file is part of Cachet.
*
2015-05-25 17:59:08 +01:00
* (c) Cachet HQ <support@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
{
/**
* 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
}
}