-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add operation modes to the scheduler (#13)
* WIP Add scheduler & config * Apply fixes from StyleCI * Create default setting * Clear the sitemap cache if mode is runtime * Register provider, add frequency selection, define defaults * Apply fixes from StyleCI * Add translations for freqency * Cleanup * Apply fixes from StyleCI * Add warning and link to info on setting up the scheduler * Add link to info on scheduler * Tidy * Build JS
- Loading branch information
Ian Morland
authored
Jun 8, 2020
1 parent
d7554a2
commit a3ca707
Showing
30 changed files
with
506 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,41 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of fof/sitemap. | ||
* | ||
* Copyright (c) 2020 FriendsOfFlarum. | ||
* | ||
* For the full copyright and license information, please view the LICENSE.md | ||
* file that was distributed with this source code. | ||
* | ||
*/ | ||
|
||
namespace FoF\Sitemap; | ||
|
||
use FoF\Sitemap\Controllers\SitemapController; | ||
use Flarum\Console\Event\Configuring; | ||
use Flarum\Extend; | ||
use Flarum\Foundation\Application; | ||
use FoF\Sitemap\Controllers\SitemapController; | ||
use Illuminate\Contracts\Events\Dispatcher; | ||
|
||
return [ | ||
new \FoF\Components\Extend\AddFofComponents(), | ||
|
||
new \FoF\Console\Extend\EnableConsole(), | ||
|
||
(new Extend\Frontend('admin')) | ||
->js(__DIR__.'/js/dist/admin.js'), | ||
|
||
(new Extend\Routes('forum')) | ||
->get('/sitemap.xml', 'fof-sitemap-index', SitemapController::class), | ||
|
||
new Extend\Locales(__DIR__.'/resources/locale'), | ||
|
||
function (Application $app, Dispatcher $events) { | ||
$app->register(Providers\ResourceProvider::class); | ||
$app->register(Providers\ViewProvider::class); | ||
|
||
$events->listen(Configuring::class, function (Configuring $event) { | ||
$event->addCommand(Commands\CacheSitemapCommand::class); | ||
$event->addCommand(Commands\MultiPageSitemapCommand::class); | ||
}); | ||
$app->register(Providers\ConsoleProvider::class); | ||
}, | ||
|
||
(new Extend\Console())->command(Commands\CacheSitemapCommand::class), | ||
(new Extend\Console())->command(Commands\MultiPageSitemapCommand::class), | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './src/admin'; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "@fof/sitemap", | ||
"version": "0.0.0", | ||
"private": true, | ||
"dependencies": { | ||
"flarum-webpack-config": "^0.1.0-beta.10", | ||
"webpack": "^4.26.0", | ||
"webpack-cli": "^3.0.7" | ||
}, | ||
"scripts": { | ||
"dev": "webpack --mode development --watch", | ||
"build": "webpack --mode production", | ||
"lint": "prettier --single-quote --trailing-comma es5 --print-width 150 --tab-width 4 --write src/**/*" | ||
}, | ||
"devDependencies": { | ||
"prettier": "^1.19.1" | ||
} | ||
} |
Oops, something went wrong.