-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.php
More file actions
40 lines (33 loc) · 1.51 KB
/
bootstrap.php
File metadata and controls
40 lines (33 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
use Foolz\FoolFrame\Model\Autoloader;
use Foolz\FoolFrame\Model\Context;
use Foolz\Plugin\Event;
class HHVM_Dice
{
public function run()
{
Event::forge('Foolz\Plugin\Plugin::execute#foolz/foolfuuka-plugin-dice-roll')
->setCall(function($result) {
/* @var Context $context */
$context = $result->getParam('context');
/** @var Autoloader $autoloader */
$autoloader = $context->getService('autoloader');
$autoloader->addClass('Foolz\FoolFuuka\Plugins\DiceRoll\Model\Dice', __DIR__.'/classes/model/dice.php');
Event::forge('Foolz\FoolFuuka\Model\CommentInsert::insert#obj.afterInputCheck')
->setCall('Foolz\FoolFuuka\Plugins\DiceRoll\Model\Dice::roll')
->setPriority(4);
Event::forge('Foolz\FoolFuuka\Model\RadixCollection::structure#var.structure')
->setCall(function($result) {
$structure = $result->getParam('structure');
$structure['plugin_dice_roll_enable'] = [
'database' => true,
'boards_preferences' => true,
'type' => 'checkbox',
'help' => _i('Enable dice roll?')
];
$result->setParam('structure', $structure)->set($structure);
})->setPriority(4);
});
}
}
(new HHVM_Dice())->run();