akeneo/magento-admin-extractor
最新稳定版本:v1.0.0-BETA3
Composer 安装命令:
composer require akeneo/magento-admin-extractor
包简介
Allows to extract data from Magento crawling the back-end for testing purpose
README 文档
README
What MagentoAdminExtractor is about ?
The component use Goutte to connect to the Magento back-end and extracts data which are human-visible. Its main purpose is to be included in the Magento Connector Bundle (https://github.com/akeneo/MagentoConnectorBundle) test suite in order to check that data sent to Magento are well received.
What can I do with MagentoAdminExtractor ?
- Allows to connect to Magento Admin
- Allows to navigate in Magento backend
- Allows to change the number of rows you can view par page in grid
- Allows to extract products with their attributes and associations
- Allows to extract attributes with their parameters and options
- Allows to extract categories tree
How to install MagentoAdminExtractor ?
Clone the project :
git clone git@github.com:akeneo/MagentoAdminExtractor.git
And then create a symlink in your project with ln -s path_to_MagentoAdminExtractor path_to_your_project
How to use the extractor ?
Prerequisite
Remove the secret keys to url to be able to extract data. System -> Configuration -> Advanced -> Admin -> Security -> Add secret key to urls : NO
Try to extract
You can have a try and see examples of code with test.php, add print_r() on data you want to see in terminal and
$ php test.php
Connect to a Magento back-end
use Akeneo\Component\MagentoAdminExtractor\Manager\LogInException; use Akeneo\Component\MagentoAdminExtractor\Manager\MagentoAdminConnectionManager; $connectionManager = new MagentoAdminConnectionManager( MAGENTO_ADMIN_URL, MAGENTO_ADMIN_LOGIN, MAGENTO_ADMIN_PWD ); try { $mainPageCrawler = $connectionManager->connectToAdminPage(); $client = $connectionManager->getClient(); } catch (LogInException $e) { die($e->getMessage() . PHP_EOL); }
Navigate with navigation manager
Second argument of ->goToXXXCatalog() is a numeric and allows you specify the number of rows per page you want to have in your grid. It's 20 by default.
use Akeneo\Component\MagentoAdminExtractor\Manager\NavigationManager; $client = $connectionManager->getClient(); $navigationManager = new NavigationManager($client); $productCatalogCrawler = $navigationManager->goToProductCatalog($mainPageCrawler, 50); $attributeCatalogCrawler = $navigationManager->goToAttributeCatalog($mainPageCrawler, 50); $myURLCrawler = $navigationManager->goToUri('GET', 'http://magento.local/index.php/admin/catalog_product/edit/id/5/key/secret_key/store/1');
How to extract products and their attributes ?
use Akeneo\Component\MagentoAdminExtractor\Extractor\ProductAttributeExtractor; $productAttributeExtractor = new ProductAttributeExtractor($navigationManager); $productCatalogCrawler = $navigationManager->goToProductCatalog($mainPageCrawler, 50); $products = $productAttributeExtractor->filterRowsAndExtract($productCatalogCrawler);
How to extract attributes ?
use Akeneo\Component\MagentoAdminExtractor\Extractor\AttributeExtractor; $attributeExtractor = new AttributeExtractor($navigationManager); $attributeCatalogCrawler = $navigationManager->goToAttributeCatalog($mainPageCrawler, 50); $attributes = $attributeExtractor->filterRowsAndExtract($attributeCatalogCrawler);
How to extract categories ?
use Akeneo\Component\MagentoAdminExtractor\Extractor\CategoriesExtractor; $categoriesExtractor = new CategoriesExtractor($navigationManager); $categories = $categoriesExtractor->extract($mainPageCrawler);
How to create my own extractor ?
New extractor for entities in a grid
class MyEntityExtractor extends AbstractGridExtractor { public function extract(Crawler $myEntityNodeCrawler, $myEntityName = '') { // Your stuff here } protected function getExtractedEntity() { return 'myEntity'; } }
New extractor for entities not in a grid
class MyEntityExtractor extends AbstractExtractor { public function extract(Crawler $mainPageCrawler) { // Your stuff here } }
What Magento versions are supported by Akeneo MagentoAdminExtractor ?
For now the component is only tested with Magento 1.8.
akeneo/magento-admin-extractor 适用场景与选型建议
akeneo/magento-admin-extractor 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 167 次下载、GitHub Stars 达 8, 最近一次更新时间为 2015 年 01 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「data」 「ecommerce」 「e-commerce」 「magento」 「extractor」 「akeneo」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 akeneo/magento-admin-extractor 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 akeneo/magento-admin-extractor 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 akeneo/magento-admin-extractor 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Shoot aims to make providing data to your templates more manageable
Implementation of the Omnibus Directive for Sylius application.
Nevogate Payment Gateway SDK
Adds the EDTF data type to Wikibase
A simple library that allows transform any kind of data to native php data or whatever
Livewire starter kit for Lunar e-commerce.
统计信息
- 总下载量: 167
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 23
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: OSL-3.0
- 更新时间: 2015-01-08