forked from tcds-io/php-layer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplayer
More file actions
executable file
·32 lines (25 loc) · 768 Bytes
/
Copy pathplayer
File metadata and controls
executable file
·32 lines (25 loc) · 768 Bytes
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
#!/usr/bin/env php
<?php
declare (strict_types=1);
use Symfony\Component\Console\Output\ConsoleOutput;
use Tcds\Io\Player\Exception\PlayerException;
use Tcds\Io\Player\Formatter;
use Tcds\Io\Player\Player;
include __DIR__ . '/../../autoload.php' ?? throw new Exception('Missing ');
$playerFile = __DIR__ . '/../../../player.php';
/**
* creates config
*/
if (!is_file($playerFile)) {
copy(__DIR__ . '/player.php.sample', $playerFile);
}
$config = include __DIR__ . '/../../../player.php';
$console = new ConsoleOutput();
try {
Player::create()->check($config);
$console->writeln('');
$console->writeln(Formatter::success('No leaking imports'));
} catch (PlayerException $exception) {
$console->writeln($exception->output());
exit(1);
}