An open API service indexing awesome lists of open source software.

https://github.com/davesweb/bricklink-api

A PHP SDK for the Bricklink API
https://github.com/davesweb/bricklink-api

api bricklink php

Last synced: 6 months ago
JSON representation

A PHP SDK for the Bricklink API

Awesome Lists containing this project

README

          

# Bricklink API

A PHP SDK for the Bricklink API. This package provides an easy way to authenticate with the Bricklink API, so you can run
requests directly against the Bricklink API. This package also provides some repositories for easier and object-oriented
communication with the Bricklink API.

## Installation

`composer require davesweb/bricklink-api`

## Usage

The following examples are just the basic usage of how to set up this package. Please read the
[complete documentation](https://davesweb.github.io/bricklink-api/) for more detailed and advanced examples of how to
use this package and how to extend this package.

### Authentication

First, create a config object with your secrets and tokens you got from Bricklink.

```php
find(1);

var_dump($color);
```

## Documentation

Please read the [documentation](https://davesweb.github.io/bricklink-api/) for more detailed and advanced examples
of how to use this package.

## Docker

This package contains a Docker setup te easily run the tests and CS fixer.

To build the docker image, copy the docker compose file:

`cp docker-compose.yml.dist docker-compose.yml`

Then run:

`docker-compose build`

To start the container, run:

`docker-compose up -d`

Logging in to the docker container:

`docker-compose exec app bash`

## Tests

To run the test suite, run `composer test` from inside the docker container, or `docker-compose exec app composer test`
from outside the docker container. Tests are created using PHPUnit, so you may use PHPUnit and it's options directly to
run the tests.

## Code style

This project uses [CS Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer) to enforce a unified code style. The
configuration for this can be found in the `.php-cs-fixer.php` file.

To run CS fixer on the entire project, run `composer cs-fixer` from inside the container, or
`docker-compose exec app composer cs-fixer` from outside the docker container. You can also run CS fixer directly
(`php vendor/bin/php-cs-fixer fix`) and add your custom arguments. Keep in mind that the contributing guide
requires you to run CS Fixer with the configuration in this package.

## License

This package is licensed under the MIT license, which basically means you can do whatever your want with this package. However, if you found this package useful, please consider buying me a beer or subscribing to premium email support over on [Patreon](https://www.patreon.com/davesweb), it's really appreciated!