From e937b336aef1ae92719512c5e041a22588290842 Mon Sep 17 00:00:00 2001 From: Alex Lushpai Date: Tue, 19 Aug 2014 22:54:38 +0400 Subject: [PATCH] add download directory check --- admin/controller/module/intarocrm.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/admin/controller/module/intarocrm.php b/admin/controller/module/intarocrm.php index 2c04773..d6cce08 100644 --- a/admin/controller/module/intarocrm.php +++ b/admin/controller/module/intarocrm.php @@ -390,7 +390,13 @@ class ControllerModuleIntarocrm extends Controller { } public function export() { - file_put_contents(__DIR__ . '/../../../download/intarocrm.xml', $this->xml()); + $downloadPath = __DIR__ . '/../../../download/'; + + if (!file_exists($downloadPath)) { + mkdir($downloadPath, 0755); + } + + file_put_contents($downloadPath . 'intarocrm.xml', $this->xml()); } private function validate() {