Skip to content

Latest commit

 

History

History
135 lines (98 loc) · 4.21 KB

File metadata and controls

135 lines (98 loc) · 4.21 KB

PHP Calendar Builder

Release PHP PHPStan PHPUnit PHPCS PHPMD Rector - Instant Upgrades and Automated Refactoring LICENSE

This project provides a Calendar Builder API.

Installation

git clone https://github.com/bjoern-hempel/php-calendar-builder.git && cd php-calendar-builder
docker compose exec php composer install

Create your first calendar on command line

bin/console calendar:new
→ Directory "data/calendar/2c93279fb467" was successfully created.
→ Got to this directory.
→ Add your own images.
→ Edit the "data/calendar/2c93279fb467/config.yml" config file to your needs.
→ Build your calendar with: bin/console calendar:build "data/calendar/2c93279fb467/config.yml"
→ The 13 calendar pages are then located here by default: "data/calendar/2c93279fb467/ready/*"
→ Enjoy

Create your first calendar on command line in detail

Create new directory structure

bin/console calendar:new [-f <quote|simple>]

Add your own images to the folder created above

There are already 13 sample images in the folder. Replace these with your own. Allowed are png and jpg images.

Edit the config.yml file

Things that can be changed

  • Design and design configurations
  • Birthdays
  • Holidays
  • Title and subtitle of the main page
  • Title of the monthly pages
  • Positions/coordinates of the images
  • Source and destination of the images
  • Year and month of the monthly pages
  • Output quality
  • etc.

Finally create calendar pages

bin/console calendar:build "data/calendar/2c93279fb467/config.yml"

or if want to execute the command within the running docker container:

docker compose exec -u www-data php bin/console calendar:build data/calendar/2c93279fb467/config.yml

Check the calendar

ls data/calendar/2c93279fb467/ready
2024-00.jpg  2024-01.jpg  2024-02.jpg  2024-03.jpg 
2024-04.jpg  2024-05.jpg  2024-06.jpg  2024-07.jpg 
2024-08.jpg  2024-09.jpg  2024-10.jpg  2024-11.jpg 
2024-12.jpg

Example images can be found here: Example Images

Calendar UI

You can use a calendar UI to display the built calendars or have access to the api.

docker compose up -d
docker compose exec php composer install

Open the project in your browser:

Hint: If you want to use real urls instead of using port numbers, try to use https://github.com/bjoern-hempel/local-traefik-proxy

Test command

  • PHPCS - PHP Coding Standards Fixer
  • PHPMND - PHP Magic Number Detector
  • PHPStan - PHP Static Analysis Tool
  • PHPUnit - The PHP Testing Framework
  • Rector - Instant Upgrades and Automated Refactoring

Execute them all:

composer test:hardcore