@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | class File extends \Exchange1c\Mode { |
| 15 | 15 | |
| 16 | - public function process() { |
|
| 16 | + public function process() { |
|
| 17 | 17 | $dir = $this->exchange->path; |
| 18 | 18 | \Tools::createDir($dir); |
| 19 | 19 | $file = new \Exchange1c\Exchange\File(); |
@@ -23,25 +23,25 @@ discard block |
||
| 23 | 23 | $file->save(); |
| 24 | 24 | |
| 25 | 25 | if (strpos($_GET['filename'], '/') !== false) { |
| 26 | - $subDir = substr($_GET['filename'], 0, strrpos($_GET['filename'], "/") + 1); |
|
| 27 | - \Tools::createDir($dir . '/' . $subDir); |
|
| 26 | + $subDir = substr($_GET['filename'], 0, strrpos($_GET['filename'], "/") + 1); |
|
| 27 | + \Tools::createDir($dir . '/' . $subDir); |
|
| 28 | 28 | } |
| 29 | 29 | $text = ''; |
| 30 | 30 | if (false === file_put_contents($dir . '/' . $_GET['filename'], file_get_contents("php://input"))) { |
| 31 | - $text = 'Fail on save file: ' . $_GET['filename']; |
|
| 32 | - $file->status = 'failure'; |
|
| 31 | + $text = 'Fail on save file: ' . $_GET['filename']; |
|
| 32 | + $file->status = 'failure'; |
|
| 33 | 33 | } else { |
| 34 | - $file->size = ceil(filesize($dir . '/' . $_GET['filename'])); |
|
| 35 | - $file->status = 'success'; |
|
| 34 | + $file->size = ceil(filesize($dir . '/' . $_GET['filename'])); |
|
| 35 | + $file->status = 'success'; |
|
| 36 | 36 | } |
| 37 | 37 | $file->save(); |
| 38 | 38 | if (strpos($_GET['filename'], '1cbitrix') !== false) { |
| 39 | - $data = new \SimpleXMLElement(file_get_contents($dir . '/' . $_GET['filename'])); |
|
| 40 | - $orders = new \Exchange1c\Parser\Orders($data); |
|
| 41 | - $orders->process(); |
|
| 39 | + $data = new \SimpleXMLElement(file_get_contents($dir . '/' . $_GET['filename'])); |
|
| 40 | + $orders = new \Exchange1c\Parser\Orders($data); |
|
| 41 | + $orders->process(); |
|
| 42 | 42 | } |
| 43 | 43 | \App::$cur->exchange1c->response($file->status, $text, false); |
| 44 | 44 | $this->end($file->status); |
| 45 | - } |
|
| 45 | + } |
|
| 46 | 46 | |
| 47 | 47 | } |
@@ -24,19 +24,19 @@ |
||
| 24 | 24 | |
| 25 | 25 | if (strpos($_GET['filename'], '/') !== false) { |
| 26 | 26 | $subDir = substr($_GET['filename'], 0, strrpos($_GET['filename'], "/") + 1); |
| 27 | - \Tools::createDir($dir . '/' . $subDir); |
|
| 27 | + \Tools::createDir($dir.'/'.$subDir); |
|
| 28 | 28 | } |
| 29 | 29 | $text = ''; |
| 30 | - if (false === file_put_contents($dir . '/' . $_GET['filename'], file_get_contents("php://input"))) { |
|
| 31 | - $text = 'Fail on save file: ' . $_GET['filename']; |
|
| 30 | + if (false === file_put_contents($dir.'/'.$_GET['filename'], file_get_contents("php://input"))) { |
|
| 31 | + $text = 'Fail on save file: '.$_GET['filename']; |
|
| 32 | 32 | $file->status = 'failure'; |
| 33 | 33 | } else { |
| 34 | - $file->size = ceil(filesize($dir . '/' . $_GET['filename'])); |
|
| 34 | + $file->size = ceil(filesize($dir.'/'.$_GET['filename'])); |
|
| 35 | 35 | $file->status = 'success'; |
| 36 | 36 | } |
| 37 | 37 | $file->save(); |
| 38 | 38 | if (strpos($_GET['filename'], '1cbitrix') !== false) { |
| 39 | - $data = new \SimpleXMLElement(file_get_contents($dir . '/' . $_GET['filename'])); |
|
| 39 | + $data = new \SimpleXMLElement(file_get_contents($dir.'/'.$_GET['filename'])); |
|
| 40 | 40 | $orders = new \Exchange1c\Parser\Orders($data); |
| 41 | 41 | $orders->process(); |
| 42 | 42 | } |
@@ -13,18 +13,18 @@ |
||
| 13 | 13 | |
| 14 | 14 | class File extends \Model { |
| 15 | 15 | |
| 16 | - public static $cols = [ |
|
| 17 | - 'name' => ['type' => 'text'], |
|
| 18 | - 'size' => ['type' => 'number'], |
|
| 19 | - 'status' => ['type' => 'text'], |
|
| 20 | - 'date_create' => ['type' => 'dateTime'], |
|
| 21 | - ]; |
|
| 22 | - public static $dataManagers = [ |
|
| 23 | - 'manager' => [ |
|
| 24 | - 'cols' => [ |
|
| 25 | - 'name', 'size', 'date_create' |
|
| 26 | - ], |
|
| 27 | - ] |
|
| 28 | - ]; |
|
| 16 | + public static $cols = [ |
|
| 17 | + 'name' => ['type' => 'text'], |
|
| 18 | + 'size' => ['type' => 'number'], |
|
| 19 | + 'status' => ['type' => 'text'], |
|
| 20 | + 'date_create' => ['type' => 'dateTime'], |
|
| 21 | + ]; |
|
| 22 | + public static $dataManagers = [ |
|
| 23 | + 'manager' => [ |
|
| 24 | + 'cols' => [ |
|
| 25 | + 'name', 'size', 'date_create' |
|
| 26 | + ], |
|
| 27 | + ] |
|
| 28 | + ]; |
|
| 29 | 29 | |
| 30 | 30 | } |