theimagingsource / tisd
PHP wrapper for The Imaging Source Download System Web API. Authored and supported by The Imaging Source Europe GmbH.
Requires
- php: ^8.1
Requires (Dev)
- phpstan/extension-installer: ^1.2
- phpstan/phpstan: ^1.10
- phpstan/phpstan-phpunit: ^1.3
- phpstan/phpstan-strict-rules: ^1.5
- phpunit/phpunit: ^10.0
- squizlabs/php_codesniffer: ^3.7
- symfony/var-dumper: ^6.2
README
PHP Wrapper for The Imaging Source Download System Web API
The Imaging Source produces a large number of downloadable files (drivers, end-user software, documentation, images etc.). These resources are published at dl.theimagingsource.com and are available via a JSON-based API. In addition to encapsulating the functionality of the JSON-based API, this component library provides several helper objects to make access to The Imaging Source downloads as simple and quick as possible.
Installation
Use Composer to install the SDK:
composer require theimagingsource/tisd-sdk ^5.0
Sample Endpoints
Return all supported locales
Return all supported contexts
Return meta information and statistics
Return all data (consolidated)
Return all packages in "Downloads"
Return all packages in "Downloads" -> "Drivers"
Return package matching product code ID
Return package matching package ID
Return package matching UUID
Programming Samples
The SDK ships with comprehensive samples illustrating all functionality. Please take a look in the /bin
directory.
Unit Tests
The SDK ships with complete unit tests. Simply run composer test
in the root directory.
JSON Structure
root
categories
sections
packages
package
Loop through the JSON structure in PHP
<?php use Tisd\Sdk\Sdk; $sdk = new Sdk(); $packages = $sdk->getPackages(); foreach ($packages['children'] as $categoryId => $categories) { foreach ($categories['children'] as $sectionId => $sections) { foreach ($sections['children'] as $packageId => $package) { // $latestPackageVersion = array_shift($package['versions']); } } } foreach ($packages['children'] as $categoryId => $categories) { foreach ($categories['children'] as $sectionId => $sections) { foreach ($sections['children'] as $packageId => $package) { // $latestPackageVersion = array_shift($package['versions']); } if (0 === count($packages['children'][$categoryId]['children'][$sectionId]['children'])) { unset($packages['children'][$categoryId]['children'][$sectionId]); } } if (0 === count($packages['children'][$categoryId]['children'])) { unset($packages['children'][$categoryId]); } } ?>