mirror of
https://github.com/flarum/framework.git
synced 2024-12-02 06:53:47 +08:00
37 lines
1.2 KiB
PHP
37 lines
1.2 KiB
PHP
|
<?php
|
||
|
|
||
|
/**
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
namespace SychO\PackageManager;
|
||
|
|
||
|
use Flarum\Extend;
|
||
|
use Flarum\Foundation\Paths;
|
||
|
use Illuminate\Console\Scheduling\Event;
|
||
|
use SychO\PackageManager\Console\TaskCommand;
|
||
|
|
||
|
return [
|
||
|
(new Extend\Routes('api'))
|
||
|
->post('/package-manager/extensions', 'package-manager.extensions.require', Api\Controller\RequireExtensionController::class)
|
||
|
->patch('/package-manager/extensions/{id}', 'package-manager.extensions.update', Api\Controller\UpdateExtensionController::class)
|
||
|
->delete('/package-manager/extensions/{id}', 'package-manager.extensions.remove', Api\Controller\RemoveExtensionController::class),
|
||
|
|
||
|
(new Extend\Frontend('admin'))
|
||
|
->css(__DIR__ . '/less/admin.less')
|
||
|
->js(__DIR__ . '/js/dist/admin.js'),
|
||
|
|
||
|
new Extend\Locales(__DIR__ . '/locale'),
|
||
|
|
||
|
(new Extend\ServiceProvider)
|
||
|
->register(ComposerEnvironmentProvider::class),
|
||
|
|
||
|
(new Extend\Console)
|
||
|
->schedule(TaskCommand::class, function (Event $event) {
|
||
|
$event
|
||
|
->everyMinute()
|
||
|
->withoutOverlapping()
|
||
|
->appendOutputTo(resolve(Paths::class)->storage.'/logs/bazaar-tasks.log');
|
||
|
}),
|
||
|
];
|