Skip to content
Viames Marino edited this page Mar 29, 2026 · 19 revisions

Pair framework documentation

Pair is a compact PHP framework for server-rendered applications. It combines a classic MVC flow, an ActiveRecord-oriented ORM, API tooling, and lightweight frontend utilities without forcing a heavy build chain.

This wiki follows the current v3 codebase in /Users/viames/Sites/pair. The most useful way to read it is to distinguish between:

  • class reference pages, which explain the main methods with examples and keep secondary methods concise
  • workflow and integration pages, which focus on end-to-end patterns such as API modules, PWA features, or external service integrations

Start here

If you are new to Pair, begin with index.php, Application, Router, Controller, Model, and View.

For project bootstrap and environment setup, read Configuration file, htaccess, and Env.

Development and tests

Pair includes a lightweight PHPUnit suite for framework-level checks.

Typical local workflow:

  • composer install
  • composer test

Notes:

  • the suite focuses on isolated framework behavior, so many tests do not require a full Pair application bootstrap
  • vendor/ is a local install artifact and should not be committed to the Pair repository
  • when you change observable framework behavior, update the relevant wiki page together with the code

Recommended learning paths

1) Bootstrap and request lifecycle

Read index.php -> Application -> Router -> Controller -> View.

2) Build a classic CRUD module

Read Controller -> Model -> View -> ActiveRecord -> Query -> Form.

3) Build a JSON API

Read API -> ApiController -> Request -> ApiResponse -> CrudController -> Idempotency.

4) Authentication, session, and ACL

Read User -> Session -> Acl -> Rule -> OAuth2Token.

5) External services and integrations

Start from Integrations, then move to the specific service area you actually need:

Navigation tree

Topic hubs

API hardening and consistency: Middleware, ThrottleMiddleware, RateLimiter, Idempotency, QueryFilter, Resource.

Push, notifications, and passkeys: PushDispatcher, SubscriptionRepository, PushSubscription, WebPushSender, OneSignalNotification, PasskeyAuth, PasskeyController.

UI and visual helpers: SweetAlert, IziToast, ChartJs, ChartJsDataset, Markdown, AppTrait.

Plugins, templates, and maintenance: Plugin, PluginBase, Module, Template, Migration, InsightHub, OAuth2Client.

Service integrations: Integrations, AmazonS3, GoogleMaps, GoogleMapsClient, GoogleGeocoder, GooglePlacesService, GoogleAddress, Mailer, SendMail, SmtpMailer, StripeGateway, TelegramBotClient, WhatsAppCloudClient, AircallClient, AircallAPI.

Reading tips

  • When a page is about a class, prefer it for method-by-method reference.
  • When a page is about a feature area or hub such as API or Integrations, expect overview material, architecture notes, recipes, and cross-links rather than a full method inventory.
  • When you need the exact runtime behavior, trust the class pages aligned with the current codebase under /Users/viames/Sites/pair.

Clone this wiki locally