From 85b957c8af244a9e7a5495ab46b162b98ad966f6 Mon Sep 17 00:00:00 2001 From: "origami11@yandex.ru" Date: Wed, 17 Apr 2024 20:37:27 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D1=81=D1=82=D0=B0=D0=BD=D0=BE=D0=B2?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=B8=D0=B7=20=D0=BF=D0=B0=D0=BF=D0=BA=D0=B8=20?= =?UTF-8?q?=D0=B2=D0=BC=D0=B5=D1=81=D1=82=D0=BE=20=D0=B0=D1=80=D1=85=D0=B8?= =?UTF-8?q?=D0=B2=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Setup.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/Setup.php b/src/Setup.php index 52958f8..a001080 100644 --- a/src/Setup.php +++ b/src/Setup.php @@ -8,8 +8,19 @@ * */ namespace ctiso; -use ZipArchive, - ctiso\Tools\SQLStatementExtractor; +use ctiso\Tools\SQLStatementExtractor; +use ctiso\Path; + +class FakeZipArchive { + public $base; + function open($path) { + $this->base = $path; + } + + function getFromName($file) { + return file_get_contents(Path::join($this->base, $file)); + } +} class Setup { @@ -32,8 +43,8 @@ class Setup $this->target = ''; $this->source = ''; - $this->zip = new ZipArchive(); - $this->zip->open(strtr($file, array('.xml' => '.zip'))); + $this->zip = new FakeZipArchive(); + $this->zip->open(strtr($file, array('.xml' => ''))); array_push($this->stack, $this->node);