Download the PHP package enm/shopware-sdk without Composer

On this page you can find all versions of the php package enm/shopware-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package shopware-sdk

Shopware SDK

Build Status SensioLabsInsight

This library provides an extendable abstraction for the Shopware REST-API. The provided default implementation is based on jms/serializer and guzzlehttp/guzzle. All provided interfaces can be used without installing Guzzle or the Serializer.

Installation

composer require enm/shopware-sdk

If you want to use the default implementation you also have to run:

composer require guzzlehttp/guzzle

composer require jms/serializer

Usage

\Doctrine\Common\Annotations\AnnotationRegistry::registerAutoloadNamespace(
    'JMS\Serializer\Annotation', __DIR__.'/../vendor/jms/serializer/src'
);

$client = new \Enm\ShopwareSdk\Http\GuzzleAdapter(new \GuzzleHttp\Client());
$client->withConfig('http://example.com', 'user', 'apiKey');

$serializer = \JMS\Serializer\SerializerBuilder::create()->build();

$entryPoint = new \Enm\ShopwareSdk\EntryPoint($client);

$entryPoint->addSerializer(new \Enm\ShopwareSdk\Response\ArticleHandler($serializer));
$entryPoint->addSerializer(new \Enm\ShopwareSdk\Response\OrderHandler($serializer));

$entryPoint->addDeserializer(new \Enm\ShopwareSdk\Response\ArticleHandler($serializer));
$entryPoint->addDeserializer(new \Enm\ShopwareSdk\Response\OrderHandler($serializer));

OR

$entryPoint = \Enm\ShopwareSdk\EntryPoint::buildDefault('http://example.com', 'user', 'apiKey');

The endpoints can be called like this:

$entryPoint->articles()->findAll();
$entryPoint->articles()->find(1);

$entryPoint->orders()->findAll();
$entryPoint->orders()->find(1);

Concepts

Entry Point

An entry point should implement \Enm\ShopwareSdk\EntryPointInterface and is responsible for creation and management of endpoint instances.

The default entry point (\Enm\ShopwareSdk\EntryPoint) needs a configured http client and a serializer and deserializer for each endpoint.

A serializer can be added by calling:

    $entryPoint->addSerializer($serializer);

A deserializer can be added by calling:

    $entryPoint->addDeserializer($serializer);

Endpoints

An endpoint is responsible for providing access to a specific sub part of the shopware api.

The ArticelEndpoint for example is responsible to access all api routes under /api/articles.

All default endpoints extending the abstract endpoint which needs a http client and a response handler.

(HTTP-)Client

The http client is responsible to request an api route and create a PSR-7 response object with the result.

The default client (\Enm\ShopwareSdk\Http\GuzzleAdapter) uses the Guzzle http client.

Serializer / Deserializer

A serializer is responsible for converting a given PHP object into the needed json string.

A deserializer is responsible for converting the json response into the needed PHP object.

The default handlers (combination of serializer and deserializer) are based on JMS Serializer and can be added by calling addDefaultSerializers and addDefaultDeserializers from the default EntryPoint.

If you don't want to use it, you can write your own which have to implement \Enm\ShopwareSdk\Serializer\JsonSerializerinterface and/or \Enm\ShopwareSdk\Serializer\JsonDeserializerinterface.

A (de)serializer must return all supported types if getSupportedTypes is called. A type is the class name of the models interface, for example: \Enm\ShopwareSdk\Model\Order\OrderInterface for the OrderEnpoint.


All versions of shopware-sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
psr/http-message Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package enm/shopware-sdk contains the following files

Loading the files please wait ....