mirror of
https://github.com/flarum/framework.git
synced 2024-11-30 21:44:12 +08:00
Rename Server register
API to extend
More consistent with how extensions work
This commit is contained in:
parent
d2bce5d756
commit
ed8a145348
|
@ -45,7 +45,7 @@ abstract class AbstractServer
|
|||
/**
|
||||
* @var callable[]
|
||||
*/
|
||||
protected $registerCallbacks = [];
|
||||
protected $extendCallbacks = [];
|
||||
|
||||
/**
|
||||
* @param null $basePath
|
||||
|
@ -136,9 +136,9 @@ abstract class AbstractServer
|
|||
/**
|
||||
* @param callable $callback
|
||||
*/
|
||||
public function register(callable $callback)
|
||||
public function extend(callable $callback)
|
||||
{
|
||||
$this->registerCallbacks[] = $callback;
|
||||
$this->extendCallbacks[] = $callback;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -193,8 +193,8 @@ abstract class AbstractServer
|
|||
$app->register('Flarum\Forum\ForumServiceProvider');
|
||||
$app->register('Flarum\Admin\AdminServiceProvider');
|
||||
|
||||
foreach ($this->registerCallbacks as $callback) {
|
||||
$callback($app);
|
||||
foreach ($this->extendCallbacks as $callback) {
|
||||
$app->call($callback);
|
||||
}
|
||||
|
||||
$app->register('Flarum\Extension\ExtensionServiceProvider');
|
||||
|
|
Loading…
Reference in New Issue
Block a user