1
0
mirror of https://github.com/flarum/core.git synced 2025-07-19 07:41:22 +02:00

Add extension generator command.

This commit is contained in:
Toby Zerner
2015-06-08 14:56:19 +09:30
parent ef73b0cabb
commit a41d02f030
10 changed files with 202 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
<?php
// Require the extension's composer autoload file. This will enable all of our
// classes in the src directory to be autoloaded.
require __DIR__.'/vendor/autoload.php';
// Register our service provider with the Flarum application. In here we can
// register bindings and execute code when the application boots.
return $this->app->register('{{namespace}}\{{classPrefix}}ServiceProvider');

View File

@@ -0,0 +1,11 @@
{
"require": {
"php": ">=5.4.0"
},
"autoload": {
"psr-4": {
"{{escapedNamespace}}\\": "src/"
}
},
"minimum-stability": "dev"
}

View File

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

View File

@@ -0,0 +1,5 @@
var gulp = require('flarum-gulp');
gulp({
modulePrefix: '{{name}}'
});

View File

@@ -0,0 +1,7 @@
import { extend, override } from 'flarum/extension-utils';
app.initializers.add('{{name}}', function() {
// @todo
});

View File

@@ -0,0 +1,7 @@
{
"private": true,
"devDependencies": {
"gulp": "^3.8.11",
"flarum-gulp": "git+https://github.com/flarum/gulp.git"
}
}

View File

@@ -0,0 +1,32 @@
<?php namespace {{namespace}};
use Flarum\Support\ServiceProvider;
use Flarum\Extend\ForumAssets;
class {{classPrefix}}ServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application events.
*
* @return void
*/
public function boot()
{
$this->extend(
new ForumAssets([
__DIR__.'/../js/dist/extension.js',
__DIR__.'/../less/extension.less'
])
);
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
//
}
}