@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | public function process() { |
| 17 | 17 | echo "zip=no\n"; |
| 18 | - echo 'file_limit=' . \Tools::toBytes(ini_get('post_max_size')); |
|
| 18 | + echo 'file_limit='.\Tools::toBytes(ini_get('post_max_size')); |
|
| 19 | 19 | $this->end(); |
| 20 | 20 | |
| 21 | 21 | //clean files |
@@ -23,9 +23,9 @@ discard block |
||
| 23 | 23 | $query = \App::$cur->db->newQuery(); |
| 24 | 24 | $query->operation = 'select'; |
| 25 | 25 | $query->table = \Exchange1c\Exchange\File::table(); |
| 26 | - $query->cols = \Exchange1c\Exchange\File::colPrefix() . 'id'; |
|
| 26 | + $query->cols = \Exchange1c\Exchange\File::colPrefix().'id'; |
|
| 27 | 27 | $queryArr = $query->buildQuery(); |
| 28 | - $queryArr['query'].=' where `' . \Exchange1c\Exchange\File::colPrefix() . 'deleted` = 0 AND `' . \Exchange1c\Exchange\File::colPrefix() . 'date_create` < NOW() - INTERVAL ' . \App::$cur->exchange1c->config['maxSaveFilesInterval']; |
|
| 28 | + $queryArr['query'] .= ' where `'.\Exchange1c\Exchange\File::colPrefix().'deleted` = 0 AND `'.\Exchange1c\Exchange\File::colPrefix().'date_create` < NOW() - INTERVAL '.\App::$cur->exchange1c->config['maxSaveFilesInterval']; |
|
| 29 | 29 | try { |
| 30 | 30 | $ids = array_keys($query->query($queryArr)->getArray(\Exchange1c\Exchange\File::colPrefix().'id')); |
| 31 | 31 | } catch (\PDOException $exc) { |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | } elseif ($exc->getCode() == '42S22') { |
| 35 | 35 | $cols = \Exchange1c\Exchange\File::cols(); |
| 36 | 36 | foreach (\Exchange1c\Exchange\File::$cols as $colName => $params) { |
| 37 | - if (!isset($cols[\Exchange1c\Exchange\File::colPrefix() . $colName])) { |
|
| 37 | + if (!isset($cols[\Exchange1c\Exchange\File::colPrefix().$colName])) { |
|
| 38 | 38 | \Exchange1c\Exchange\File::createCol($colName); |
| 39 | 39 | } |
| 40 | 40 | } |
@@ -25,20 +25,20 @@ |
||
| 25 | 25 | $filename = \Tools::parsePath($_GET['filename']); |
| 26 | 26 | if (strpos($filename, '/') !== false) { |
| 27 | 27 | $subDir = substr($filename, 0, strrpos($filename, "/") + 1); |
| 28 | - \Tools::createDir($dir . '/' . $subDir); |
|
| 28 | + \Tools::createDir($dir.'/'.$subDir); |
|
| 29 | 29 | } |
| 30 | 30 | $text = ''; |
| 31 | - if (false === file_put_contents($dir . '/' . $filename, file_get_contents("php://input"))) { |
|
| 32 | - $text = 'Fail on save file: ' . $filename; |
|
| 31 | + if (false === file_put_contents($dir.'/'.$filename, file_get_contents("php://input"))) { |
|
| 32 | + $text = 'Fail on save file: '.$filename; |
|
| 33 | 33 | $file->status = 'failure'; |
| 34 | 34 | } else { |
| 35 | - $file->size = ceil(filesize($dir . '/' . $filename)); |
|
| 35 | + $file->size = ceil(filesize($dir.'/'.$filename)); |
|
| 36 | 36 | $file->name = $filename; |
| 37 | 37 | $file->status = 'success'; |
| 38 | 38 | } |
| 39 | 39 | $file->save(); |
| 40 | 40 | if (strpos($filename, '1cbitrix') !== false) { |
| 41 | - $data = new \SimpleXMLElement(file_get_contents($dir . '/' . $filename)); |
|
| 41 | + $data = new \SimpleXMLElement(file_get_contents($dir.'/'.$filename)); |
|
| 42 | 42 | $orders = new \Exchange1c\Parser\Orders($data); |
| 43 | 43 | $orders->process(); |
| 44 | 44 | } |
@@ -30,8 +30,8 @@ |
||
| 30 | 30 | ]; |
| 31 | 31 | |
| 32 | 32 | public function deleteFile() { |
| 33 | - if ($this->exchange && file_exists($this->exchange->path . '/' . $this->name)) { |
|
| 34 | - unlink($this->exchange->path . '/' . $this->name); |
|
| 33 | + if ($this->exchange && file_exists($this->exchange->path.'/'.$this->name)) { |
|
| 34 | + unlink($this->exchange->path.'/'.$this->name); |
|
| 35 | 35 | } |
| 36 | 36 | $this->deleted = 1; |
| 37 | 37 | $this->save(); |