承接 engineered/sprykerphpbridge 相关项目开发

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

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

engineered/sprykerphpbridge

最新稳定版本:0.1.1

Composer 安装命令:

composer require engineered/sprykerphpbridge

包简介

A PHP wrapper for the Spryker Glue API

README 文档

README

A PHP wrapper for the Spryker Glue API.

Written in PHP using Gacela

Q. So what does this do and why is it useful?

A. This package allows you to easily interact with the Spryker Glue API in your 3rd party PHP Application.

Q. So... erm... why? Why not just use Spryker...? It's already a great PHP application!

A. Well we know...! But this package allows you to use Spryker data in any PHP Application...!

Installation

composer require engineered/sprykerphpbridge

Example

For a full example see here.

<?php

require __DIR__ . '/vendor/autoload.php';

// Change YOUR_GLUE_URL to something like: 'https://glue.de.b2c.demo-spryker.com'
$sprykerBridge = SprykerBridge::create(YOUR_GLUE_URL);

// get the category trees

$categoryTress = $sprykerBridge->category()->getTrees();
//outputs

{
    "data": [
        {
            "type": "category-trees",
            "id": null,
            "attributes": {
                "categoryNodesStorage": [
                    {
                        "nodeId": 5,
                        "order": 100,
                        "name": "Computers",
                        "url": "/en/computers",
                        ... (etc) ...
                    },
                  
                ]
            },
            "links": {
                "self": "https://glue.de.b2c.demo-spryker.com/category-trees"
            }
        }
    ],
    "links": {
        "self": "https://glue.de.b2c.demo-spryker.com/category-trees"
    }
}

Development with Docker (Optional)

Just by having docker installed and running make on the root of the project, you'll have everything you need for development. Every developer will have the same PHP and Composer versions.

This command does the following:

  • Builds the required docker images with the required binaries for development (php, composer and other stuff)
  • Installs dependencies with composer
  • Setups the git hooks
  • Boots the development stack

By default, the PHP container executes a dummy long-running process, so the container is always up and running. You can configure a remote interpreter in PHPStorm that points to that running container to run test suites and get code analysis.

When you are done working, make stop is your best friend.

You can still use your own PHP version, but then you risk your changes to be rejected due to incompatibility or having issues installing / upgrading dependencies.

Running Commands

There are predefines commands on the Makefile to run the most common tasks.

You can run make pr to get feedback on the overall quality of your code. You can also run make statica to run the static analysis, make fmt to format the code according to the PHP CS Fixer standards defined in the project, or make test to run the test suite. All these run on the docker stack, so make sure your services are up and running with make boot.

If you want to install a package or run a specific command, is best to do so through the docker stack. So a composer install would look like this:

docker-compose exec lib composer install

This is quite long to type, so there are two alternatives:

First, you can create an alias for docker-compose, like dc

dc exec lib composer install

Another option is to run make shell and open a shell directly into the container. Then you can run the commands as if you were in your machine:

composer install

Git Hooks

The git hooks validate that your code is good to merge. By default, a pre-commit hook is installed that runs make pr every time you commit.

You can always use the --no-verify flag to bypass the git hook:

git commit -m 'your message' --no-verify

But I like to use them by default to catch potential easy-to-check mistakes.

Contribute

You are more than welcome to contribute by reporting issues, or contributing with your Pull Requests.

统计信息

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

GitHub 信息

  • Stars: 7
  • Watchers: 4
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-11-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固