You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

94 lines
2.4 KiB

  1. #!/usr/bin/php
  2. <?php
  3. /*
  4. A set of utilities for tracking text-based game releases
  5. Copyright (C) 2017-2018 Alexander Yakovlev
  6. This program is free software: you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. require "vendor/autoload.php";
  18. use Symfony\Component\Yaml\Yaml;
  19. use Oreolek\Game;
  20. use Oreolek\Source;
  21. $config = Yaml::parse(file_get_contents('config.yml'));
  22. define('STYLE',$config['STYLE']);
  23. define('FORMAT',$config['FORMAT']);
  24. $parsers = 'all';
  25. if (PHP_SAPI !== 'cli') {
  26. ob_start();
  27. echo '<!DOCTYPE html><html><body><code><pre>';
  28. if (isset($_GET['parsers'])) {
  29. $parsers = $_GET['parsers'];
  30. $parsers = explode(',', $parsers);
  31. }
  32. } else {
  33. if (isset($argv[1])) {
  34. $parsers = explode(',', strtolower($argv[1]));
  35. }
  36. }
  37. if ($parsers === 'all') {
  38. $parsers = [
  39. 'urq',
  40. 'anivisual',
  41. 'kvester',
  42. //'vndb',
  43. 'apero',
  44. 'instory',
  45. // 'instead',
  46. 'hyperbook_ru',
  47. 'hyperbook_en',
  48. 'questbook',
  49. 'textadventures',
  50. 'ifdb',
  51. 'dashingdon',
  52. 'itch',
  53. 'gamejolt',
  54. 'steam',
  55. ];
  56. }
  57. function check($classname, $command) {
  58. global $parsers;
  59. if (is_array($parsers) && in_array($command, $parsers)) {
  60. $cname = 'Oreolek\\Source\\'.$classname;
  61. (new $cname())->check();
  62. }
  63. }
  64. check ('Urq', 'urq');
  65. check ('Qsp', 'qsp');
  66. check ('Kvester', 'kvester');
  67. check ('Apero', 'apero');
  68. check ('Instead', 'instead');
  69. check ('Hyperbook', 'hyperbook_ru');
  70. check ('Questbook', 'questbook');
  71. //check ('Instory', 'instory');
  72. check ('Anivisual', 'anivisual');
  73. // ------- English online libraries
  74. check ('HyperbookEn', 'hyperbook_en');
  75. check ('Textadventures', 'textadventures');
  76. check ('IFDB', 'ifdb');
  77. check ('VNDB', 'vndb');
  78. //check ('Dashingdon', 'dashingdon');
  79. check ('Itch', 'itch');
  80. check ('Gamejolt', 'gamejolt');
  81. check ('Steam', 'steam');
  82. if (PHP_SAPI !== 'cli') {
  83. echo '</pre></code></body></html>';
  84. ob_end_flush();
  85. }