Download the PHP package swatty007/faker-image-generator without Composer

On this page you can find all versions of the php package swatty007/faker-image-generator. 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 faker-image-generator

faker-image-generator

Latest Version on Packagist License: MIT Build Status Code Style Quality Score Total Downloads

Generator of placeholder-type images using GD for fzaninotto/Faker to quickly generate fake images within your application or tests, without the need to rely on external services.

This is a fork from bruceheller/images-generator as that package seems to not be actively maintained anymore.

Installation

You can install the package via composer:

Configuration

After installing the package you can publish the configuration file via:

It contains some optional configuration parameters and is fully documented.

The configuration allows you to define some global image properties which will be shared across all Generator Instances. This is an addition to the original package to make is easier to share a similar style throughout your application.

Usage

Use the FakerImageGenerationProvider class in combination with Faker to produce new images:

It will generate a black png picture of 640*480 pixels inside your temp directory (if available) and return the full path of the picture like this: '/tmp/13b73edae8443990be1aa8f1a483bc27.png'.

Parameters

The imageGenerator() method allows you to define rendering options on a per element basis, those options are identical to your configuration properties and will allow you quickly generate unique images.

Examples:

Will generate a 640x480 black png picture with the text '640x480' in white.

Will generate a 640x480 blue png picture with the text 'Faker' in yellow inside an img directory of your project and return the full path such as 'img/f523f8bec6ed65fb1d63ae8d09850f9c.png' like this:

More complex example using the power of Faker:

Will return a jpeg of a random color picture with a width between 600 and 800 pixels, height between 400 and 600 pixels, with a random word written in a random color!

Testing

Changelog

Please see CHANGELOG for more information what has changed recently.

TODO

As this is mainly a fork of the existing package, to get it running within modern applications, its future development plans could apply to this package as well. However, its current functionality fulfills my needs. Nonetheless, some TODOs remain & are open for pull requests :monocle_face:

Otherwise, any suggestion is welcome! You can fork this project and submit your PR :)

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

The Roboto font file included in this project is under Apache Licence 2.0 as mentioned on the Roboto repository.


All versions of faker-image-generator with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
fakerphp/faker Version ~1.13
ext-gd 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 swatty007/faker-image-generator contains the following files

Loading the files please wait ....