承接 smalot/magento-bundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

smalot/magento-bundle

最新稳定版本:v0.4

Composer 安装命令:

composer require smalot/magento-bundle

包简介

A Symfony2 wrapper for the Magento Soap Client API

README 文档

README

This project is a bridge between Symfony 2 and Magento-Client API which allow to call easily the Magento Soap v1 API.

Scrutinizer Code Quality Total Downloads Current Version License

Allows :

  • wrappers for each call
  • dependencies injections
  • event listeners
  • debug toolbar integration
  • and ... code completion

Requirements

  • Symfony >= 2.1
  • PHP >= 5.3
  • smalot/magento-client

Installation

Add the following lines to your composer.json:

{
    "require": {
        "smalot/magento-bundle": "*"
    }
}

And run php composer.phar update smalot/magento-bundle

Then, register the bundle in your kernel:

# app/AppKernel.php

# ...

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            # ...
            new Smalot\MagentoBundle\MagentoBundle(),
        );

        return $bundles;
    }
}

Configuration

You need to setup at least one connection in the connections pool and specify it with the default_connection property. The mandatory properties are: url, api_user and api_key.

# app/config/config.yml

# Sample configuration
magento:
    # Refers to the default connection in the connection pool
    default_connection:   default # Example: default

    # List all available connections
    connections:

        # Prototype
        default:
            url:                  http://domain.tld/magento/
            api_user:             username
            api_key:              0123456789AZ

            # Enable logging system
            logging:              %kernel.debug%

            # Refers to the logger service
            logger:               ~

            # Refers to the dispatcher service
            dispatcher:           ~

Details

Service(s) provided:

  • magento

Events thrown in security context:

  • \Smalot\MagentoBundle\MagentoEvents::PRE_LOGIN
  • \Smalot\MagentoBundle\MagentoEvents::POST_LOGIN
  • \Smalot\MagentoBundle\MagentoEvents::PRE_LOGOUT
  • \Smalot\MagentoBundle\MagentoEvents::POST_LOGOUT

Events thrown in transport context:

  • \Smalot\MagentoBundle\MagentoEvents::PRE_SINGLE_CALL
  • \Smalot\MagentoBundle\MagentoEvents::POST_SINGLE_CALL
  • \Smalot\MagentoBundle\MagentoEvents::PRE_MULTI_CALL
  • \Smalot\MagentoBundle\MagentoEvents::POST_MULTI_CALL

Sample codes

Using the default connection:

class MagentoController extends Controller
{
    /**
     * @Route("/", name="magento_index")
     */
    public function indexAction(Request $request)
    {
        // Retrieve default connection.
        $magento = $this->get('magento')->getManager();

        if ($magento->ping()) {
            // Call any module's class.
            $categoryManager = new \Smalot\Magento\Catalog\Category($magento);
            $tree            = $categoryManager->getTree()->execute();
        } else {
            $tree = array();
        }

        $magento->logout();

        return new Response('<html><body><pre>' . var_export($tree, true) . '</pre></body></html>');
    }
}

The connection can be specified manually if needed:

$magento = $this->get('magento')->getManager('second_connection_name');

统计信息

  • 总下载量: 5.49k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 9
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 9
  • Watchers: 3
  • Forks: 8
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-05-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固