# Project plan — sarugby.online

Evidence date: 2026-09-28.

Source repository: `git@bitbucket.org:overdrive/sarugby.online.git`.

Inspected revision: `master` at `8a0437d` (2020-01-07, ".gitignore edited online with Bitbucket", Heinrich du Plessis). The only earlier commit is `9815ef5` (2019-12-18, "initial commit of full repository"). There are no other branches.

This plan describes what the repository contains. It does not decide what the product should become.

Silicon Ark had no `sarugby.online/` directory before this document set. The source repository has no README, PRD, or project plan.

## Product

The public page title is **SA Rugby - Official Home of the Springboks** (`application/layouts/default.phtml`). Email copy identifies the operators as **SA Rugby Event Administration**, **SA Rugby Accreditation**, the **BokSmart Team**, and, on the separate Footprint login, **SARU E-Filing** / **Footprint Team**.

The repository is one PHP application with several products sharing a database:

1. A public tournament site: competitions for a year, fixtures, results, teams, lineups, commentary, match reports, and news.
2. A company accreditation area: company registration, staff, and vehicle load-in / load-out permits. Contact mailbox `accreditation@sarugby.co.za`, phone `+27219287000` in the registration email.
3. A Blue Card concussion-consent form that emails BokSmart documents and stores a row in `BlueCard_Consents`.
4. Tournament food-session menus with nutrition and allergen detail.
5. HTTP actions named like cron jobs that export JSON, build PDFs, advance fixtures, and POST one accreditation type to an external AppWizard endpoint.

Provenance: **Implemented** in the controllers and models under `application/`. The product name and contact details are **Documented** in layout titles and email strings. There is no separate requirements document.

Whether this tree is what `https://www.sarugby.online` serves today is **Unknown / Requires Confirmation**. The last commit is January 2020. `public/index.php` contains a commented maintenance message and a commented maintenance image (`Background4_2018_maintenance.jpg` is still in `public/`).

## Scope in this repository

In scope of the committed tree:

- Zend Framework 1 front controller at `public/index.php`.
- Modules `default`, `bluecard`, `menu`, `companiesold`, and `companyonl`.
- Models for tournaments, fixtures, squads, profiles, news, companies, accreditation, permits, blue cards, food sessions, unions, and B-BBEE lookup tables.
- A vendored `library/Zend` (version 1.11.10) and a small `library/PG` plugin set.
- Static theme files under `public/` (Sportsline / WordPress asset paths, Limitless, Bootstrap 2, dompdf).
- A second application tree at `website/` (application, library, public). It was not line-diffed against the root tree. File count under `application/` is 235; under `website/application/` it is 203. Which tree is deployed is **Unknown / Requires Confirmation**.
- `test/` is a Plesk "domain default page", not an application test suite.

Out of scope of the committed tree, or not present:

- Database schema migrations. Tables are assumed to already exist on MySQL database `teamwizz_SARU`.
- The contents of `public/archives/` and `website/public/archives/`. Both paths are in `.gitignore`.
- `sonar-project.properties` and `sonarqube_scan.bat`. The task-creation scan listed them at the repository root. They are not in `master`. Provenance: **Unknown** — they may have been untracked files on the scan host.
- A `pdf` module. Cron and permit code request `/pdf/a6/id/{id}` on this host and `https://www.footprintapp.net/pdf/...` and `https://footprintapp.net/pdf/matchreport/id/{id}` on another host. Those endpoints are not in this repository.

## System architecture

Browser requests hit the root `.htaccess`, which redirects to HTTPS and to the `www` host, then internally rewrites into `public/`. `public/index.php` boots `Zend_Application` with `application/configs/application.ini` and `application/Bootstrap.php`.

`PG_Controller_Plugin_LayoutPicker` sets the layout name to the current module name. Layout files on disk are `admin`, `bluecard`, `default`, `food`, `menu`, `repo`, and `Copy of companies.phtml`. There is no layout file named `companiesold` or `companyonl`.

The default module reads and writes JSON snapshots under `public/archives` (`UPDATE_PATH`) and reads tournament images stored as base64 in the database. Accreditation PDF generation uses dompdf and then, for category `AC == 14`, POSTs applicant data to `https://fsrugby.appwizard.co.za/scripts/AppWiz.dll`.

Persistence is MySQL through `pdo_mysql`. The ini file points at host `qadb.footprintapp.net`, database `teamwizz_SARU`. The host name contains `qa`. Whether production uses this host is **Unknown / Requires Confirmation**.

## Major components

| Component | Role | Evidence |
|---|---|---|
| `default` | Home, tournaments, news, Footprint login, JSON export, cron-style actions | `application/modules/default/controllers/` |
| `bluecard` | Concussion Blue Card form and email | `application/modules/bluecard/controllers/IndexController.php` |
| `menu` | Food-session dates, menus, nutrition, allergens | `application/modules/menu/controllers/SessionController.php` |
| `companiesold` | Company login, registration, users, permits | `application/modules/companiesold/controllers/` |
| `companyonl` | Second company-registration controller set | `application/modules/companyonl/controllers/` |
| `application/models` | Zend_Db_Table classes. A duplicate set lives in `application/configs/models` | both directories |
| `library/Zend` | Framework 1.11.10 | `library/Zend/Version.php` |
| `library/PG` | Layout picker, upload, PDF helpers, match-report helper | `library/PG/Controller/Plugin/` |
| `public/` | Front controller, theme assets, dompdf, JSON samples | `public/index.php` |
| `website/` | Second copy of the application tree | directory listing |

## Milestones visible in Git

| When | Commit | What changed |
|---|---|---|
| 2019-12-18 | `9815ef5` | Entire repository committed once. Author not re-read beyond the subject line. |
| 2020-01-07 | `8a0437d` | `.gitignore` edited online with Bitbucket. Heinrich du Plessis. Ignores `application/configs/application.ini` and the two `archives/` trees. The ini file is still in the tree, so it was tracked before the ignore rule. |

No milestone plan, roadmap, or issue tracker is in the repository. Anything after January 2020 is **Unknown**.

## Implementation plan

There is no implementation plan in the repository. The code is a snapshot, not a sequence of feature branches.

Observed unfinished or inconsistent work, recorded so it is not mistaken for a plan:

- Controllers and views named `Copy of …`, `*test*`, and `IndexController.php.112619`.
- `companiesold` controller classes use the prefix `Companies_` (and one `Company_`). Zend's dispatcher would look for `Companiesold_`. Redirects and emails use the URL prefix `/companies/`, and there is no `companies` module directory.
- `companyonl` classes use the prefix `Company_` or, for the error controller, `Bluecard_`. The directory name is `companyonl`.
- `companiesold/Bootstrap.php` and `companyonl/Bootstrap.php` both declare `class Default_Bootstrap`, so they are not the module bootstrap class Zend would load.
- `CronController::getaccreAction` calls `ApplyAccreditationNow`. That method is not defined under `application/`.
- `NewsController` and parts of `TournamentsController` read `UPDATES_PATH`, which is not defined in `public/index.php`. The defined constant is `UPDATE_PATH`.
- `Companies_IndexController` sets `$this->_CID = 35` while other queries use the logged-in company id.
- Permit create and add actions hard-code event id `27`.

Provenance: **Implemented** as written. Whether any of this is intentional is **Unknown / Requires Confirmation**.

## Known dependencies

- PHP with the Zend Framework 1.11.10 library in-tree. `mcrypt_create_iv` is used for reference numbers (`RegisterController`, `LoginController`, `IndexController` in bluecard). The `mcrypt` extension was removed from PHP 7.2. The PHP version this host runs is **Unknown / Requires Confirmation**.
- MySQL database `teamwizz_SARU`.
- SMTP server `mail.sarugby.co.za` for accreditation mail. The Footprint login uses `Zend_Mail` without that SMTP transport in the portion read (`support@footprint.net`).
- dompdf under `public/dompdf`.
- External HTML for PDFs on `footprintapp.net` / `www.footprintapp.net`.
- AppWizard endpoint `https://fsrugby.appwizard.co.za/scripts/AppWiz.dll`.
- Public links named in the Blue Card thank-you copy: `www.sportsconcussion.co.za`, `www.BokSmart.com/Concussion`.
- Theme assets that still reference `demo.themeum.com` (Sportsline WordPress demo). WooCommerce stylesheets are linked from the default layout. No WooCommerce module exists in `application/modules`.

## Current project status

**Dormant snapshot.** One feature commit (the full tree) and one `.gitignore` commit. No tests, no deployment manifest, no environment split beyond ini sections that inherit production. `public/index.php` forces `display_errors` on even though `application.ini` sets `display_errors = 0` for production.

Status of the live site, the database, and the AppWizard integration is **Unknown / Requires Confirmation**.
