mirror of
https://github.com/flarum/framework.git
synced 2024-11-30 13:36:10 +08:00
added new methods etc
This commit is contained in:
parent
c7bd017bf3
commit
5a99f13f3f
|
@ -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';
|
||||
});
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
});
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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.
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user