Download the PHP package batteryincluded/batteryincluded-php-sdk without Composer

On this page you can find all versions of the php package batteryincluded/batteryincluded-php-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 batteryincluded-php-sdk

AltDiscord

Latest Stable Version Packagist

batteryincluded-php-sdk

The SDK is licensed under the MIT License. Feel free to contribute!

Using the SDK

The API documentation provides all information about the available endpoints.

Install & Integrate the SDK into your Project

The SDK requires a PHP version of 8.2 or higher. The recommended way to install the SDK is through Composer.

Usage

You can find for every implemented api action an example file in the examples directory.

Extending ProductBaseDto with Custom Fields

ProductBaseDto covers the standard product fields (name, description, ordernumber, price, instock, rating, etc.). To sync additional, shop-specific fields (e.g. keywords, material, color), extend the class and override jsonSerialize().

1. Create a subclass

The custom fields must be nested under the _PRODUCT key (i.e. '_' . $this->getType()). array_merge_recursive merges them into the parent payload without overwriting the base fields. array_filter strips null values so only populated fields are sent.

2. Populate and sync

Pass multiple products as separate arguments to syncFullElements() to sync them in a single request. A full working example is available in examples/extension/product.php.

Mixed Index: Products and Blog Posts in a Single Collection

A single collection can hold multiple document types. Each document carries a type field and a type-scoped data key (e.g. _PRODUCT, _BLOG), so the index stores heterogeneous content while still allowing type-specific searches.

1. Sync products and blogs together

Each document is stored with a prefixed ID (PRODUCT-1, BLOG-1) and a type field, so documents from different types never collide even when their identifiers overlap.

2. Search all types at once

3. Filter to a specific type

Pass type as a filter key to restrict results to only products or only blog posts:

4. Access type-specific fields in the result

Each hit contains the type-scoped key, so check type first to access the right payload:

A full working example is available in examples/sync/sync_full_product_and_blogs.php.

Community

Join our community on Discord to ask questions, give feedback, or connect with other developers.


All versions of batteryincluded-php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-curl Version *
ext-mbstring Version *
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 batteryincluded/batteryincluded-php-sdk contains the following files

Loading the files please wait ...