Example #1
0
use Model\Notification;
$config = new Config($registry);
$project = new Project($registry);
$task = new Task($registry);
$user = new User($registry);
$category = new Category($registry);
$comment = new Comment($registry);
$subtask = new SubTask($registry);
$board = new Board($registry);
$action = new Action($registry);
$webhook = new Webhook($registry);
$notification = new Notification($registry);
$action->attachEvents();
$project->attachEvents();
$webhook->attachEvents();
$notification->attachEvents();
// Load translations
$language = $config->get('language', 'en_US');
if ($language !== 'en_US') {
    Translator::load($language);
}
$server = new Server();
$server->authentication(array('jsonrpc' => $config->get('api_token')));
/**
 * Project procedures
 */
$server->register('createProject', function ($name) use($project) {
    $values = array('name' => $name);
    list($valid, ) = $project->validateCreation($values);
    return $valid && $project->create($values);
});