-
Notifications
You must be signed in to change notification settings - Fork 0
/
polyauth
50 lines (41 loc) · 1.17 KB
/
polyauth
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
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env php
<?php
//set a default timezone if it hasn't already been set
if (empty(ini_get('date.timezone'))) {
date_default_timezone_set('UTC');
}
//no timelimit on cli commands
set_time_limit(0);
//locating composer's autoloader, we need the autoloader to be able to use this cli tool
if (file_exists(__DIR__ . '/vendor/autoload.php')) {
//during development
require_once(__DIR__ .'/vendor/autoload.php');
} elseif (file_exists(__DIR__.'/../../autoload.php')) {
//composer installed, we need to go up vendor/vendornamespace/package/executable
require_once __DIR__ . '/../../autoload.php';
} else {
throw new Exception('Composer\'s autoloader could not be located.');
}
use Symfony\Component\Console\Application;
use PolyAuth\Console\Database\Seed;
use PolyAuth\Console\RBAC\Import;
use PolyAuth\Console\RBAC\Export;
use PolyAuth\Console\RBAC\CreateRole;
/**
* Commands:
* db:seed
* rbac:import
* rbac:export
* rbac:createrole
* rbac:createpermission
* users:CRUD
* groups:CRUD
*/
$application = new Application('PolyAuth', '1.0.0');
$application->addCommands([
new Seed,
new Import,
new Export,
new CreateRole,
]);
$application->run();