Commit 603a219fbf0b6b7eec8e0eab27289761c1966132

Authored by Mihail
1 parent 9d9d876f

add multiparser package

.gitignore
1 1 .idea
2   -/uploads
3 2 \ No newline at end of file
  3 +/uploads
  4 +/vendor
4 5 \ No newline at end of file
... ...
backend/models/UploadFileParsingForm.php
... ... @@ -79,6 +79,7 @@ class UploadFileParsingForm extends Model
79 79 //@ todo - перестало работать - нет доступа на удалениев этом сеансе, в следующем - файл удаляется - разобраться
80 80 //unlink( $this->file_path );
81 81  
  82 +
82 83 return $data;
83 84 }
84 85  
... ...
common/components/parsers/config.php
... ... @@ -51,7 +51,7 @@
51 51 ['console' =>
52 52 ['class' => 'yii\multiparser\XmlParser',
53 53 'node' => 'Товар',
54   - 'hasHeaderRow' => true,
  54 + 'has_header_row' => true,
55 55 'keys' => [
56 56 "BRAND" => 'Производитель',
57 57 "ARTICLE"=> 'Код',
... ... @@ -70,10 +70,11 @@
70 70 'xlsx' =>
71 71 ['web' =>
72 72 ['class' => 'yii\multiparser\XlsxParser',
73   - 'path_for_extract_files' => \Yii::getAlias('@temp_upload') . '/',
  73 + 'path_for_extract_files' => \Yii::getAlias('@temp_upload') . '/xlsx/',
  74 + 'has_header_row' => true,
  75 + 'active_sheet' => 2,
74 76 'converter_conf' => [
75 77 'class' => 'common\components\parsers\CustomConverter',
76   - 'hasHeaderRow' => true,
77 78 'configuration' => ["string" => []],
78 79 ]
79 80 ],
... ...
composer.json
... ... @@ -18,6 +18,7 @@
18 18 "yiisoft/yii2": ">=2.0.6",
19 19 "yiisoft/yii2-bootstrap": "*",
20 20 "yiisoft/yii2-swiftmailer": "*",
  21 + "artweb/yii2-multiparser": "dev-master",
21 22 "yiisoft/yii2-imagine": "*"
22 23 },
23 24 "require-dev": {
... ...
composer.lock
... ... @@ -4,9 +4,55 @@
4 4 "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
5 5 "This file is @generated automatically"
6 6 ],
7   - "hash": "8580bd82955b1fbb80d47024e184056e",
  7 + "hash": "c82a0b48e9d917d19deff3e70988e9e1",
  8 + "content-hash": "91acdf28733394f58a82e0550d685d7d",
8 9 "packages": [
9 10 {
  11 + "name": "artweb/yii2-multiparser",
  12 + "version": "dev-master",
  13 + "source": {
  14 + "type": "git",
  15 + "url": "git@github.com:tsurkanovm/yii-multiparser.git",
  16 + "reference": "d1fac7a9ab175babccfe47e9a448528b154db928"
  17 + },
  18 + "dist": {
  19 + "type": "zip",
  20 + "url": "https://api.github.com/repos/tsurkanovm/yii-multiparser/zipball/d1fac7a9ab175babccfe47e9a448528b154db928",
  21 + "reference": "d1fac7a9ab175babccfe47e9a448528b154db928",
  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-27 11:59:34"
  54 + },
  55 + {
10 56 "name": "bower-asset/bootstrap",
11 57 "version": "v3.3.5",
12 58 "source": {
... ... @@ -317,6 +363,58 @@
317 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 418 "name": "swiftmailer/swiftmailer",
321 419 "version": "v5.4.1",
322 420 "source": {
... ... @@ -459,21 +557,21 @@
459 557 },
460 558 {
461 559 "name": "yiisoft/yii2-bootstrap",
462   - "version": "2.0.4",
  560 + "version": "2.0.5",
463 561 "source": {
464 562 "type": "git",
465 563 "url": "https://github.com/yiisoft/yii2-bootstrap.git",
466   - "reference": "1b6b1e61cf91c3cdd517d6a7e71d30bb212e4af0"
  564 + "reference": "1464f93834b1d5edb1f5625f7ffd6c3723fa4923"
467 565 },
468 566 "dist": {
469 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 570 "shasum": ""
473 571 },
474 572 "require": {
475 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 576 "type": "yii2-extension",
479 577 "extra": {
... ... @@ -505,7 +603,7 @@
505 603 "bootstrap",
506 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 609 "name": "yiisoft/yii2-composer",
... ... @@ -555,6 +653,54 @@
555 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 704 "name": "yiisoft/yii2-swiftmailer",
559 705 "version": "2.0.4",
560 706 "source": {
... ... @@ -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 783 "name": "fzaninotto/faker",
733 784 "version": "v1.5.0",
734 785 "source": {
... ... @@ -815,55 +866,6 @@
815 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 869 "name": "yiisoft/yii2-codeception",
868 870 "version": "2.0.4",
869 871 "source": {
... ... @@ -1058,7 +1060,9 @@
1058 1060 ],
1059 1061 "aliases": [],
1060 1062 "minimum-stability": "stable",
1061   - "stability-flags": [],
  1063 + "stability-flags": {
  1064 + "artweb/yii2-multiparser": 20
  1065 + },
1062 1066 "prefer-stable": false,
1063 1067 "prefer-lowest": false,
1064 1068 "platform": {
... ...
vendor/composer/autoload_psr4.php
... ... @@ -7,6 +7,7 @@ $baseDir = dirname($vendorDir);
7 7  
8 8 return array(
9 9 'yii\\swiftmailer\\' => array($vendorDir . '/yiisoft/yii2-swiftmailer'),
  10 + 'yii\\multiparser\\' => array($vendorDir . '/artweb/yii2-multiparser/lib'),
10 11 'yii\\imagine\\' => array($vendorDir . '/yiisoft/yii2-imagine'),
11 12 'yii\\gii\\' => array($vendorDir . '/yiisoft/yii2-gii'),
12 13 'yii\\faker\\' => array($vendorDir . '/yiisoft/yii2-faker'),
... ...
vendor/composer/installed.json
... ... @@ -1043,5 +1043,52 @@
1043 1043 "imagine",
1044 1044 "yii2"
1045 1045 ]
  1046 + },
  1047 + {
  1048 + "name": "artweb/yii2-multiparser",
  1049 + "version": "dev-master",
  1050 + "version_normalized": "9999999-dev",
  1051 + "source": {
  1052 + "type": "git",
  1053 + "url": "git@github.com:tsurkanovm/yii-multiparser.git",
  1054 + "reference": "d1fac7a9ab175babccfe47e9a448528b154db928"
  1055 + },
  1056 + "dist": {
  1057 + "type": "zip",
  1058 + "url": "https://api.github.com/repos/tsurkanovm/yii-multiparser/zipball/d1fac7a9ab175babccfe47e9a448528b154db928",
  1059 + "reference": "d1fac7a9ab175babccfe47e9a448528b154db928",
  1060 + "shasum": ""
  1061 + },
  1062 + "require": {
  1063 + "yiisoft/yii2": "*"
  1064 + },
  1065 + "time": "2015-10-27 11:59:34",
  1066 + "type": "library",
  1067 + "installation-source": "dist",
  1068 + "autoload": {
  1069 + "psr-4": {
  1070 + "yii\\multiparser\\": "lib\\"
  1071 + }
  1072 + },
  1073 + "notification-url": "https://packagist.org/downloads/",
  1074 + "license": [
  1075 + "MIT"
  1076 + ],
  1077 + "authors": [
  1078 + {
  1079 + "name": "Mihail Tsurkanov",
  1080 + "email": "tsurkanovm@gmail.com",
  1081 + "role": "Developer"
  1082 + }
  1083 + ],
  1084 + "description": "This extension provides a Multiparser solution for Yii framework 2.0.",
  1085 + "homepage": "https://github.com/tsurkanovm/yii-multiparser.git",
  1086 + "keywords": [
  1087 + "csv",
  1088 + "parser",
  1089 + "xlsx",
  1090 + "xml",
  1091 + "yii2"
  1092 + ]
1046 1093 }
1047 1094 ]
... ...