定制 gettyimages/gettyimages-api 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

gettyimages/gettyimages-api

最新稳定版本:6.0.0

Composer 安装命令:

composer require gettyimages/gettyimages-api

包简介

Getty Images API SDK - PHP

README 文档

README

Build Status

Introduction

This SDK makes using the Getty Images API easy. It handles credential management, makes HTTP requests and is written with a fluent style in mind. For more info about the API, see the Documentation.

  • Search for images and videos from our extensive creative and editorial catalogs.
  • Get image and video metadata.
  • Download files using your Getty Images products (e.g., Editorial subscriptions, Easy Access, Thinkstock Subscriptions, and Image Packs).
  • Custom Request functionality that allows user to call any endpoint.

Help & Support

Getting started

Obtain an API Key

If you don't already have an API key, fill out and submit the contact form to be connected to our Sales team.

Installing the package

The SDK is available on Packagist.

Examples

See example.md for examples.

Building From Source Code

Source code is only needed if you would like to contribute to the project. Otherwise, use the package

Initial Setup

Assumptions

  • You have PHP >=7.2 setup

PHP.ini settings to build the code

[Phar] ; http://php.net/phar.readonly phar.readonly = Off //Extensions needed for Windows OSs extension=php_curl.dll extension=php_mbstring.dll extension=php_exif.dll extension=php_sockets.dll extension=php_openssl.dll 

Install via Composer

Please refer to README_ComposerInstall.md

Quick Build

If everything is setup on your machine where PHP will run, you can most likely run BuildSDK.bat or Build.sh to automatically build the phar. If something fails please read the error messages, PHP can have a finicky setup if you've never tried to use it to build a package before.

Windows

build.bat 

Linux / OSX

Prerequisites

On Ubuntu, you may need to install a few additional packages

sudo apt update sudo apt install php-xml php-mbstring

Building

./build.sh

This will put GettyImagesApi.phar in a build folder. Then you can use the package as you would any other phar.

The build does a few things for you automatically

  1. Determines if you have composer.phar and will retrieve it if you don't have it
  2. Runs composer install to get dependencies that are outlined in the composer.json file
  3. Then produces the phar file in ./build/GettyImagesApi.phar

Manually Installing PHP libraries

BuildSDK should get all the dependencies for you but if you want to do the update without a build From the root of the repository

php composer.phar install 

If you want the test dependencies

php composer.phar install --require-dev 

This command should install PHPUnit and any other php dependency libraries

Environment variables of interest

The sdk does support using a proxy directly as well as ignoring ssl validation errors. This can be configured through the existense environment variables

GettyImagesApi_IgnoreSSLValidation GettyImagesApi_UseProxy 

*nix Shell Example:

export GettyImagesApi_IgnoreSSLValidation=TRUE export GettyImagesApi_UseProxy=127.0.0.0:8888 

Windows CMD Example:

set GettyImagesApi_IgnoreSSLValidation=TRUE set GettyImagesApi_UseProxy=127.0.0.0:8888 

Powershell Example

$env:GettyImagesApi_IgnoreSSLValidation=TRUE $env:GettyImagesApi_UseProxy="127.0.0.0:8888" 

Tests

Running unit tests

The test project contains unit tests written using the PHPUnit Framwork.

Execute the unit tests

Assumptions

  • You have PHPUnit installed

To execute all of the unit tests: ./vendor/bin/phpunit --bootstrap vendor/autoload.php unitTests/.

To execute one test class: ./vendor/bin/phpunit --bootstrap vendor/autoload.php unitTests/EXAMPLETEST

Maintainers

To publish a new version to Packagist, create a new release with an updated tag. A webhook will notify Packagist to grab the latest version.

统计信息

  • 总下载量: 153.43k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 16
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 14
  • Watchers: 8
  • Forks: 14
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固