{"id":18616028,"url":"https://github.com/bjoern-hempel/php-calendar-api","last_synced_at":"2025-04-11T01:31:39.279Z","repository":{"id":41873722,"uuid":"439915670","full_name":"bjoern-hempel/php-calendar-api","owner":"bjoern-hempel","description":"An API for building ready-made calendars.","archived":false,"fork":false,"pushed_at":"2023-12-29T19:14:08.000Z","size":136106,"stargazers_count":4,"open_issues_count":20,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T07:12:29.263Z","etag":null,"topics":["api-platform","calendar","php","php8","phpstan","phpunit","symfony","symfony6"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bjoern-hempel.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-19T16:41:41.000Z","updated_at":"2023-06-24T22:01:29.000Z","dependencies_parsed_at":"2024-11-07T03:48:35.047Z","dependency_job_id":null,"html_url":"https://github.com/bjoern-hempel/php-calendar-api","commit_stats":null,"previous_names":[],"tags_count":65,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjoern-hempel%2Fphp-calendar-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjoern-hempel%2Fphp-calendar-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjoern-hempel%2Fphp-calendar-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjoern-hempel%2Fphp-calendar-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bjoern-hempel","download_url":"https://codeload.github.com/bjoern-hempel/php-calendar-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248325205,"owners_count":21084887,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-platform","calendar","php","php8","phpstan","phpunit","symfony","symfony6"],"created_at":"2024-11-07T03:33:50.102Z","updated_at":"2025-04-11T01:31:34.267Z","avatar_url":"https://github.com/bjoern-hempel.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHPCalendarApi\n\n[![CI workflow](https://github.com/bjoern-hempel/php-calendar-api/actions/workflows/ci-workflow.yml/badge.svg?branch=main)](https://github.com/bjoern-hempel/php-calendar-api/actions/workflows/ci-workflow.yml)\n[![Release](https://img.shields.io/github/v/release/bjoern-hempel/php-calendar-api)](https://github.com/bjoern-hempel/php-calendar-api/releases)\n[![PHP](https://img.shields.io/badge/PHP-^8.0-777bb3.svg?logo=php\u0026logoColor=white\u0026labelColor=555555\u0026style=flat)](https://www.php.net/supported-versions.php)\n[![PHPStan](https://img.shields.io/badge/PHPStan-Level%208-brightgreen.svg?style=flat)](https://phpstan.org/user-guide/rule-levels)\n[![PHPCS](https://img.shields.io/badge/PHPCS-PSR12-brightgreen.svg?style=flat)](https://www.php-fig.org/psr/psr-12/)\n[![LICENSE](https://img.shields.io/github/license/bjoern-hempel/php-calendar-api)](https://github.com/bjoern-hempel/php-calendar-api/blob/master/LICENSE.md)\n\n\u003e An API for building ready-made calendars. Includes a user area and token management. The framework is secured via tests and static code analyzers.\n\n# 0. Main Technologies\n\n## 0.1 Applications and Extensions\n\n* **Symfony 6.1.x**: https://symfony.com/releases/6.1\n    * **Released**: May 2022\n    * **Support until**: January 2023\n    * https://symfony.com/releases/6.1\n    * https://endoflife.date/symfony\n* **API Platform 3.0.x**: https://api-platform.com/docs\n    * **Released**: 15 September 2022\n    * https://github.com/api-platform/api-platform/releases\n    * https://endoflife.date/api-platform\n\n## 0.2 Scripting language and database management systems\n\n* **PHP 8.1.x**: https://www.php.net/releases/8.1/en.php\n    * **Released**: 23 November 2021\n    * **Active Support Until**: 25 November 2023\n    * **Security Support Until**: 25 November 2024\n    * https://www.php.net/supported-versions.php\n    * https://endoflife.date/php\n* **MariaDB 10.7.3**: https://mariadb.com/kb/en/mariadb-1073-release-notes/\n    * **Released**: 8 February 2022\n    * **Support until**: 14 February 2023\n    * https://endoflife.date/mariadb\n\n## 0.3 Helper\n\n* **Composer 2.4.x**: https://getcomposer.org/download\n* **Symfony Client**: https://symfony.com/download\n\n## 0.4 Testing and Analysis\n\n* **PHPUnit 9.5.x**: https://phpunit.de\n* **PHPStan: 1.9.x**: https://phpstan.org\n* **PHP Magic Number Detector (PHPMND): 3.0.x**: https://github.com/povils/phpmnd\n* **Rector PHP: 0.14.x**: https://github.com/rectorphp/rector\n\n## 0.5 Manuals\n\n* **Integration**: https://symfony.com/doc/current/the-fast-track/de/26-api.html\n\n## 0.6 Techniques\n\n* **JSONLD**: https://en.wikipedia.org/wiki/JSON-LD\n* **JSON**: https://en.wikipedia.org/wiki/JSON\n* **REST**: https://en.wikipedia.org/wiki/Representational_state_transfer\n\n# 1. Installation\n\n```bash\ngit clone git@github.com:bjoern-hempel/calendarBuilder.git \u0026\u0026 cd calendarBuilder\n```\n\n## 1.1 Local development\n\nThe development of the unit classes, the unit tests and the general framework can be done locally.\n\n### 1.1.1 Check PHP version\n\nAt least version 8.1 is required.\n\n```bash\nphp -v\n```\n\n```bash\nPHP 8.1.12 (cli) (built: Oct 28 2022 18:35:51) (NTS)\nCopyright (c) The PHP Group\nZend Engine v4.1.12, Copyright (c) Zend Technologies\n    with Zend OPcache v8.1.12, Copyright (c), by Zend Technologies\n    with Xdebug v3.1.5, Copyright (c) 2002-2022, by Derick Rethans\n```\n\n### 1.1.2 Composer install\n\n```bash\ncomposer install\n```\n\n### 1.1.3 Show version\n\n```bash\nbin/console version:show\n```\n\n```bash\n  Version:         0.33.0\n  License:         Copyright (c) 2022 Björn Hempel\n  Authors:         Björn Hempel \u003cbjoern@hempel.li\u003e\n  PHP Version:     8.1.12\n  Symfony Version: 6.1.7\n```\n\n### 1.1.4 Reinitialize the test database\n\nRequired for functional tests:\n\n```bash\nbin/console db:reinitialize --env=test\n```\n\nor\n\n```bash\ncomposer db:initialize:test\n```\n\nCheck db size:\n\n```bash\ndu -h var/cache/test/test.db\n```\n\n```text\n232K    var/cache/test/test.db\n```\n\n### 1.1.5 Run first test\n\n```bash\ncomposer test\n```\n\n## 1.2 Execution with docker\n\nIf there is no local PHP version 8.1, or you want to develop the API with real data and a database, the Docker LAMP\nthe integrated Docker LAMP stack can be used. This procedure is the recommended way.\n\n\u003e **Attention**: This procedure needs an external Traefik network. If this has not yet been done, it must be created beforehand:\n\u003e\n\u003e ```bash\n\u003e docker network create traefik-public\n\u003e ```\n\n### 1.2.1 Start LAMP stack\n\n```bash\ndocker compose pull \u0026\u0026 docker compose up -d\n```\n\n### 1.2.2 Composer install\n\nUse the user `user` to keep the permissions:\n\n```bash\ndocker compose exec -u user php composer install\n```\n\n### 1.2.3 Show version\n\n#### Command Line\n\n```bash\ndocker compose exec -u user php bin/console version:show\n```\n\n```bash\n  Version:         0.33.0\n  License:         Copyright (c) 2022 Björn Hempel\n  Authors:         Björn Hempel \u003cbjoern@hempel.li\u003e\n  PHP Version:     8.1.12\n  Symfony Version: 6.1.7\n```\n\n### 1.2.4 Reinitialize the test and development database\n\nRequired for functional tests (test database):\n\n```bash\ndocker compose exec -u user php bin/console db:reinitialize --env=test\n```\n\nCheck db size:\n\n```bash\ndocker compose exec -u user php du -h var/cache/test/test.db\n```\n\n```text\n232K    var/cache/test/test.db\n```\n\n### 1.2.5 Run first test\n\n```bash\ndocker compose exec -u user php composer test\n```\n\n## 1.3 Install dependencies\n\n```bash\ndocker compose exec php /etc/init.d/supervisor start\n```\n\n```bash\ndocker compose exec php composer install\n```\n\n```bash\ndocker compose exec php yarn install\n```\n\n```bash\ndocker compose exec php yarn encore production\n```\n\n```bash\ndocker compose exec php composer migrate-prod\n```\n\n# 2. Requirements\n\n* PHP 8.1\n\n## 2.1 PHP Modules\n\n```bash\nphp -m\n```\n\n```bash\n[PHP Modules]\nbcmath\ncalendar\nCore\nctype\ncurl\ndate\ndom\nexif\nFFI\nfileinfo\nfilter\nftp\ngettext\nhash\niconv\nimagick\nintl\njson\nlibxml\nmbstring\nmysqli\nmysqlnd\nopenssl\npcntl\npcre\nPDO\npdo_mysql\npdo_sqlite\nPhar\nposix\nreadline\nReflection\nsession\nshmop\nSimpleXML\nsockets\nsodium\nSPL\nsqlite3\nstandard\nsysvmsg\nsysvsem\nsysvshm\ntokenizer\nxdebug\nxml\nxmlreader\nxmlwriter\nxsl\nZend OPcache\nzlib\n\n[Zend Modules]\nXdebug\nZend OPcache\n```\n\n# 3. API Documentation\n\n* [API - v1](docs/api/README.md)\n\n# 4. Run tests\n\nTest DB preparations if needed:\n\n```bash\nbin/console db:reinitialize --env=test\n```\n\nCheck sqlite db:\n\n```bash\nls -la var/app.db\n```\n\n## 4.1 General tests\n\nRuns all available tests (phpmnd, phpunit, phpstan, phpcs, rector):\n\n```bash\ncomposer test\n```\n\nor\n\n```bash\ncomposer test:all\n```\n\nRuns basic tests (phpunit, phpstan):\n\n```bash\ncomposer test:basic\n```\n\nRuns most tests (phpmnd, phpunit, phpstan, phpcs):\n\n```bash\ncomposer test:most\n```\n\n## 4.2 PHP Coding Standards Fixer\n\n* **Web**: https://cs.symfony.com/\n* **Github**: https://github.com/FriendsOfPHP/PHP-CS-Fixer\n* **Wikipedia**: https://en.wikipedia.org/wiki/PHP_Standard_Recommendation\n\nWe use the PSR-12 standard rule in this project.\n\n### 4.2.1 Dry-Run\n\nRuns PHP Coding Standards Fixer for all folders (dry-run) and check for inconsistencies. No sources are changed in\nthe process:\n\n```bash\ncomposer phpcs:check:all\n```\n\nRuns PHP Coding Standards Fixer for the src folder (dry-run) and check for inconsistencies. No sources are changed in\nthe process:\n\n```bash\ncomposer phpcs:check:src\n```\n\nRuns PHP Coding Standards Fixer for the tests folder (dry-run) and check for inconsistencies. No sources are changed in\nthe process:\n\n```bash\ncomposer phpcs:check:tests\n```\n\n### 4.2.2 Fix source code\n\nRuns PHP Coding Standards Fixer for all folders (fix). The source code is tried to be adapted according to the\ndefined rules:\n\n```bash\ncomposer phpcs:fix:all\n```\n\nRuns PHP Coding Standards Fixer for the src folder (fix). The source code is tried to be adapted according to the\ndefined rules:\n\n```bash\ncomposer phpcs:fix:src\n```\n\nRuns PHP Coding Standards Fixer for the tests folder (fix). The source code is tried to be adapted according to the\ndefined rules:\n\n```bash\ncomposer phpcs:fix:tests\n```\n\n## 4.3 PHP Mess Detector\n\n* **Web**: https://phpmd.org/\n* **Github**: https://github.com/phpmd/phpmd\n* **Other**: https://phpqa.io/projects/phpmd.html\n\nTo get more information on this topic, run the following command:\n\n```bash\ncomposer | grep \"phpmd:\"\n```\n\n## 4.4 PHP Magic Number Detector\n\n* **Github**: https://github.com/povils/phpmnd\n* **Wikipedia**: https://en.wikipedia.org/wiki/Magic_number_(programming)\n\nRuns PHP Magic Number Detector and detects magic numbers for all folders:\n\n```bash\ncomposer phpmnd:all\n```\n\nRuns PHP Magic Number Detector and detects magic numbers for the src folder:\n\n```bash\ncomposer phpmnd:src\n```\n\nRuns PHP Magic Number Detector and detects magic numbers for the tests folder:\n\n```bash\ncomposer phpmnd:tests\n```\n\n## 4.5 PHPStan\n\n* **Web**: https://phpstan.org/\n* **Github**: https://github.com/phpstan/phpstan\n* **Wikipedia**: https://en.wikipedia.org/wiki/Static_program_analysis\n\n```bash\ncomposer phpstan:run\n```\n\nor\n\n```bash\ncomposer phpstan\n```\n\n## 4.6 PHPUnit\n\n* **Web**: https://phpunit.de/\n* **Github**: https://github.com/sebastianbergmann/phpunit\n\nRuns all available PHPUnit tests (api, functional, unit):\n\n```bash\ncomposer phpunit\n```\n\nor\n\n```bash\ncomposer phpunit:all\n```\n\nRuns only unit PHPUnit tests:\n\n```bash\ncomposer phpunit:api\n```\n\nRuns only functional PHPUnit tests:\n\n```bash\ncomposer phpunit:functional\n```\n\nRuns only unit PHPUnit tests:\n\n```bash\ncomposer phpunit:unit\n```\n\n## 4.7 PHP Rector\n\n* **Web**: https://getrector.org/\n* **Github**: https://github.com/rectorphp/rector\n\nRuns PHP Rector and does a dry-run:\n\n```bash\ncomposer rector:check\n```\n\nRuns PHP Rector and fix source code:\n\n```bash\ncomposer rector:fix\n```\n\n# 5. Docker Compose\n\n## 5.1 Basic Commands\n\n### 5.1.1 Start LAMP stack\n\n```bash\ndocker compose up -d\n```\n\n### 5.1.2 Stop LAMP stack\n\n```bash\ndocker compose down\n```\n\n### 5.1.3 Rebuild images\n\n```bash\ndocker compose build\n```\n\n### 5.1.4 Load dumps into database\n\nAll SQL dumps from the `fixtures/db` folder will be imported:\n\n```bash\nfor dump in fixtures/db/*.sql; do mysql -h127.0.0.1 -P3306 -uphp-calendar-api -pphp-calendar-api --default-character-set=utf8 opa \u003c \"$dump\"; done\n```\n\nor\n\n```bash\ncomposer db:initialize:main\n```\n\n### 5.1.5 Create dumps from database\n\nThe current database is exported to the `fixtures/db` folder:\n\n```bash\nbin/dbHelper dump\n```\n\n## 5.2 Show versions\n\n### 5.2.1 Composer\n\n```bash\ndocker compose exec -u user php php -v\n```\n\n```text\nPHP 8.1.12 (cli) (built: Oct 28 2022 18:32:13) (NTS)\nCopyright (c) The PHP Group\nZend Engine v4.1.12, Copyright (c) Zend Technologies\n    with Zend OPcache v8.1.12, Copyright (c), by Zend Technologies\n```\n\n### 5.2.2 Composer\n\n```bash\ndocker compose exec -u user php composer -V\n```\n\n```text\nComposer version 2.4.4 2022-10-27 14:39:29\n```\n\n### 5.2.3 Symfony CLI\n\n```bash\ndocker compose exec -u user php symfony -V\n```\n\n```text\nSymfony CLI version 5.4.13 (c) 2017-2022 Symfony SAS #StandWithUkraine Support Ukraine (2022-08-16T08:17:04Z - stable)\n```\n\n### 5.2.4 Symfony Framework\n\n```bash\ndocker compose exec -u user php bin/console --version\n```\n\n```text\nSymfony 6.1.7 (env: dev, debug: true) #StandWithUkraine https://sf.to/ukraine\n```\n\n### 5.2.5 Application Version\n\n```bash\ndocker compose exec -u user php bin/console version:show\n```\n\n```text\n  Version:         0.33.0\n  License:         Copyright (c) 2022 Björn Hempel\n  Authors:         Björn Hempel \u003cbjoern@hempel.li\u003e\n  PHP Version:     8.1.12\n  Symfony Version: 6.1.7\n```\n\n```bash\ndocker compose exec -u user php bin/console version:show --format json\n```\n\n```json\n{\n  \"version\": \"0.33.0\",\n  \"license\": \"Copyright (c) 2022 Björn Hempel\",\n  \"authors\": [\n    \"Björn Hempel \u003cbjoern@hempel.li\u003e\"\n  ],\n  \"php-version\": \"8.1.12\",\n  \"symfony-version\": \"6.1.7\"\n}\n```\n\n### 5.2.6 Node.js and npm\n\n```bash\ndocker compose exec -u user php node -v\n```\n\n```text\nv16.18.1\n```\n\n```bash\ndocker compose exec -u user php npm -v\n```\n\n```text\n9.1.1\n```\n\n### 5.2.7 Yarn\n\n```bash\ndocker compose exec -u user php yarn -v\n```\n\n```text\n1.22.19\n```\n\n## 5.3 Docker container commands\n\n### 5.3.1 List directories\n\n```bash\ndocker compose exec -u user php ls -la\n```\n\n### 5.3.2 Show current user\n\n```bash\ndocker compose exec -u user php id\n```\n\n```text\nuid=1000(user) gid=1000(user) groups=1000(user)\n```\n\n## 5.4 Docker container login\n\n### 5.4.1 PHP Container\n\n```bash\ndocker compose exec -u user php bash\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbjoern-hempel%2Fphp-calendar-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbjoern-hempel%2Fphp-calendar-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbjoern-hempel%2Fphp-calendar-api/lists"}