Skip to content

Latest commit

 

History

History
69 lines (51 loc) · 2.16 KB

File metadata and controls

69 lines (51 loc) · 2.16 KB

Phalcon Tutorial

This is a small sample application for the Phalcon PHP Framework: a simple registration form built as an MVC app. It is the companion code for the Basic Tutorial documentation page and runs on both Phalcon 5 (the C extension) and Phalcon 6 (the phalcon/phalcon Composer package).

Requirements

  • PHP >= 8.1
  • Phalcon 5 (C extension) or Phalcon 6 (Composer package)
  • MySQL 8.0
  • Docker (recommended for local development)

Quick start (Docker)

cp resources/.env.example .env
docker compose up -d --build

Then open http://localhost:8080. The database schema and a seed user are loaded automatically on first boot.

To run on Phalcon 6 instead of 5, set PHALCON_VARIANT=v6 in .env (or export it) and rebuild:

PHALCON_VARIANT=v6 docker compose up -d --build

To open a shell in the app container:

docker compose exec app bash

Composer scripts

Script What it does
composer cs Check coding standard (PSR-12) with PHPCS
composer cs-fix Auto-fix coding standard with PHPCBF
composer cs-fixer Check style with PHP-CS-Fixer (dry-run)
composer cs-fixer-fix Apply PHP-CS-Fixer changes
composer analyze Static analysis with PHPStan (level 6)
composer test Run the functional smoke test (Talon)

Project layout

This project follows the PDS skeleton:

docs/        documentation
public/      web root (index.php, css)
resources/   tooling configs, docker, schema, .env.example
src/         application source (PSR-4 Tutorial\)
tests/       Talon functional test

License

The Phalcon Tutorial is open-sourced software licensed under the MIT license. © Phalcon Framework Team and contributors.