From eb1af659481885469ef1c8bef7ff9163ced09b34 Mon Sep 17 00:00:00 2001 From: DHTMLGoodies Date: Fri, 21 Jun 2013 09:39:37 +0200 Subject: [PATCH] Updated code --- PgnParser.php | 5 +++-- autoload.php | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/PgnParser.php b/PgnParser.php index 5674b25..a025004 100644 --- a/PgnParser.php +++ b/PgnParser.php @@ -27,8 +27,9 @@ class PgnParser $this->pgnContent = $content; } - public function cleanPgn($c) + private function cleanPgn() { + $c = $this->pgnContent; $c = preg_replace("/\\$[0-9]+/s", "", $c); $c = str_replace("({", "( {", $c); $c = preg_replace("/{([^\[]*?)\[([^}]?)}/s", '{$1-SB-$2}', $c); @@ -36,7 +37,7 @@ class PgnParser $c = preg_replace("/\t/s", "", $c); $c = preg_replace("/\]\s+\[/s", "]\n[", $c); $c = str_replace(" [", "[", $c); - $c = preg_replace("/([^\]])(\n+)\[([a-z])/si", "$1\n\n[$3", $c); + $c = preg_replace("/([^\]])(\n+)\[/si", "$1\n\n[", $c); $c = preg_replace("/\n{3,}/s", "\n\n", $c); $c = str_replace("-SB-", "[", $c); $c = str_replace("0-0-0", "O-O-O", $c); diff --git a/autoload.php b/autoload.php index 012ccd0..536fa8e 100644 --- a/autoload.php +++ b/autoload.php @@ -7,6 +7,7 @@ spl_autoload_register( static $classes = null; if ($classes === null) { $classes = array( + 'chess_json' => '/CHESS_JSON.php', 'board0x88config' => '/Board0x88Config.php', 'dgtgameparser' => '/DGTGameParser.php', 'fenparser0x88' => '/FenParser0x88.php',