add download directory check

This commit is contained in:
Alex Lushpai 2014-08-19 22:54:38 +04:00
parent d2c1948ebc
commit e937b336ae

View File

@ -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() {