Download the PHP package ginsen/img-finder without Composer

On this page you can find all versions of the php package ginsen/img-finder. 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 img-finder

img-finder

Latest Stable Version Latest Unstable Version License

PHP Library to find images in several public repositories

Install

Config file

With YAML format

Create a configuration file in yaml format, img-finder.yml, with the following content:

With PHP format

Create config file with PHP is very similar at YAML, create php file format, as below.

And replace your credentials for use your contract services and delete the repositories that do not have credentials for their use.

If you do not have credentials to use GoogleTranslate remove this translator service, the dictionary does not need credentials, you can configure it to translate the search terms you want to English, such as a tag cloud. Note that the dictionary is not useful for free text searches.

Use

With YAML format

Create a config instance with the created yml file, and inject it into the main ImgFinder class.

With PHP format

With the PHP config file it is done as follows.

Ready

ImgFinder is now available to query image repositories, just it only necessary to create a request.

Request in Pexels & Unsplash repositories

Both requests are the same, "nature" is the search term, 1 is the default page, 10 is the number of response images for each repository, "landscape" is the orientation ('landscape' or 'portrait'), width is equal to 1200px and finally 320 is the width for thumbnails.

Request to search only in one repository

Search

Finally, you only need to perform the search.

This is the whole code of the entire operation.

Show all public repositories

To show all available repositories.

Cache optional

If you wish, you can cache requests to improve performance and not stress the image repositories.

For example, if you use the symfony/cache component you can inject it into the initial configuration.

Example:

Create Redis cache service.


All versions of img-finder with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
ext-json Version *
cocur/slugify Version ^4.0
nyholm/psr7 Version ^1.5
psr/cache Version ^1.0
psr/http-client Version ^1.0
symfony/http-client Version 5.4.*
symfony/translation Version 5.4.*
symfony/yaml Version 5.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 ginsen/img-finder contains the following files

Collapse All

doc

   examples

    config.yml
    yaml_dictionary.yml

src

   ImgFinder

     Cache
     Exception
     Repository
     Service
     Translator
    Config.php
    ImgFinder.php
    Payload.php
    Request.php
    RequestInterface.php
    Response.php
    ResponseInterface.php

tests

   Cache

    CacheImgRepositoryTest.php
    CacheTranslatorTest.php

   Repository

    SpyRepository.php

   Service

    RepositoryServiceTest.php
    TranslatorServiceTest.php

   Translator

    SpyTranslator.php
  ConfigTest.php
  ImgFinderTest.php
  PayloadTest.php
  RequestTest.php
  ResponseTest.php
.gitignore
.php-cs-fixer.dist.php
LICENSE
README.md
composer.json
phpunit.xml
sonar-project.properties.dist