mirror of
https://github.com/flarum/framework.git
synced 2024-12-03 15:43:59 +08:00
Merge branch 'composer'
This commit is contained in:
commit
d6b829414c
|
@ -9,6 +9,20 @@
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require __DIR__.'/vendor/autoload.php';
|
use Flarum\Core\Application;
|
||||||
|
|
||||||
return 'Flarum\Tags\Extension';
|
return function (Application $app) {
|
||||||
|
Flarum\Tags\Tag::setValidator($app->make('validator'));
|
||||||
|
|
||||||
|
$events = $app->make('events');
|
||||||
|
|
||||||
|
$events->subscribe('Flarum\Tags\Listeners\AddClientAssets');
|
||||||
|
$events->subscribe('Flarum\Tags\Listeners\AddModelRelationship');
|
||||||
|
$events->subscribe('Flarum\Tags\Listeners\ConfigureDiscussionPermissions');
|
||||||
|
$events->subscribe('Flarum\Tags\Listeners\ConfigureTagPermissions');
|
||||||
|
$events->subscribe('Flarum\Tags\Listeners\AddApiAttributes');
|
||||||
|
$events->subscribe('Flarum\Tags\Listeners\PersistData');
|
||||||
|
$events->subscribe('Flarum\Tags\Listeners\LogDiscussionTagged');
|
||||||
|
$events->subscribe('Flarum\Tags\Listeners\UpdateTagMetadata');
|
||||||
|
$events->subscribe('Flarum\Tags\Listeners\AddTagGambit');
|
||||||
|
};
|
||||||
|
|
|
@ -1,10 +1,29 @@
|
||||||
{
|
{
|
||||||
|
"name": "flarum/tags",
|
||||||
|
"type": "flarum-extension",
|
||||||
|
"description": "Organise discussions into a heirarchy of tags and categories.",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Flarum\\Tags\\": "src/"
|
"Flarum\\Tags\\": "src/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scripts": {
|
"require": {
|
||||||
"style": "phpcs --standard=PSR2 -np src"
|
"composer/installers": "dev-master"
|
||||||
}
|
},
|
||||||
|
"extra": {
|
||||||
|
"flarum-extension": {
|
||||||
|
"title": "Tags",
|
||||||
|
"icon": {
|
||||||
|
"name": "tags",
|
||||||
|
"backgroundColor": "#F28326",
|
||||||
|
"color": "#fff"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"repositories": [
|
||||||
|
{
|
||||||
|
"type": "vcs",
|
||||||
|
"url": "https://github.com/tobscure/installers"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,25 +0,0 @@
|
||||||
{
|
|
||||||
"name": "tags",
|
|
||||||
"title": "Tags",
|
|
||||||
"description": "Organise discussions into a heirarchy of tags and categories.",
|
|
||||||
"keywords": ["discussions"],
|
|
||||||
"version": "0.1.0-beta.2",
|
|
||||||
"author": {
|
|
||||||
"name": "Toby Zerner",
|
|
||||||
"email": "toby@flarum.org",
|
|
||||||
"homepage": "http://tobyzerner.com"
|
|
||||||
},
|
|
||||||
"license": "MIT",
|
|
||||||
"require": {
|
|
||||||
"flarum": ">=0.1.0-beta.2"
|
|
||||||
},
|
|
||||||
"support": {
|
|
||||||
"source": "https://github.com/flarum/tags",
|
|
||||||
"issues": "https://github.com/flarum/core/issues"
|
|
||||||
},
|
|
||||||
"icon": {
|
|
||||||
"name": "tags",
|
|
||||||
"backgroundColor": "#F28326",
|
|
||||||
"color": "#fff"
|
|
||||||
}
|
|
||||||
}
|
|
1
extensions/tags/js/.gitignore
vendored
1
extensions/tags/js/.gitignore
vendored
|
@ -1,3 +1,2 @@
|
||||||
bower_components
|
bower_components
|
||||||
node_modules
|
node_modules
|
||||||
dist
|
|
||||||
|
|
1
extensions/tags/js/admin/dist/extension.js
vendored
Normal file
1
extensions/tags/js/admin/dist/extension.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
extensions/tags/js/forum/dist/extension.js
vendored
Normal file
1
extensions/tags/js/forum/dist/extension.js
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -8,7 +8,7 @@
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Flarum\Migrations\Tags;
|
namespace Flarum\Tags\Migrations;
|
||||||
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Flarum\Migrations\Migration;
|
use Flarum\Migrations\Migration;
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Flarum\Migrations\Tags;
|
namespace Flarum\Tags\Migrations;
|
||||||
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Flarum\Migrations\Migration;
|
use Flarum\Migrations\Migration;
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Flarum\Migrations\Tags;
|
namespace Flarum\Tags\Migrations;
|
||||||
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Flarum\Migrations\Migration;
|
use Flarum\Migrations\Migration;
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Flarum\Migrations\Tags;
|
namespace Flarum\Tags\Migrations;
|
||||||
|
|
||||||
use Flarum\Migrations\Migration;
|
use Flarum\Migrations\Migration;
|
||||||
|
|
||||||
|
|
27
extensions/tags/scripts/compile.sh
Executable file
27
extensions/tags/scripts/compile.sh
Executable file
|
@ -0,0 +1,27 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# This script compiles the extension so that it can be used in a Flarum
|
||||||
|
# installation. It should be run from the root directory of the extension.
|
||||||
|
|
||||||
|
base=$PWD
|
||||||
|
|
||||||
|
cd "${base}/js"
|
||||||
|
|
||||||
|
if [ -f bower.json ]; then
|
||||||
|
bower install
|
||||||
|
fi
|
||||||
|
|
||||||
|
for app in forum admin; do
|
||||||
|
cd "${base}/js"
|
||||||
|
|
||||||
|
if [ -d $app ]; then
|
||||||
|
cd $app
|
||||||
|
|
||||||
|
if [ -f bower.json ]; then
|
||||||
|
bower install
|
||||||
|
fi
|
||||||
|
|
||||||
|
npm install
|
||||||
|
gulp --production
|
||||||
|
fi
|
||||||
|
done
|
|
@ -1,35 +0,0 @@
|
||||||
<?php
|
|
||||||
/*
|
|
||||||
* This file is part of Flarum.
|
|
||||||
*
|
|
||||||
* (c) Toby Zerner <toby.zerner@gmail.com>
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view the LICENSE
|
|
||||||
* file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Flarum\Tags;
|
|
||||||
|
|
||||||
use Flarum\Support\Extension as BaseExtension;
|
|
||||||
use Illuminate\Events\Dispatcher;
|
|
||||||
|
|
||||||
class Extension extends BaseExtension
|
|
||||||
{
|
|
||||||
public function listen(Dispatcher $events)
|
|
||||||
{
|
|
||||||
$events->subscribe('Flarum\Tags\Listeners\AddClientAssets');
|
|
||||||
$events->subscribe('Flarum\Tags\Listeners\AddModelRelationship');
|
|
||||||
$events->subscribe('Flarum\Tags\Listeners\ConfigureDiscussionPermissions');
|
|
||||||
$events->subscribe('Flarum\Tags\Listeners\ConfigureTagPermissions');
|
|
||||||
$events->subscribe('Flarum\Tags\Listeners\AddApiAttributes');
|
|
||||||
$events->subscribe('Flarum\Tags\Listeners\PersistData');
|
|
||||||
$events->subscribe('Flarum\Tags\Listeners\LogDiscussionTagged');
|
|
||||||
$events->subscribe('Flarum\Tags\Listeners\UpdateTagMetadata');
|
|
||||||
$events->subscribe('Flarum\Tags\Listeners\AddTagGambit');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function boot()
|
|
||||||
{
|
|
||||||
Tag::setValidator($this->app->make('validator'));
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user