Merge branch 'composer'

This commit is contained in:
Toby Zerner 2015-10-03 17:11:17 +09:30
commit d6b829414c
12 changed files with 71 additions and 70 deletions

View File

@ -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');
};

View File

@ -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"
}
]
} }

View File

@ -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"
}
}

View File

@ -1,3 +1,2 @@
bower_components bower_components
node_modules node_modules
dist

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View 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

View File

@ -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'));
}
}