diff --git a/.gitignore b/.gitignore index 5d27534..7f736e5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .idea -/uploads \ No newline at end of file +/uploads +/vendor \ No newline at end of file diff --git a/backend/models/UploadFileParsingForm.php b/backend/models/UploadFileParsingForm.php index 3832072..60fd82e 100644 --- a/backend/models/UploadFileParsingForm.php +++ b/backend/models/UploadFileParsingForm.php @@ -79,6 +79,7 @@ class UploadFileParsingForm extends Model //@ todo - перестало работать - нет доступа на удалениев этом сеансе, в следующем - файл удаляется - разобраться //unlink( $this->file_path ); + return $data; } diff --git a/common/components/parsers/config.php b/common/components/parsers/config.php index 7a250dc..b273c29 100644 --- a/common/components/parsers/config.php +++ b/common/components/parsers/config.php @@ -51,7 +51,7 @@ ['console' => ['class' => 'yii\multiparser\XmlParser', 'node' => 'Товар', - 'hasHeaderRow' => true, + 'has_header_row' => true, 'keys' => [ "BRAND" => 'Производитель', "ARTICLE"=> 'Код', @@ -70,10 +70,11 @@ 'xlsx' => ['web' => ['class' => 'yii\multiparser\XlsxParser', - 'path_for_extract_files' => \Yii::getAlias('@temp_upload') . '/', + 'path_for_extract_files' => \Yii::getAlias('@temp_upload') . '/xlsx/', + 'has_header_row' => true, + 'active_sheet' => 2, 'converter_conf' => [ 'class' => 'common\components\parsers\CustomConverter', - 'hasHeaderRow' => true, 'configuration' => ["string" => []], ] ], diff --git a/composer.json b/composer.json index 35aa241..228a48b 100644 --- a/composer.json +++ b/composer.json @@ -18,6 +18,7 @@ "yiisoft/yii2": ">=2.0.6", "yiisoft/yii2-bootstrap": "*", "yiisoft/yii2-swiftmailer": "*", + "artweb/yii2-multiparser": "dev-master", "yiisoft/yii2-imagine": "*" }, "require-dev": { diff --git a/composer.lock b/composer.lock index b0a1f37..36ad68f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,9 +4,55 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "8580bd82955b1fbb80d47024e184056e", + "hash": "c82a0b48e9d917d19deff3e70988e9e1", + "content-hash": "91acdf28733394f58a82e0550d685d7d", "packages": [ { + "name": "artweb/yii2-multiparser", + "version": "dev-master", + "source": { + "type": "git", + "url": "git@github.com:tsurkanovm/yii-multiparser.git", + "reference": "d1fac7a9ab175babccfe47e9a448528b154db928" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tsurkanovm/yii-multiparser/zipball/d1fac7a9ab175babccfe47e9a448528b154db928", + "reference": "d1fac7a9ab175babccfe47e9a448528b154db928", + "shasum": "" + }, + "require": { + "yiisoft/yii2": "*" + }, + "type": "library", + "autoload": { + "psr-4": { + "yii\\multiparser\\": "lib\\" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mihail Tsurkanov", + "email": "tsurkanovm@gmail.com", + "role": "Developer" + } + ], + "description": "This extension provides a Multiparser solution for Yii framework 2.0.", + "homepage": "https://github.com/tsurkanovm/yii-multiparser.git", + "keywords": [ + "csv", + "parser", + "xlsx", + "xml", + "yii2" + ], + "time": "2015-10-27 11:59:34" + }, + { "name": "bower-asset/bootstrap", "version": "v3.3.5", "source": { @@ -317,6 +363,58 @@ "time": "2013-11-30 08:25:19" }, { + "name": "imagine/imagine", + "version": "v0.5.0", + "source": { + "type": "git", + "url": "https://github.com/avalanche123/Imagine.git", + "reference": "f64ec666baaa800edcbf237db41121a569230709" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/avalanche123/Imagine/zipball/f64ec666baaa800edcbf237db41121a569230709", + "reference": "f64ec666baaa800edcbf237db41121a569230709", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "require-dev": { + "sami/sami": "dev-master" + }, + "suggest": { + "ext-gd": "to use the GD implementation", + "ext-gmagick": "to use the Gmagick implementation", + "ext-imagick": "to use the Imagick implementation" + }, + "type": "library", + "autoload": { + "psr-0": { + "Imagine": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bulat Shakirzyanov", + "email": "mallluhuct@gmail.com", + "homepage": "http://avalanche123.com" + } + ], + "description": "Image processing for PHP 5.3", + "homepage": "http://imagine.readthedocs.org/", + "keywords": [ + "drawing", + "graphics", + "image manipulation", + "image processing" + ], + "time": "2013-07-10 17:25:36" + }, + { "name": "swiftmailer/swiftmailer", "version": "v5.4.1", "source": { @@ -459,21 +557,21 @@ }, { "name": "yiisoft/yii2-bootstrap", - "version": "2.0.4", + "version": "2.0.5", "source": { "type": "git", "url": "https://github.com/yiisoft/yii2-bootstrap.git", - "reference": "1b6b1e61cf91c3cdd517d6a7e71d30bb212e4af0" + "reference": "1464f93834b1d5edb1f5625f7ffd6c3723fa4923" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/yiisoft/yii2-bootstrap/zipball/1b6b1e61cf91c3cdd517d6a7e71d30bb212e4af0", - "reference": "1b6b1e61cf91c3cdd517d6a7e71d30bb212e4af0", + "url": "https://api.github.com/repos/yiisoft/yii2-bootstrap/zipball/1464f93834b1d5edb1f5625f7ffd6c3723fa4923", + "reference": "1464f93834b1d5edb1f5625f7ffd6c3723fa4923", "shasum": "" }, "require": { "bower-asset/bootstrap": "3.3.* | 3.2.* | 3.1.*", - "yiisoft/yii2": ">=2.0.4" + "yiisoft/yii2": ">=2.0.6" }, "type": "yii2-extension", "extra": { @@ -505,7 +603,7 @@ "bootstrap", "yii2" ], - "time": "2015-05-10 22:08:17" + "time": "2015-09-23 17:48:24" }, { "name": "yiisoft/yii2-composer", @@ -555,6 +653,54 @@ "time": "2015-03-01 06:22:44" }, { + "name": "yiisoft/yii2-imagine", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/yiisoft/yii2-imagine.git", + "reference": "0961343138b65bba447de84b2b300899617e6acc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/yiisoft/yii2-imagine/zipball/0961343138b65bba447de84b2b300899617e6acc", + "reference": "0961343138b65bba447de84b2b300899617e6acc", + "shasum": "" + }, + "require": { + "imagine/imagine": "0.5.*", + "yiisoft/yii2": "*" + }, + "type": "yii2-extension", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "yii\\imagine\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Antonio Ramirez", + "email": "amigo.cobos@gmail.com" + } + ], + "description": "The Imagine integration for the Yii framework", + "keywords": [ + "helper", + "image", + "imagine", + "yii2" + ], + "time": "2015-03-01 06:22:44" + }, + { "name": "yiisoft/yii2-swiftmailer", "version": "2.0.4", "source": { @@ -634,101 +780,6 @@ } }, { - "name": "composer/installers", - "version": "v1.0.21", - "source": { - "type": "git", - "url": "https://github.com/composer/installers.git", - "reference": "d64e23fce42a4063d63262b19b8e7c0f3b5e4c45" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/installers/zipball/d64e23fce42a4063d63262b19b8e7c0f3b5e4c45", - "reference": "d64e23fce42a4063d63262b19b8e7c0f3b5e4c45", - "shasum": "" - }, - "replace": { - "roundcube/plugin-installer": "*", - "shama/baton": "*" - }, - "require-dev": { - "composer/composer": "1.0.*@dev", - "phpunit/phpunit": "4.1.*" - }, - "type": "composer-installer", - "extra": { - "class": "Composer\\Installers\\Installer", - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-0": { - "Composer\\Installers\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kyle Robinson Young", - "email": "kyle@dontkry.com", - "homepage": "https://github.com/shama" - } - ], - "description": "A multi-framework Composer library installer", - "homepage": "http://composer.github.com/installers/", - "keywords": [ - "Craft", - "Dolibarr", - "Hurad", - "MODX Evo", - "OXID", - "SMF", - "Thelia", - "WolfCMS", - "agl", - "aimeos", - "annotatecms", - "bitrix", - "cakephp", - "chef", - "codeigniter", - "concrete5", - "croogo", - "dokuwiki", - "drupal", - "elgg", - "fuelphp", - "grav", - "installer", - "joomla", - "kohana", - "laravel", - "lithium", - "magento", - "mako", - "mediawiki", - "modulework", - "moodle", - "phpbb", - "piwik", - "ppi", - "puppet", - "roundcube", - "shopware", - "silverstripe", - "symfony", - "typo3", - "wordpress", - "zend", - "zikula" - ], - "time": "2015-02-18 17:17:01" - }, - { "name": "fzaninotto/faker", "version": "v1.5.0", "source": { @@ -815,55 +866,6 @@ "time": "2013-11-01 13:02:21" }, { - "name": "silverstripe/framework", - "version": "3.1.13", - "source": { - "type": "git", - "url": "https://github.com/silverstripe/silverstripe-framework.git", - "reference": "04b803dfc6dc60f2e6a38fa74f957156230b54be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/silverstripe/silverstripe-framework/zipball/04b803dfc6dc60f2e6a38fa74f957156230b54be", - "reference": "04b803dfc6dc60f2e6a38fa74f957156230b54be", - "shasum": "" - }, - "require": { - "composer/installers": "*", - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "~3.7@stable" - }, - "type": "silverstripe-module", - "autoload": { - "classmap": [ - "tests/behat/features/bootstrap" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "SilverStripe", - "homepage": "http://silverstripe.com" - }, - { - "name": "The SilverStripe Community", - "homepage": "http://silverstripe.org" - } - ], - "description": "The SilverStripe framework", - "homepage": "http://silverstripe.org", - "keywords": [ - "framework", - "silverstripe" - ], - "time": "2015-05-28 06:59:11" - }, - { "name": "yiisoft/yii2-codeception", "version": "2.0.4", "source": { @@ -1058,7 +1060,9 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "artweb/yii2-multiparser": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index c5e2036..b6e9819 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -7,6 +7,7 @@ $baseDir = dirname($vendorDir); return array( 'yii\\swiftmailer\\' => array($vendorDir . '/yiisoft/yii2-swiftmailer'), + 'yii\\multiparser\\' => array($vendorDir . '/artweb/yii2-multiparser/lib'), 'yii\\imagine\\' => array($vendorDir . '/yiisoft/yii2-imagine'), 'yii\\gii\\' => array($vendorDir . '/yiisoft/yii2-gii'), 'yii\\faker\\' => array($vendorDir . '/yiisoft/yii2-faker'), diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 88927fc..151269b 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1043,5 +1043,52 @@ "imagine", "yii2" ] + }, + { + "name": "artweb/yii2-multiparser", + "version": "dev-master", + "version_normalized": "9999999-dev", + "source": { + "type": "git", + "url": "git@github.com:tsurkanovm/yii-multiparser.git", + "reference": "d1fac7a9ab175babccfe47e9a448528b154db928" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tsurkanovm/yii-multiparser/zipball/d1fac7a9ab175babccfe47e9a448528b154db928", + "reference": "d1fac7a9ab175babccfe47e9a448528b154db928", + "shasum": "" + }, + "require": { + "yiisoft/yii2": "*" + }, + "time": "2015-10-27 11:59:34", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "yii\\multiparser\\": "lib\\" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mihail Tsurkanov", + "email": "tsurkanovm@gmail.com", + "role": "Developer" + } + ], + "description": "This extension provides a Multiparser solution for Yii framework 2.0.", + "homepage": "https://github.com/tsurkanovm/yii-multiparser.git", + "keywords": [ + "csv", + "parser", + "xlsx", + "xml", + "yii2" + ] } ] -- libgit2 0.21.4