-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathconsole
33 lines (26 loc) · 925 Bytes
/
console
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
#!/usr/bin/env php
<?php
/*
* This file is part of the "EloGank League of Legends Replay Downloader" package.
*
* https://github.com/EloGank/lol-replay-downloader
*
* For the full license information, please view the LICENSE
* file that was distributed with this source code.
*/
require 'vendor/autoload.php';
$application = new Symfony\Component\Console\Application();
// List all available commands
$iterator = new \GlobIterator(__DIR__ . '/src/EloGank/Replay/Command/*Command.php');
/** @var \SplFileInfo $command */
foreach ($iterator as $command) {
if ($command->isDir()) {
continue;
}
$namespace = '\\EloGank\\Replay\\Command\\' . substr($command->getFilename(), 0, -4);
$reflectionClass = new \ReflectionClass($namespace);
if ($reflectionClass->isSubclassOf('\\EloGank\\Component\\Command\\Command')) {
$application->add(new $namespace());
}
}
$application->run();