framework/extensions/package-manager/extend.php

37 lines
1.2 KiB
PHP
Raw Normal View History

2021-09-02 00:20:06 +08:00
<?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');
}),
];