# AGENTS.md

## What matters here
- CodeIgniter app code lives in `app/`; framework code is in `system/`; the web entrypoint is `public/index.php`.
- Do not edit `vendor/`, `public/vendor/`, or `system/ThirdParty/` unless the task explicitly targets vendored code.
- `app/Config/Routes.php` is not just routing: it also sends CORS headers and honors a `Method-Override` request header before routes are registered.
- `public/index.php` exits early for `OPTIONS` requests; keep that behavior when touching front-controller setup.

## Commands
- Install PHP deps with `composer install`.
- Run PHPUnit from the project root with `vendor/bin/phpunit` or `./phpunit` if the wrapper exists locally.
- The PHPUnit config is `phpunit.xml.dist`; copy it to `phpunit.xml` for local overrides.
- Tests are split into `tests/system` and `tests/system/Database`; the database suite uses a live DB.
- Run a focused test with `vendor/bin/phpunit tests/system/HTTP/RequestTest` or a directory like `tests/system/HTTP/`.
- Exclude live DB tests with `--exclude-group DatabaseLive` when you do not need them.

## Environment
- PHP 7.2+ is required, with `ext-intl`, `ext-curl`, `ext-json`, and `ext-mbstring` enabled.
- The app expects `app.baseURL`, `CONFIGPATH`, and `PUBLICPATH` to be set by the test/bootstrap path in `system/Test/bootstrap.php`.

## Routing notes
- Keep the existing route filters in `app/Config/Routes.php` (`sessionAdmin`, module/branch requirements) unless the change explicitly adjusts access control.
- `Method-Override` is used for API requests; check clients before changing request handling.
