added new methods etc

This commit is contained in:
Daniel Klabbers 2017-10-05 16:25:01 +02:00
parent c7bd017bf3
commit 5a99f13f3f
5 changed files with 65 additions and 33 deletions

View File

@ -1,30 +0,0 @@
<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum;
use Flarum\Foundation\AbstractServiceProvider;
/**
* @deprecated
*/
class BusServiceProvider extends AbstractServiceProvider
{
/**
* {@inheritdoc}
*/
public function boot()
{
$this->app->make('Illuminate\Contracts\Bus\Dispatcher')->mapUsing(function ($command) {
return get_class($command).'Handler@handle';
});
}
}

View File

@ -28,7 +28,6 @@ class DatabaseServiceProvider extends AbstractServiceProvider
$connection = $factory->make($this->app->config('database'));
$connection->setEventDispatcher($this->app->make('Illuminate\Contracts\Events\Dispatcher'));
$connection->setFetchMode(PDO::FETCH_CLASS);
return $connection;
});

View File

@ -737,4 +737,22 @@ class Application extends Container implements ApplicationContract
$this->loadedProviders = [];
}
/**
* Get the path to the cached packages.php file.
*
* @return string
*/
public function getCachedPackagesPath()
{
return storage_path('app/cache/packages.php');
}
/**
* @return string
*/
public function resourcePath()
{
return storage_path('resources');
}
}

View File

@ -178,8 +178,6 @@ class Site
$config->set('mail.username', $settings->get('mail_username'));
$config->set('mail.password', $settings->get('mail_password'));
$app->register(\Flarum\BusServiceProvider::class);
$app->register(DiscussionServiceProvider::class);
$app->register(FormatterServiceProvider::class);
$app->register(GroupServiceProvider::class);

View File

@ -353,4 +353,51 @@ class Gate implements GateContract
{
return call_user_func($this->userResolver);
}
/**
* Register a callback to run after all Gate checks.
*
* @param callable $callback
* @return GateContract
*/
public function after(callable $callback)
{
// TODO: Implement after() method.
}
/**
* Determine if any one of the given abilities should be granted for the current user.
*
* @param iterable|string $abilities
* @param array|mixed $arguments
* @return bool
*/
public function any($abilities, $arguments = [])
{
// TODO: Implement any() method.
}
/**
* Determine if the given ability should be granted for the current user.
*
* @param string $ability
* @param array|mixed $arguments
* @return \Illuminate\Auth\Access\Response
*
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function authorize($ability, $arguments = [])
{
// TODO: Implement authorize() method.
}
/**
* Get all of the defined abilities.
*
* @return array
*/
public function abilities()
{
// TODO: Implement abilities() method.
}
}