Archived
1
0
Fork 0

Joined all sources into one script; added commands.

This commit is contained in:
Alexander Yakovlev 2017-08-21 18:22:32 +07:00
parent a17aaccba8
commit 2d2feef3bc
9 changed files with 521 additions and 67 deletions

View file

@ -3,7 +3,7 @@ namespace Source;
use \Game;
class Hyperbook extends Source {
class HyperbookEn extends Source {
public $title = "Гиперкнига";
protected function parse() {
$text = $this->get_text('http://ifiction.net/lib.php?sort=time');

467
composer.lock generated
View file

@ -4,8 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "a88057a9794304517eed65d79e179de4",
"content-hash": "63533762c49f3ee4f112f19df928cef1",
"hash": "a296a064ac4a9d46aa92547a70fee2f8",
"content-hash": "dc702cd7ccff8e6628862101848de338",
"packages": [
{
"name": "aura/autoload",
@ -216,24 +216,71 @@
"time": "2014-05-29 18:38:09"
},
{
"name": "sabre/uri",
"version": "2.1.0",
"name": "psr/log",
"version": "1.0.2",
"source": {
"type": "git",
"url": "https://github.com/fruux/sabre-uri.git",
"reference": "962b4b4b42738e80c0824db26197b56f60c3ca50"
"url": "https://github.com/php-fig/log.git",
"reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fruux/sabre-uri/zipball/962b4b4b42738e80c0824db26197b56f60c3ca50",
"reference": "962b4b4b42738e80c0824db26197b56f60c3ca50",
"url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
"reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Log\\": "Psr/Log/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interface for logging libraries",
"homepage": "https://github.com/php-fig/log",
"keywords": [
"log",
"psr",
"psr-3"
],
"time": "2016-10-10 12:19:37"
},
{
"name": "sabre/uri",
"version": "2.1.1",
"source": {
"type": "git",
"url": "https://github.com/fruux/sabre-uri.git",
"reference": "a42126042c7dcb53e2978dadb6d22574d1359b4c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fruux/sabre-uri/zipball/a42126042c7dcb53e2978dadb6d22574d1359b4c",
"reference": "a42126042c7dcb53e2978dadb6d22574d1359b4c",
"shasum": ""
},
"require": {
"php": ">=7"
},
"require-dev": {
"phpunit/phpunit": "*",
"phpunit/phpunit": "^6.0",
"sabre/cs": "~1.0.0"
},
"type": "library",
@ -264,7 +311,7 @@
"uri",
"url"
],
"time": "2016-12-07 01:22:27"
"time": "2017-02-20 20:02:35"
},
{
"name": "sabre/xml",
@ -328,12 +375,410 @@
"xml"
],
"time": "2016-11-16 00:41:01"
},
{
"name": "symfony/console",
"version": "v3.3.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "b0878233cb5c4391347e5495089c7af11b8e6201"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/b0878233cb5c4391347e5495089c7af11b8e6201",
"reference": "b0878233cb5c4391347e5495089c7af11b8e6201",
"shasum": ""
},
"require": {
"php": ">=5.5.9",
"symfony/debug": "~2.8|~3.0",
"symfony/polyfill-mbstring": "~1.0"
},
"conflict": {
"symfony/dependency-injection": "<3.3"
},
"require-dev": {
"psr/log": "~1.0",
"symfony/config": "~3.3",
"symfony/dependency-injection": "~3.3",
"symfony/event-dispatcher": "~2.8|~3.0",
"symfony/filesystem": "~2.8|~3.0",
"symfony/http-kernel": "~2.8|~3.0",
"symfony/process": "~2.8|~3.0"
},
"suggest": {
"psr/log": "For using the console logger",
"symfony/event-dispatcher": "",
"symfony/filesystem": "",
"symfony/process": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.3-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Console\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
"time": "2017-07-29 21:27:59"
},
{
"name": "symfony/debug",
"version": "v3.3.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
"reference": "7c13ae8ce1e2adbbd574fc39de7be498e1284e13"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/debug/zipball/7c13ae8ce1e2adbbd574fc39de7be498e1284e13",
"reference": "7c13ae8ce1e2adbbd574fc39de7be498e1284e13",
"shasum": ""
},
"require": {
"php": ">=5.5.9",
"psr/log": "~1.0"
},
"conflict": {
"symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2"
},
"require-dev": {
"symfony/http-kernel": "~2.8|~3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.3-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Debug\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Debug Component",
"homepage": "https://symfony.com",
"time": "2017-07-28 15:27:31"
},
{
"name": "symfony/event-dispatcher",
"version": "v3.3.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
"reference": "67535f1e3fd662bdc68d7ba317c93eecd973617e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/67535f1e3fd662bdc68d7ba317c93eecd973617e",
"reference": "67535f1e3fd662bdc68d7ba317c93eecd973617e",
"shasum": ""
},
"require": {
"php": ">=5.5.9"
},
"conflict": {
"symfony/dependency-injection": "<3.3"
},
"require-dev": {
"psr/log": "~1.0",
"symfony/config": "~2.8|~3.0",
"symfony/dependency-injection": "~3.3",
"symfony/expression-language": "~2.8|~3.0",
"symfony/stopwatch": "~2.8|~3.0"
},
"suggest": {
"symfony/dependency-injection": "",
"symfony/http-kernel": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.3-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\EventDispatcher\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
"time": "2017-06-09 14:53:08"
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.5.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "7c8fae0ac1d216eb54349e6a8baa57d515fe8803"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7c8fae0ac1d216eb54349e6a8baa57d515fe8803",
"reference": "7c8fae0ac1d216eb54349e6a8baa57d515fe8803",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"suggest": {
"ext-mbstring": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.5-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Mbstring\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill for the Mbstring extension",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"mbstring",
"polyfill",
"portable",
"shim"
],
"time": "2017-06-14 15:44:48"
},
{
"name": "symfony/process",
"version": "v3.3.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
"reference": "07432804942b9f6dd7b7377faf9920af5f95d70a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/07432804942b9f6dd7b7377faf9920af5f95d70a",
"reference": "07432804942b9f6dd7b7377faf9920af5f95d70a",
"shasum": ""
},
"require": {
"php": ">=5.5.9"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.3-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Process\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Process Component",
"homepage": "https://symfony.com",
"time": "2017-07-13 13:05:09"
},
{
"name": "webmozart/assert",
"version": "1.2.0",
"source": {
"type": "git",
"url": "https://github.com/webmozart/assert.git",
"reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f",
"reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f",
"shasum": ""
},
"require": {
"php": "^5.3.3 || ^7.0"
},
"require-dev": {
"phpunit/phpunit": "^4.6",
"sebastian/version": "^1.0.1"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.3-dev"
}
},
"autoload": {
"psr-4": {
"Webmozart\\Assert\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Bernhard Schussek",
"email": "bschussek@gmail.com"
}
],
"description": "Assertions to validate method input/output with nice error messages.",
"keywords": [
"assert",
"check",
"validate"
],
"time": "2016-11-23 20:04:58"
},
{
"name": "webmozart/console",
"version": "1.0.0-beta5",
"source": {
"type": "git",
"url": "https://github.com/webmozart/console.git",
"reference": "be58c622090e61a2a7c3ad77baae776b46e7f305"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/webmozart/console/zipball/be58c622090e61a2a7c3ad77baae776b46e7f305",
"reference": "be58c622090e61a2a7c3ad77baae776b46e7f305",
"shasum": ""
},
"require": {
"php": ">=5.3.9",
"symfony/console": "^2.7|^3.0",
"symfony/event-dispatcher": "^2.5|^3.0",
"symfony/process": "^2.5|^3.0",
"webmozart/assert": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "^4.6",
"sebastian/version": "^1.0.1",
"symfony/filesystem": "^2.3|^3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"autoload": {
"psr-4": {
"Webmozart\\Console\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Bernhard Schussek",
"email": "bschussek@gmail.com"
}
],
"description": "A usable, beautiful and easily testable console toolkit written in PHP.",
"time": "2016-02-05 10:03:13"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"stability-flags": {
"webmozart/console": 10
},
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],

View file

@ -1,26 +0,0 @@
<?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_en');
if (PHP_SAPI !== 'cli') {
ob_start();
echo '<!DOCTYPE html><html><body><code><pre>';
}
(new Source\Textadventures())->check();
(new Source\IFDB())->check();
(new Source\Dashingdon())->check();
(new Source\Itch())->check();
(new Source\Hyperbook())->check();
if (PHP_SAPI !== 'cli') {
echo '</pre></code></body></html>';
ob_end_flush();
}

64
run.php Executable file
View file

@ -0,0 +1,64 @@
#!/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 ('HyperbookEn', 'hyperbook_en');
check ('Hyperbook', 'hyperbook_ru');
check ('Questbook', 'questbook');
check ('Textadventures', 'textadventures');
check ('IFDB', 'ifdb');
check ('Dashingdon', 'dashingdon');
check ('Itch', 'itch');
if (PHP_SAPI !== 'cli') {
echo '</pre></code></body></html>';
ob_end_flush();
}

View file

@ -1,29 +0,0 @@
<?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');
if (PHP_SAPI !== 'cli') {
ob_start();
echo '<!DOCTYPE html><html><body><code><pre>';
}
(new Source\Urq())->check();
(new Source\Qsp())->check();
(new Source\Kvester())->check();
(new Source\Apero())->check();
(new Source\Instead())->check();
(new Source\Storymaze())->check();
(new Source\Hyperbook())->check();
(new Source\Questbook())->check();
if (PHP_SAPI !== 'cli') {
echo '</pre></code></body></html>';
ob_end_flush();
}