move path creation to separate file
authorChristian Weiske <cweiske@cweiske.de>
Mon, 11 May 2020 21:43:21 +0000 (23:43 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Mon, 11 May 2020 21:43:21 +0000 (23:43 +0200)
bin/functions.php [new file with mode: 0644]
bin/import-game-data.php

diff --git a/bin/functions.php b/bin/functions.php
new file mode 100644 (file)
index 0000000..fe94108
--- /dev/null
@@ -0,0 +1,10 @@
+<?php
+/**
+ * Functions needed by import-game-data.php and build-html.php
+ */
+
+function categoryPath($title)
+{
+    return str_replace(['/', '\\', ' ', '+', '?'], '_', $title);
+}
+?>
index 14996c4635a71e5ebb27f6544722f1db404d3c68..11ed6b38993ba0e3297cad953ffba1bee7d690d3 100755 (executable)
@@ -7,6 +7,7 @@
  * @author Christian Weiske <cweiske@cweiske.de>
  */
 ini_set('xdebug.halt_level', E_WARNING|E_NOTICE|E_USER_WARNING|E_USER_NOTICE);
  * @author Christian Weiske <cweiske@cweiske.de>
  */
 ini_set('xdebug.halt_level', E_WARNING|E_NOTICE|E_USER_WARNING|E_USER_NOTICE);
+require_once __DIR__ . '/functions.php';
 require_once __DIR__ . '/filters.php';
 if (!isset($argv[1])) {
     error('Pass the path to a "folders" file with game data json files folder names');
 require_once __DIR__ . '/filters.php';
 if (!isset($argv[1])) {
     error('Pass the path to a "folders" file with game data json files folder names');
@@ -698,11 +699,6 @@ function buildDiscoverGameTile($game)
     ];
 }
 
     ];
 }
 
-function categoryPath($title)
-{
-    return str_replace(['/', '\\', ' ', '+', '?'], '_', $title);
-}
-
 function getAllAges($games)
 {
     $ages = [];
 function getAllAges($games)
 {
     $ages = [];