Skip to content
master
Switch branches/tags
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
bin
 
 
 
 
 
 
 
 
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Placeholder service

There is a self hosted service for images placeholders generation. Service works similar way as https://placeholder.com/, but self hosted.

SSH Deploy Tests Code Coverage

Full code coverage report: http://files.antonshell.me/github-actions/placeholder-service/master/coverage/coverage/

Psalm html report: http://files.antonshell.me/github-actions/placeholder-service/master/psalm/psalm-report.html

Install locally

1 . Clone repository

git clone https://github.com/antonshell/placeholder-service.git

2 . Install dependencies

cd placeholder-service
composer install

3 . Run web server

php -S 127.0.0.1:8000 public/index.php

5 . Open in browser

http://127.0.0.1:8000/ - Healthcheck

http://127.0.0.1:8000/img - Default image

Install in docker

1 . Clone repository

git clone https://github.com/antonshell/placeholder-service.git

2 . Run containers

docker-compose up

3 . Install dependencies

docker-compose exec php-fpm composer install

4 . Open in browser

http://127.0.0.1:8000/ - Healthcheck

http://127.0.0.1:16880/img - Default image

Usage

1 . Healthcheck

http://127.0.0.1:8000/

2 . Get default image (300x300)

http://127.0.0.1:8000/img

300x300

3 . Set image size

500x500

400x400

320x240

4 . Set custom text

http://127.0.0.1:8000/img?text=Hello

custom text

5 . Set text size (default: 28)

http://127.0.0.1:8000/img?width=800&text_size=40

text size

6 . Set text color

http://127.0.0.1:8000/img?color_text=000

text color

7 . Set background color

http://127.0.0.1:8000/img?color_bg=000

text color

Demo

https://placeholder.antonshell.me/img?width=500

Tests

1 . Run tests

Local environment:

composer test

Docker environment:

docker-compose exec php-fpm composer test

2 . Update code coverage badges

Local environment:

composer update-badges

Docker environment:

docker-compose exec php-fpm composer update-badges

Codestyle

1 . Fix codestyle

composer cs-fixer src
docker-compose exec php-fpm composer cs-fixer src

2 . Code quality with Psalm

composer psalm
composer psalm-report-html

docker-compose exec php-fpm composer psalm
docker-compose exec php-fpm composer psalm-report-html

Open in browser: psalm-report.html

Macos docker environment(Mutagen)

1 . Install mutagen

brew install mutagen-io/mutagen/mutagen
mutagen daemon start

2 . Run containers

docker-compose down --remove-orphans || true
mutagen project start || mutagen project terminate

3 . Troubleshooting:

Fix permissions:

docker-compose exec php-fpm chmod -R 777 /var/www

Disable permission tracking:

git config core.fileMode false

Setup xdebug (Docker)

https://blog.denisbondar.com/post/phpstorm_docker_xdebug

About

Self hosted image placeholder service, similar to https://placeholder.com/

Resources

License

Releases

No releases published

Packages

No packages published