Commit 91fdff802fc0d7a601bf272268024cc43a837054
1 parent
cb2d2d18
merge with server
Showing
5 changed files
with
163 additions
and
155 deletions
Show diff stats
.gitignore
backend/controllers/ParserController.php
1 | <?php | 1 | <?php |
2 | namespace backend\controllers; | 2 | namespace backend\controllers; |
3 | 3 | ||
4 | +use common\components\parsers\MailParser; | ||
4 | use Yii; | 5 | use Yii; |
5 | use yii\data\ActiveDataProvider; | 6 | use yii\data\ActiveDataProvider; |
6 | use yii\filters\AccessControl; | 7 | use yii\filters\AccessControl; |
@@ -53,6 +54,7 @@ class ParserController extends BaseController | @@ -53,6 +54,7 @@ class ParserController extends BaseController | ||
53 | public function actionIndex($mode = 0) | 54 | public function actionIndex($mode = 0) |
54 | { | 55 | { |
55 | $model = new UploadFileParsingForm(); | 56 | $model = new UploadFileParsingForm(); |
57 | + // $mail = new MailParser(); | ||
56 | // установим режим, 0 - ручная загрузка, 1 - автозагрузка | 58 | // установим режим, 0 - ручная загрузка, 1 - автозагрузка |
57 | $model->mode = $mode; | 59 | $model->mode = $mode; |
58 | return $this->render('index', ['model' => $model]); | 60 | return $this->render('index', ['model' => $model]); |
common/components/parsers/config.php
@@ -52,7 +52,7 @@ | @@ -52,7 +52,7 @@ | ||
52 | ['console' => | 52 | ['console' => |
53 | ['class' => 'yii\multiparser\XmlParser', | 53 | ['class' => 'yii\multiparser\XmlParser', |
54 | 'node' => 'Товар', | 54 | 'node' => 'Товар', |
55 | - 'hasHeaderRow' => true, | 55 | + 'has_header_row' => true, |
56 | 'keys' => [ | 56 | 'keys' => [ |
57 | "BRAND" => 'Производитель', | 57 | "BRAND" => 'Производитель', |
58 | "ARTICLE"=> 'Код', | 58 | "ARTICLE"=> 'Код', |
@@ -72,9 +72,9 @@ | @@ -72,9 +72,9 @@ | ||
72 | ['web' => | 72 | ['web' => |
73 | ['class' => 'yii\multiparser\XlsxParser', | 73 | ['class' => 'yii\multiparser\XlsxParser', |
74 | 'path_for_extract_files' => \Yii::getAlias('@temp_upload') . '/', | 74 | 'path_for_extract_files' => \Yii::getAlias('@temp_upload') . '/', |
75 | + 'has_header_row' => true, | ||
75 | 'converter_conf' => [ | 76 | 'converter_conf' => [ |
76 | 'class' => 'common\components\parsers\CustomConverter', | 77 | 'class' => 'common\components\parsers\CustomConverter', |
77 | - 'hasHeaderRow' => true, | ||
78 | 'configuration' => ["string" => []], | 78 | 'configuration' => ["string" => []], |
79 | ] | 79 | ] |
80 | ], | 80 | ], |
composer.json
@@ -18,6 +18,7 @@ | @@ -18,6 +18,7 @@ | ||
18 | "yiisoft/yii2": ">=2.0.6", | 18 | "yiisoft/yii2": ">=2.0.6", |
19 | "yiisoft/yii2-bootstrap": "*", | 19 | "yiisoft/yii2-bootstrap": "*", |
20 | "yiisoft/yii2-swiftmailer": "*", | 20 | "yiisoft/yii2-swiftmailer": "*", |
21 | + "artweb/yii2-multiparser": "master-dev", | ||
21 | "yiisoft/yii2-imagine": "*" | 22 | "yiisoft/yii2-imagine": "*" |
22 | }, | 23 | }, |
23 | "require-dev": { | 24 | "require-dev": { |
composer.lock
@@ -4,9 +4,55 @@ | @@ -4,9 +4,55 @@ | ||
4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", | 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", |
5 | "This file is @generated automatically" | 5 | "This file is @generated automatically" |
6 | ], | 6 | ], |
7 | - "hash": "8580bd82955b1fbb80d47024e184056e", | 7 | + "hash": "0a5f8749ae4c46cb2b7dd9d3f777c97c", |
8 | + "content-hash": "4c396673df5a5e19daaa0f887579444c", | ||
8 | "packages": [ | 9 | "packages": [ |
9 | { | 10 | { |
11 | + "name": "artweb/yii2-multiparser", | ||
12 | + "version": "dev-master", | ||
13 | + "source": { | ||
14 | + "type": "git", | ||
15 | + "url": "https://github.com/tsurkanovm/yii-multiparser.git", | ||
16 | + "reference": "7a3cd2728c4b0c9db1b6bcea411f8df87b69ecd3" | ||
17 | + }, | ||
18 | + "dist": { | ||
19 | + "type": "zip", | ||
20 | + "url": "https://api.github.com/repos/tsurkanovm/yii-multiparser/zipball/7a3cd2728c4b0c9db1b6bcea411f8df87b69ecd3", | ||
21 | + "reference": "7a3cd2728c4b0c9db1b6bcea411f8df87b69ecd3", | ||
22 | + "shasum": "" | ||
23 | + }, | ||
24 | + "require": { | ||
25 | + "yiisoft/yii2": "*" | ||
26 | + }, | ||
27 | + "type": "library", | ||
28 | + "autoload": { | ||
29 | + "psr-4": { | ||
30 | + "yii\\multiparser\\": "lib\\" | ||
31 | + } | ||
32 | + }, | ||
33 | + "notification-url": "https://packagist.org/downloads/", | ||
34 | + "license": [ | ||
35 | + "MIT" | ||
36 | + ], | ||
37 | + "authors": [ | ||
38 | + { | ||
39 | + "name": "Mihail Tsurkanov", | ||
40 | + "email": "tsurkanovm@gmail.com", | ||
41 | + "role": "Developer" | ||
42 | + } | ||
43 | + ], | ||
44 | + "description": "This extension provides a Multiparser solution for Yii framework 2.0.", | ||
45 | + "homepage": "https://github.com/tsurkanovm/yii-multiparser.git", | ||
46 | + "keywords": [ | ||
47 | + "csv", | ||
48 | + "parser", | ||
49 | + "xlsx", | ||
50 | + "xml", | ||
51 | + "yii2" | ||
52 | + ], | ||
53 | + "time": "2015-10-26 10:04:39" | ||
54 | + }, | ||
55 | + { | ||
10 | "name": "bower-asset/bootstrap", | 56 | "name": "bower-asset/bootstrap", |
11 | "version": "v3.3.5", | 57 | "version": "v3.3.5", |
12 | "source": { | 58 | "source": { |
@@ -317,6 +363,58 @@ | @@ -317,6 +363,58 @@ | ||
317 | "time": "2013-11-30 08:25:19" | 363 | "time": "2013-11-30 08:25:19" |
318 | }, | 364 | }, |
319 | { | 365 | { |
366 | + "name": "imagine/imagine", | ||
367 | + "version": "v0.5.0", | ||
368 | + "source": { | ||
369 | + "type": "git", | ||
370 | + "url": "https://github.com/avalanche123/Imagine.git", | ||
371 | + "reference": "f64ec666baaa800edcbf237db41121a569230709" | ||
372 | + }, | ||
373 | + "dist": { | ||
374 | + "type": "zip", | ||
375 | + "url": "https://api.github.com/repos/avalanche123/Imagine/zipball/f64ec666baaa800edcbf237db41121a569230709", | ||
376 | + "reference": "f64ec666baaa800edcbf237db41121a569230709", | ||
377 | + "shasum": "" | ||
378 | + }, | ||
379 | + "require": { | ||
380 | + "php": ">=5.3.2" | ||
381 | + }, | ||
382 | + "require-dev": { | ||
383 | + "sami/sami": "dev-master" | ||
384 | + }, | ||
385 | + "suggest": { | ||
386 | + "ext-gd": "to use the GD implementation", | ||
387 | + "ext-gmagick": "to use the Gmagick implementation", | ||
388 | + "ext-imagick": "to use the Imagick implementation" | ||
389 | + }, | ||
390 | + "type": "library", | ||
391 | + "autoload": { | ||
392 | + "psr-0": { | ||
393 | + "Imagine": "lib/" | ||
394 | + } | ||
395 | + }, | ||
396 | + "notification-url": "https://packagist.org/downloads/", | ||
397 | + "license": [ | ||
398 | + "MIT" | ||
399 | + ], | ||
400 | + "authors": [ | ||
401 | + { | ||
402 | + "name": "Bulat Shakirzyanov", | ||
403 | + "email": "mallluhuct@gmail.com", | ||
404 | + "homepage": "http://avalanche123.com" | ||
405 | + } | ||
406 | + ], | ||
407 | + "description": "Image processing for PHP 5.3", | ||
408 | + "homepage": "http://imagine.readthedocs.org/", | ||
409 | + "keywords": [ | ||
410 | + "drawing", | ||
411 | + "graphics", | ||
412 | + "image manipulation", | ||
413 | + "image processing" | ||
414 | + ], | ||
415 | + "time": "2013-07-10 17:25:36" | ||
416 | + }, | ||
417 | + { | ||
320 | "name": "swiftmailer/swiftmailer", | 418 | "name": "swiftmailer/swiftmailer", |
321 | "version": "v5.4.1", | 419 | "version": "v5.4.1", |
322 | "source": { | 420 | "source": { |
@@ -459,21 +557,21 @@ | @@ -459,21 +557,21 @@ | ||
459 | }, | 557 | }, |
460 | { | 558 | { |
461 | "name": "yiisoft/yii2-bootstrap", | 559 | "name": "yiisoft/yii2-bootstrap", |
462 | - "version": "2.0.4", | 560 | + "version": "2.0.5", |
463 | "source": { | 561 | "source": { |
464 | "type": "git", | 562 | "type": "git", |
465 | "url": "https://github.com/yiisoft/yii2-bootstrap.git", | 563 | "url": "https://github.com/yiisoft/yii2-bootstrap.git", |
466 | - "reference": "1b6b1e61cf91c3cdd517d6a7e71d30bb212e4af0" | 564 | + "reference": "1464f93834b1d5edb1f5625f7ffd6c3723fa4923" |
467 | }, | 565 | }, |
468 | "dist": { | 566 | "dist": { |
469 | "type": "zip", | 567 | "type": "zip", |
470 | - "url": "https://api.github.com/repos/yiisoft/yii2-bootstrap/zipball/1b6b1e61cf91c3cdd517d6a7e71d30bb212e4af0", | ||
471 | - "reference": "1b6b1e61cf91c3cdd517d6a7e71d30bb212e4af0", | 568 | + "url": "https://api.github.com/repos/yiisoft/yii2-bootstrap/zipball/1464f93834b1d5edb1f5625f7ffd6c3723fa4923", |
569 | + "reference": "1464f93834b1d5edb1f5625f7ffd6c3723fa4923", | ||
472 | "shasum": "" | 570 | "shasum": "" |
473 | }, | 571 | }, |
474 | "require": { | 572 | "require": { |
475 | "bower-asset/bootstrap": "3.3.* | 3.2.* | 3.1.*", | 573 | "bower-asset/bootstrap": "3.3.* | 3.2.* | 3.1.*", |
476 | - "yiisoft/yii2": ">=2.0.4" | 574 | + "yiisoft/yii2": ">=2.0.6" |
477 | }, | 575 | }, |
478 | "type": "yii2-extension", | 576 | "type": "yii2-extension", |
479 | "extra": { | 577 | "extra": { |
@@ -505,7 +603,7 @@ | @@ -505,7 +603,7 @@ | ||
505 | "bootstrap", | 603 | "bootstrap", |
506 | "yii2" | 604 | "yii2" |
507 | ], | 605 | ], |
508 | - "time": "2015-05-10 22:08:17" | 606 | + "time": "2015-09-23 17:48:24" |
509 | }, | 607 | }, |
510 | { | 608 | { |
511 | "name": "yiisoft/yii2-composer", | 609 | "name": "yiisoft/yii2-composer", |
@@ -555,6 +653,54 @@ | @@ -555,6 +653,54 @@ | ||
555 | "time": "2015-03-01 06:22:44" | 653 | "time": "2015-03-01 06:22:44" |
556 | }, | 654 | }, |
557 | { | 655 | { |
656 | + "name": "yiisoft/yii2-imagine", | ||
657 | + "version": "2.0.3", | ||
658 | + "source": { | ||
659 | + "type": "git", | ||
660 | + "url": "https://github.com/yiisoft/yii2-imagine.git", | ||
661 | + "reference": "0961343138b65bba447de84b2b300899617e6acc" | ||
662 | + }, | ||
663 | + "dist": { | ||
664 | + "type": "zip", | ||
665 | + "url": "https://api.github.com/repos/yiisoft/yii2-imagine/zipball/0961343138b65bba447de84b2b300899617e6acc", | ||
666 | + "reference": "0961343138b65bba447de84b2b300899617e6acc", | ||
667 | + "shasum": "" | ||
668 | + }, | ||
669 | + "require": { | ||
670 | + "imagine/imagine": "0.5.*", | ||
671 | + "yiisoft/yii2": "*" | ||
672 | + }, | ||
673 | + "type": "yii2-extension", | ||
674 | + "extra": { | ||
675 | + "branch-alias": { | ||
676 | + "dev-master": "2.0.x-dev" | ||
677 | + } | ||
678 | + }, | ||
679 | + "autoload": { | ||
680 | + "psr-4": { | ||
681 | + "yii\\imagine\\": "" | ||
682 | + } | ||
683 | + }, | ||
684 | + "notification-url": "https://packagist.org/downloads/", | ||
685 | + "license": [ | ||
686 | + "BSD-3-Clause" | ||
687 | + ], | ||
688 | + "authors": [ | ||
689 | + { | ||
690 | + "name": "Antonio Ramirez", | ||
691 | + "email": "amigo.cobos@gmail.com" | ||
692 | + } | ||
693 | + ], | ||
694 | + "description": "The Imagine integration for the Yii framework", | ||
695 | + "keywords": [ | ||
696 | + "helper", | ||
697 | + "image", | ||
698 | + "imagine", | ||
699 | + "yii2" | ||
700 | + ], | ||
701 | + "time": "2015-03-01 06:22:44" | ||
702 | + }, | ||
703 | + { | ||
558 | "name": "yiisoft/yii2-swiftmailer", | 704 | "name": "yiisoft/yii2-swiftmailer", |
559 | "version": "2.0.4", | 705 | "version": "2.0.4", |
560 | "source": { | 706 | "source": { |
@@ -634,101 +780,6 @@ | @@ -634,101 +780,6 @@ | ||
634 | } | 780 | } |
635 | }, | 781 | }, |
636 | { | 782 | { |
637 | - "name": "composer/installers", | ||
638 | - "version": "v1.0.21", | ||
639 | - "source": { | ||
640 | - "type": "git", | ||
641 | - "url": "https://github.com/composer/installers.git", | ||
642 | - "reference": "d64e23fce42a4063d63262b19b8e7c0f3b5e4c45" | ||
643 | - }, | ||
644 | - "dist": { | ||
645 | - "type": "zip", | ||
646 | - "url": "https://api.github.com/repos/composer/installers/zipball/d64e23fce42a4063d63262b19b8e7c0f3b5e4c45", | ||
647 | - "reference": "d64e23fce42a4063d63262b19b8e7c0f3b5e4c45", | ||
648 | - "shasum": "" | ||
649 | - }, | ||
650 | - "replace": { | ||
651 | - "roundcube/plugin-installer": "*", | ||
652 | - "shama/baton": "*" | ||
653 | - }, | ||
654 | - "require-dev": { | ||
655 | - "composer/composer": "1.0.*@dev", | ||
656 | - "phpunit/phpunit": "4.1.*" | ||
657 | - }, | ||
658 | - "type": "composer-installer", | ||
659 | - "extra": { | ||
660 | - "class": "Composer\\Installers\\Installer", | ||
661 | - "branch-alias": { | ||
662 | - "dev-master": "1.0-dev" | ||
663 | - } | ||
664 | - }, | ||
665 | - "autoload": { | ||
666 | - "psr-0": { | ||
667 | - "Composer\\Installers\\": "src/" | ||
668 | - } | ||
669 | - }, | ||
670 | - "notification-url": "https://packagist.org/downloads/", | ||
671 | - "license": [ | ||
672 | - "MIT" | ||
673 | - ], | ||
674 | - "authors": [ | ||
675 | - { | ||
676 | - "name": "Kyle Robinson Young", | ||
677 | - "email": "kyle@dontkry.com", | ||
678 | - "homepage": "https://github.com/shama" | ||
679 | - } | ||
680 | - ], | ||
681 | - "description": "A multi-framework Composer library installer", | ||
682 | - "homepage": "http://composer.github.com/installers/", | ||
683 | - "keywords": [ | ||
684 | - "Craft", | ||
685 | - "Dolibarr", | ||
686 | - "Hurad", | ||
687 | - "MODX Evo", | ||
688 | - "OXID", | ||
689 | - "SMF", | ||
690 | - "Thelia", | ||
691 | - "WolfCMS", | ||
692 | - "agl", | ||
693 | - "aimeos", | ||
694 | - "annotatecms", | ||
695 | - "bitrix", | ||
696 | - "cakephp", | ||
697 | - "chef", | ||
698 | - "codeigniter", | ||
699 | - "concrete5", | ||
700 | - "croogo", | ||
701 | - "dokuwiki", | ||
702 | - "drupal", | ||
703 | - "elgg", | ||
704 | - "fuelphp", | ||
705 | - "grav", | ||
706 | - "installer", | ||
707 | - "joomla", | ||
708 | - "kohana", | ||
709 | - "laravel", | ||
710 | - "lithium", | ||
711 | - "magento", | ||
712 | - "mako", | ||
713 | - "mediawiki", | ||
714 | - "modulework", | ||
715 | - "moodle", | ||
716 | - "phpbb", | ||
717 | - "piwik", | ||
718 | - "ppi", | ||
719 | - "puppet", | ||
720 | - "roundcube", | ||
721 | - "shopware", | ||
722 | - "silverstripe", | ||
723 | - "symfony", | ||
724 | - "typo3", | ||
725 | - "wordpress", | ||
726 | - "zend", | ||
727 | - "zikula" | ||
728 | - ], | ||
729 | - "time": "2015-02-18 17:17:01" | ||
730 | - }, | ||
731 | - { | ||
732 | "name": "fzaninotto/faker", | 783 | "name": "fzaninotto/faker", |
733 | "version": "v1.5.0", | 784 | "version": "v1.5.0", |
734 | "source": { | 785 | "source": { |
@@ -815,55 +866,6 @@ | @@ -815,55 +866,6 @@ | ||
815 | "time": "2013-11-01 13:02:21" | 866 | "time": "2013-11-01 13:02:21" |
816 | }, | 867 | }, |
817 | { | 868 | { |
818 | - "name": "silverstripe/framework", | ||
819 | - "version": "3.1.13", | ||
820 | - "source": { | ||
821 | - "type": "git", | ||
822 | - "url": "https://github.com/silverstripe/silverstripe-framework.git", | ||
823 | - "reference": "04b803dfc6dc60f2e6a38fa74f957156230b54be" | ||
824 | - }, | ||
825 | - "dist": { | ||
826 | - "type": "zip", | ||
827 | - "url": "https://api.github.com/repos/silverstripe/silverstripe-framework/zipball/04b803dfc6dc60f2e6a38fa74f957156230b54be", | ||
828 | - "reference": "04b803dfc6dc60f2e6a38fa74f957156230b54be", | ||
829 | - "shasum": "" | ||
830 | - }, | ||
831 | - "require": { | ||
832 | - "composer/installers": "*", | ||
833 | - "php": ">=5.3.2" | ||
834 | - }, | ||
835 | - "require-dev": { | ||
836 | - "phpunit/phpunit": "~3.7@stable" | ||
837 | - }, | ||
838 | - "type": "silverstripe-module", | ||
839 | - "autoload": { | ||
840 | - "classmap": [ | ||
841 | - "tests/behat/features/bootstrap" | ||
842 | - ] | ||
843 | - }, | ||
844 | - "notification-url": "https://packagist.org/downloads/", | ||
845 | - "license": [ | ||
846 | - "BSD-3-Clause" | ||
847 | - ], | ||
848 | - "authors": [ | ||
849 | - { | ||
850 | - "name": "SilverStripe", | ||
851 | - "homepage": "http://silverstripe.com" | ||
852 | - }, | ||
853 | - { | ||
854 | - "name": "The SilverStripe Community", | ||
855 | - "homepage": "http://silverstripe.org" | ||
856 | - } | ||
857 | - ], | ||
858 | - "description": "The SilverStripe framework", | ||
859 | - "homepage": "http://silverstripe.org", | ||
860 | - "keywords": [ | ||
861 | - "framework", | ||
862 | - "silverstripe" | ||
863 | - ], | ||
864 | - "time": "2015-05-28 06:59:11" | ||
865 | - }, | ||
866 | - { | ||
867 | "name": "yiisoft/yii2-codeception", | 869 | "name": "yiisoft/yii2-codeception", |
868 | "version": "2.0.4", | 870 | "version": "2.0.4", |
869 | "source": { | 871 | "source": { |
@@ -1058,7 +1060,9 @@ | @@ -1058,7 +1060,9 @@ | ||
1058 | ], | 1060 | ], |
1059 | "aliases": [], | 1061 | "aliases": [], |
1060 | "minimum-stability": "stable", | 1062 | "minimum-stability": "stable", |
1061 | - "stability-flags": [], | 1063 | + "stability-flags": { |
1064 | + "artweb/yii2-multiparser": 20 | ||
1065 | + }, | ||
1062 | "prefer-stable": false, | 1066 | "prefer-stable": false, |
1063 | "prefer-lowest": false, | 1067 | "prefer-lowest": false, |
1064 | "platform": { | 1068 | "platform": { |