Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/FriendsOfFlarum/console
Register custom commands into Flarum
https://github.com/FriendsOfFlarum/console
command-line custom-commands flarum flarum-extension
Last synced: about 9 hours ago
JSON representation
Register custom commands into Flarum
- Host: GitHub
- URL: https://github.com/FriendsOfFlarum/console
- Owner: FriendsOfFlarum
- License: mit
- Archived: true
- Created: 2017-07-24T17:44:27.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-03-10T10:59:59.000Z (over 3 years ago)
- Last Synced: 2024-10-29T22:37:23.868Z (5 days ago)
- Topics: command-line, custom-commands, flarum, flarum-extension
- Language: PHP
- Homepage: https://discuss.flarum.org/d/6373-flagrow-serve-start-flarum-in-the-php-development-server
- Size: 37.1 KB
- Stars: 3
- Watchers: 4
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-flarum - Console - Register custom commands and task scheduling. (Extensions / Others ([:top:](#table-of-contents)))
README
# Console
[![MIT license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/friendsofflarum/console/blob/master/LICENSE.md) [![Latest Stable Version](https://img.shields.io/packagist/v/fof/console.svg)](https://packagist.org/packages/fof/console) [![Total Downloads](https://img.shields.io/packagist/dt/fof/console.svg)](https://packagist.org/packages/fof/console)
This package is meant for extension developers and offers the ability to add task scheduling to Flarum.
## Use in your extension
The real deal is using it in your own extension. Simply require it in your extension `composer.json` file:
```json
"require": {
"fof/console": "^0.6"
},
```Now make sure the `ConsoleProvider` is registered inside Flarum. There's an Extender that helps you with that, inside
your `extend.php` add:```php
return [
new \FoF\Console\Extend\EnableConsole,
// .. your code
];
```## Task Scheduling, cron jobs
To set a schedule, create a [Service Provider](https://laravel.com/docs/5.7/packages#service-providers) which
resolves the `Illuminate\Console\Scheduling\Schedule` through IoC, then use its methods to configure the schedule
for the command, see the [Task Scheduling documentation](https://laravel.com/docs/5.7/scheduling#defining-schedules).## Links
- [Source code on GitHub](https://github.com/FriendsOfFlarum/console)
- [Report an issue](https://github.com/FriendsOfFlarum/console/issues)
- [Download via Packagist](https://packagist.org/packages/fof/console)
- [Discuss](https://discuss.flarum.org/d/7161)