Download the PHP package sparkapi/feed-faker without Composer
On this page you can find all versions of the php package sparkapi/feed-faker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sparkapi/feed-faker
More information about sparkapi/feed-faker
Files in sparkapi/feed-faker
Package feed-faker
Short Description A fake datasource using RESO standard fields
License
Informations about the package feed-faker
RESO Feed Faker
FeedFaker allows you to generate a ton of fake RESO-compliant feed data objects quickly and easily, in a way that will keep the IDs at least semi-referentially linked for imports into databases.
Docker Quick Start
List of Faker Endpoints in the Docker Image
- Properties: http://localhost:8080/property/{optional_count}
- Members: http://localhost:8080/member/{optional_count}
- Offices: http://localhost:8080/office/{optional_count}
- Open House: http://localhost:8080/openhouse/{optional_count}
- History: http://localhost:8080/history/{optional_count}
- Media: http://localhost:8080/media/jpeg/{optional_count}
Install via Composer
$ composer require sparkapi/feed-faker
(or)
Example Usage
First define your settings for keys and the number and type of objects to create.
If you are using the unsplash photo provider you will have to pass in a few additional settings. If you want to use a different image provider, pass in the class to that provider.
All other settings have defaults, so feel free to modify what you want and leave blank the rest.
You may provide a valid full path to a php settings file that returns an array, if you prefer. An example is in settings.php.dist
.
Now that you're all setup, instantiate it and fire away:
Yep, that's it. You're welcome.
Optional Logging
The Faker can also log information to any PSR-3 compatible logger. (Useful for Image provider errors, etc.)
You have two options to set one up: Give it your own logger, or provide a setup callable for MonoLog.
Setup Callable for Monolog
By default, Faker uses Monolog to handle any logging, which uses handlers to know where and what details to log.
If you provide no setup or logger, Faker will default to a NullHandler
and save no log information.
You may provide any callable as the second parameter for FakeFeed
. This callable accepts a monolog Logger
instance and doesn't need to return anything.
Your own logger
You may also skip monolog altogether and provide any instance of a PSR-3 compatible logger as the second argument.
Interoperability
Feed Faker is PSR compliant and Container Interoperability compliant. Any oversights, please let us know.
Testing
We try for at least 80% test coverage.
Note tht the UnsplashPhotoProviderTest
s are skipped. These require a valid credential. You may extend and run these tests with your own credentials. A better (environment-based) system is on the way.
Contributing
Contributions are welcome and will be fully credited. Please see CONTRIBUTING for details.
Open an issue to join in!
License
The MIT License (MIT). Please see License File for more information.
All versions of feed-faker with dependencies
fzaninotto/faker Version ^1.6
php-di/php-di Version ^5.4
crewlabs/unsplash Version ^2.3
psr/log Version ^1.0
monolog/monolog Version ^1.22