Download the PHP package commercetools/symfony-bundle without Composer

On this page you can find all versions of the php package commercetools/symfony-bundle. 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 symfony-bundle

commercetools Symfony bundle Beta

The commercetools Symfony Bundle is a collection of Symfony bundles that ease the use of the commercetools PHP-SDK when implementing a Symfony project.

Table of contents

Pre-requisites

Composer : To install the composer go to https://getcomposer.org/doc/00-intro.md

Installation

You can either create a new Symfony project or use an existing Symfony project (ver. 3.4 and above)

Create a new Symfony project using the following command:

Next, navigate to the project's directory and run the following command:

This automates most of the configuration using the recipes-contrib bundle from Symfony Flex.

Next, install the commercetools Symfony bundle. To do this, run the following from the command line

Alternatively, open the composer.json file, add "commercetools/symfony-bundle" to the require attribute, and run

Next, open the.env file or create a .env.local file on root directory and edit the following lines to add your credentials. You can retrieve your API client credentials from the Merchant Center under Commercetools Merchant Center > Settings > Developer Settings, when you create a new API Client. Note that for security reasons you cannot retrieve the CTP_CLIENT_SECRET for clients created in the past.

or for US region change URLs to

For more information about using .env and .env.local, see here and here

Verify configuration

To verify that your configuration works, after adding your client credentials on the .env file run the following on the command line:

If everything is set up correctly, this should return the details of your project. For example:

Usage

The commercetools Symfony bundle consists of 8 smaller bundles (The dependencies mentioned are only the additional ones, required for bundle-specific functionalities)

By default, CtpBundle & CustomerBundle are enabled for all environments. SetupBundle & StateBundle are only enabled for for development environments. To see which bundles are enabled and optionally enable or disable them, edit the config/bundles.php file.

Available services

The main idea is that in each Bundle there are some reusable services that you may inject directly in your app. As a generic pattern there are a couple of *Manager services, that provide related actions. So, for example in CartManager you will find helpers like getCart, createCartForUser and update. The update service returns a CartUpdateBuilder where you can dynamically build update actions. To autowire a service, for example CatalogManager, in a controller action, do the following:

Services list

Console Commands

SetupBundle and StateBundle come together with a few handy console commands. These commands automate tasks during development and allow a 2-way sync between an online project and a local configuration. To use a console command navigate to your project's directory and run

Available console commands

Using SDK Models in twig templates

If you are using Twig for your templating engine you can print the value of a nested attribute of any SDK Model just by referring the attribute's path and name. For example the following two are valid representations:

Quick-start

For a more detailed quick start guide you can continue here

Disclaimer for ExampleBundle (dev)

There is an ExampleBundle provided in the repository which tries to demonstrate a sample eshop implementation making use of the other Bundles provided. This ExampleBundle is currently under development. It may includes outdated code, is not properly tested and right now is not encouraged to be used in any production environment. For now, we don't guarantee any non breaking changes. We intend to fix the problems, improve it and create a more helpful generic example.

Testing

Clone the project and navigate on the project's directory. On the command line, run

Issues

Check current issues or open a new one

Contribute

Contribute

License

This bundle is under the MIT license. See the complete license in the bundle: MIT License


All versions of symfony-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
symfony/framework-bundle Version ^3.4 | ^4.0
symfony/form Version ^3.4 | ^4.0
symfony/templating Version ^3.4 | ^4.0
symfony/security-bundle Version ^3.4 | ^4.0
symfony/validator Version ^3.4 | ^4.0
symfony/serializer Version ^3.4 | ^4.0
symfony/cache Version ^3.4 | ^4.0
commercetools/php-sdk Version ^2.6
symfony/var-dumper Version ^3.4 | ^4.0
symfony/dotenv Version ^3.4 | ^4.0
symfony/stopwatch Version ^3.4 | ^4.0
symfony/workflow Version ^3.4 | ^4.0
twig/extensions Version ^1.5
symfony/console Version ^3.4 | ^4.0
symfony/twig-bundle Version ^3.4 | ^4.0
squizlabs/php_codesniffer Version ^3.4
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 commercetools/symfony-bundle contains the following files

Loading the files please wait ....