Archived
1
0
Fork 0
This repository has been archived on 2020-07-31. You can view files and clone it, but cannot push or open issues or pull requests.
news-script/run.php

66 lines
1.4 KiB
PHP
Raw Normal View History

#!/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 = [
// 'urq',
'kvester',
'apero',
'instead',
'storymaze',
'hyperbook_ru',
'hyperbook_en',
'questbook',
'textadventures',
'ifdb',
'dashingdon',
'itch',
];
}
function check($classname, $command) {
global $parsers;
if (in_array($command, $parsers)) {
$cname = 'Source\\'.$classname;
(new $cname())->check();
}
}
//check ('Urq', 'urq');
check ('Qsp', 'qsp');
check ('Kvester', 'kvester');
check ('Apero', 'apero');
check ('Instead', 'instead');
check ('Storymaze', 'storymaze');
check ('Hyperbook', 'hyperbook_ru');
check ('Questbook', 'questbook');
// ------- English online libraries
check ('HyperbookEn', 'hyperbook_en');
check ('Textadventures', 'textadventures');
check ('IFDB', 'ifdb');
//check ('Dashingdon', 'dashingdon');
check ('Itch', 'itch');
if (PHP_SAPI !== 'cli') {
echo '</pre></code></body></html>';
ob_end_flush();
}