Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
64 lines (54 sloc) 1.79 KB
<?php
error_reporting(-1);
include_once(realpath(dirname(__FILE__)) . '/autoloader.php');
require_once(realpath(dirname(__FILE__)) . '/../vendor/Dice/Dice.php');
require_once(realpath(dirname(__FILE__)) . '/../config.php');
autoloader::init();
$dice = new \Dice\Dice;
$dice->addRule(
'\SlackScore\Models\Request',
[
'shared' => true,
'constructParams' => [$_REQUEST]
]
);
$dice->addRule(
'\SlackScore\Utils\SlackPost',
[
'shared' => true,
'constructParams' => [$config['posturl'], $config['username'], $config['channel']]
]
);
$dice->addRule(
'\SlackScore\Repository\JsonUserRepository',
[
'shared' => true,
'constructParams' => [$config['users']],
'substitutions' => ['SlackScore\Storage\IStorage' => ['instance' => '\SlackScore\Storage\FileSystem']]
]
);
$dice->addRule(
'\SlackScore\Repository\SlackUserRepository',
[
'shared' => true,
'constructParams' => [$config['botToken']]
]
);
$dice->addRule(
'\SlackScore\Utils\Comeback',
[
'constructParams' => [$config['phrases']],
'substitutions' => [
'SlackScore\Repository\IUserRepository' => ['instance' => '\SlackScore\Repository\JsonUserRepository']
]
]
);
$dice->addRule(
'\SlackScore\Main',
[
'constructParams' => [$config['token']],
'substitutions' => [
'SlackScore\Repository\IUserRepository' => ['instance' => '\SlackScore\Repository\JsonUserRepository']
]
]
);