2017-08-21 14:22:32 +03:00
|
|
|
#!/usr/bin/php
|
|
|
|
<?php
|
|
|
|
require "vendor/autoload.php";
|
|
|
|
require "Game.php";
|
|
|
|
require "Source.php";
|
|
|
|
$config = parse_ini_file("./config.ini");
|
|
|
|
define('STYLE',$config['STYLE']);
|
|
|
|
define('FORMAT',$config['FORMAT']);
|
|
|
|
$loader = new \Aura\Autoload\Loader;
|
|
|
|
$loader->register();
|
|
|
|
$loader->addPrefix('Source', 'Source');
|
|
|
|
|
|
|
|
$parsers = 'all';
|
|
|
|
if (PHP_SAPI !== 'cli') {
|
|
|
|
ob_start();
|
|
|
|
echo '<!DOCTYPE html><html><body><code><pre>';
|
|
|
|
} else {
|
|
|
|
if (isset($argv[1])) {
|
|
|
|
$parsers = explode(',', strtolower($argv[1]));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($parsers === 'all' || in_array('all', $parsers)) {
|
|
|
|
$parsers = [
|
2018-03-24 21:49:32 +02:00
|
|
|
'urq',
|
2017-09-15 18:11:55 +03:00
|
|
|
'anivisual',
|
2018-04-27 05:52:21 +03:00
|
|
|
//'kvester',
|
2017-08-21 14:22:32 +03:00
|
|
|
'apero',
|
|
|
|
'instead',
|
|
|
|
'hyperbook_ru',
|
|
|
|
'hyperbook_en',
|
|
|
|
'questbook',
|
|
|
|
'textadventures',
|
|
|
|
'ifdb',
|
|
|
|
'dashingdon',
|
|
|
|
'itch',
|
2017-10-07 11:05:16 +03:00
|
|
|
'gamejolt',
|
2017-10-07 11:53:14 +03:00
|
|
|
'steam',
|
2017-08-21 14:22:32 +03:00
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
function check($classname, $command) {
|
|
|
|
global $parsers;
|
|
|
|
if (in_array($command, $parsers)) {
|
|
|
|
$cname = 'Source\\'.$classname;
|
|
|
|
(new $cname())->check();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-03-24 21:49:32 +02:00
|
|
|
check ('Urq', 'urq');
|
2017-08-21 14:22:32 +03:00
|
|
|
check ('Qsp', 'qsp');
|
2018-04-27 05:52:21 +03:00
|
|
|
//check ('Kvester', 'kvester');
|
2017-08-21 14:22:32 +03:00
|
|
|
check ('Apero', 'apero');
|
|
|
|
check ('Instead', 'instead');
|
|
|
|
check ('Hyperbook', 'hyperbook_ru');
|
|
|
|
check ('Questbook', 'questbook');
|
2017-09-15 18:11:55 +03:00
|
|
|
check ('Anivisual', 'anivisual');
|
2017-08-21 14:44:51 +03:00
|
|
|
// ------- English online libraries
|
|
|
|
check ('HyperbookEn', 'hyperbook_en');
|
2017-08-21 14:22:32 +03:00
|
|
|
check ('Textadventures', 'textadventures');
|
|
|
|
check ('IFDB', 'ifdb');
|
2017-08-21 14:44:51 +03:00
|
|
|
//check ('Dashingdon', 'dashingdon');
|
2017-08-21 14:22:32 +03:00
|
|
|
check ('Itch', 'itch');
|
2017-10-07 11:05:16 +03:00
|
|
|
check ('Gamejolt', 'gamejolt');
|
2017-10-07 11:53:14 +03:00
|
|
|
check ('Steam', 'steam');
|
2017-08-21 14:22:32 +03:00
|
|
|
|
|
|
|
if (PHP_SAPI !== 'cli') {
|
|
|
|
echo '</pre></code></body></html>';
|
|
|
|
ob_end_flush();
|
|
|
|
}
|