PHPackages                             se7enxweb/primer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. se7enxweb/primer

ActiveLibrary[Framework](/categories/framework)

se7enxweb/primer
================

7x Primer 1.5 — PHP 8.x - 8.5.6 Support upgrade of symfony 1.4.x (branch 1.5) maintained by 7x

v1.5.0.3(2mo ago)21MITPHP &gt;=8.0

Since May 10Compare

[ Source](https://github.com/se7enxweb/primer)[ Packagist](https://packagist.org/packages/se7enxweb/primer)[ Docs](https://github.com/se7enxweb/primer)[ Fund](https://account.venmo.com/u/se7enxweb)[ Fund](https://cash.app/$7xweb)[ RSS](/packages/se7enxweb-primer/feed)WikiDiscussions Synced 3w ago

READMEChangelog (4)DependenciesVersions (5)Used By (0)

7x Primer Framework v1.5 — PHP 8.5 Support (Stable; Open Source)
================================================================

[](#7x-primer-framework-v15--php-85-support-stable-open-source)

[![PHP](https://camo.githubusercontent.com/2f6f9af2e917cbf5786673e8e4ed8d0d9b29be6131327a992063e69136a93411/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e302532422d626c7565)](https://php.net/)[![Primer](https://camo.githubusercontent.com/cd9a330b883006fb2c14631beb57c42faeede468b33e8f0f123c594ecc2bcd06/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7072696d65722d312e352d6f72616e6765)](https://github.com/se7enxweb/primer)[![License: MIT](https://camo.githubusercontent.com/5caa455d8debc46fb23abbadb45a733a937f3910a73fc875c2f7820468e1bb54/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e)](LICENSE)[![GitHub issues](https://camo.githubusercontent.com/07c2df22c6338508b7e6d1a9cf8569a4847b118312f72828784e71bd097cf2f2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f736537656e787765622f7072696d6572)](https://github.com/se7enxweb/primer/issues)

> **7x Primer Framework v1.5** is the continuing evolution of the original symfony 1.4 framework, now fully compatible with PHP 8.0 through PHP 8.5. Maintained by [7x (se7enx.com)](https://se7enx.com/)and the open-source developer community that has relied on symfony1 for over two decades.

---

Table of Contents
-----------------

[](#table-of-contents)

1. [Project Notice](#1-project-notice)
2. [Project Status](#2-project-status)
3. [Who is 7x](#3-who-is-7x)
4. [What is 7x Primer Framework?](#4-what-is-7x-primer-framework)
5. [Architecture Overview](#5-architecture-overview)
6. [Technology Stack](#6-technology-stack)
7. [Requirements](#7-requirements)
8. [Quick Start](#8-quick-start)
9. [Main Features](#9-main-features)
10. [Developer Toolbar](#10-developer-toolbar)
11. [Building Pages, Routes, and Database Results](#11-building-pages-routes-and-database-results)
12. [Installation](#12-installation)
13. [Key CLI &amp; Task Reference](#13-key-cli--task-reference)
14. [Issue Tracker](#14-issue-tracker)
15. [Where to Get More Help](#15-where-to-get-more-help)
16. [How to Contribute](#16-how-to-contribute)
17. [Donate &amp; Support](#17-donate--support)
18. [Copyright](#18-copyright)
19. [License](#19-license)

---

1. Project Notice
-----------------

[](#1-project-notice)

> **Please Note:** This project is not associated with the original symfony project, SensioLabs, or Fabien Potencier beyond attribution. It is an independent, 7x + community-driven continuation of the symfony 1.4 codebase, stewarded and evolved by [7x (se7enx.com)](https://se7enx.com/) to support PHP 8.x in production.

---

2. Project Status
-----------------

[](#2-project-status)

The symfony 1.4 codebase reached end-of-life in November 2012. Thousands of production websites and applications continued to run on it because its architecture — convention-over-configuration, composable action-filter-view pipeline, flexible ORM integration — remained sound and productive.

**7x Primer Framework v1.5** is the first release branch that brings this codebase fully into the PHP 8.x era.

The `1.5` branch is the current active development branch. Work focuses on:

- PHP 8.0 through PHP 8.5 full compatibility and test suite passing
- Composer package manager integration alongside sfCoreAutoload
- Security patches and vulnerability triage
- Documentation and developer experience improvements

---

3. Who is 7x
------------

[](#3-who-is-7x)

[7x](https://se7enx.com/) is a North American web software corporation with over 24 years of experience building and maintaining PHP web applications and content platforms. Previously known as Brookins Consulting, 7x took on stewardship of the symfony1 codebase to ensure that the many applications built on it can continue to run on modern, supported PHP versions.

7x offers:

- Commercial PHP 8.x upgrade consulting for symfony1 applications
- Hosting and infrastructure for PHP 8.x projects
- Custom development, migrations, and training
- Open-source community stewardship

---

4. What is 7x Primer Framework?
-------------------------------

[](#4-what-is-7x-primer-framework)

7x Primer Framework (v1.5) is a PHP 8.x-compatible continuation of the symfony 1.4 MVC web application framework. It provides:

- A **Model-View-Controller** architecture with clean separation of concerns
- **Convention-over-configuration** — a predictable directory layout that removes boilerplate
- **sfPatternRouting** — a flexible URL routing engine with named routes, parameters, and requirements
- **Action pipeline** — `executeActionName()` methods dispatch HTTP requests through configurable pre/post filters to typed PHP template files
- **symfony1-style autoloading** via `sfCoreAutoload` — every class in `lib/` is available on demand
- **Composer integration** (new in 1.5) — `vendor/autoload.php` coexists with `sfCoreAutoload` via PHP's `spl_autoload` stack, giving access to the full Packagist ecosystem
- **ORM integration** — `sfDoctrinePlugin` and `sfPropelPlugin` remain fully functional for database-backed applications
- **Lime test framework** — a TAP-based unit and functional test suite with 600+ tests
- **Full PHP 8.5 support** — every PHP 8.x breaking change addressed in the core library

### Architecture at a Glance

[](#architecture-at-a-glance)

```
HTTP Request
      │
      ▼
   Web Server (Apache / Nginx)  →  DocumentRoot: public/
      │
      ▼
  public/index.php  ──  sfCoreAutoload + (optional) Composer vendor/autoload.php
      │
      ├── sfPatternRouting  →  matches URL to module/action
      │
      ├── {Module}Actions::execute{Action}()  →  business logic
      │
      ├── {action}Success.php  →  view template (PHP)
      │
      └── layout.php  →  HTML decorator (wraps template output)

```

---

5. Architecture Overview
------------------------

[](#5-architecture-overview)

### Directory Layout

[](#directory-layout)

```
project-root/
├── apps/
│   └── {appName}/
│       ├── config/
│       │   └── routing.php          Route definitions (sfRoute / sfPatternRouting)
│       ├── lib/
│       │   ├── sfMicroAction.class.php    Base action class (mirrors sfAction API)
│       │   └── sfMicroDispatcher.class.php   Front controller dispatcher
│       ├── modules/
│       │   └── {moduleName}/
│       │       ├── actions/
│       │       │   └── actions.class.php  {Module}Actions extends sfMicroAction
│       │       └── templates/
│       │           └── {action}Success.php  View template
│       └── templates/
│           ├── layout.php           HTML decorator layout
│           └── error404.php         404 fallback template
├── lib/                             symfony1 core library (sfCoreAutoload scans here)
│   ├── autoload/                    sfCoreAutoload class
│   ├── cache/                       Cache drivers
│   ├── config/                      Configuration handlers
│   ├── form/                        Form and widget system
│   ├── i18n/                        Internationalisation
│   ├── plugins/                     sfDoctrinePlugin, sfPropelPlugin
│   ├── routing/                     sfPatternRouting, sfRoute
│   ├── task/                        symfony CLI tasks
│   ├── util/                        sfToolkit, sfInflector, sfFinder, …
│   ├── validator/                   Validator library
│   ├── vendor/
│   │   ├── lime/                    Lime test framework
│   │   └── swiftmailer/             Swift Mailer
│   └── yaml/                        YAML parser
├── public/                          ← Web server DocumentRoot (only publicly served dir)
│   ├── index.php                    Web front controller — single entry point
│   ├── .htaccess                    Apache rewrite rules
│   ├── favicon.ico
│   └── favicon.png
├── test/
│   ├── unit/                        Unit tests (lime-based)
│   └── functional/                  Functional tests
└── composer.json                    Composer manifest (new in v1.5)

```

---

6. Technology Stack
-------------------

[](#6-technology-stack)

ComponentVersionLanguagePHP **8.0+** (tested through **8.5.6**)Framework7x Primer Framework **1.5** (symfony1 core)AutoloadingsfCoreAutoload + Composer PSR-4/classmap (coexistent)ORMsfDoctrinePlugin (Doctrine 1.x) · sfPropelPlugin (Propel 1.x) · PDO (direct)Template EnginePHP (native)RoutingsfPatternRouting + sfRouteTest FrameworkLime (TAP-based)Dependency MgmtComposer 2.x (optional — new in v1.5)Web ServerApache 2.4 · Nginx 1.18+DatabaseMySQL 8.0+ · MariaDB 10.3+ · PostgreSQL 14+ · SQLite 3.x---

7. Requirements
---------------

[](#7-requirements)

- **PHP 8.0 or later** (PHP 8.5 recommended; tested on 8.5.6)
- A web server: **Apache 2.4** (with `mod_rewrite`) or **Nginx 1.18+**
- A database: **MySQL 8.0+**, **MariaDB 10.3+**, **PostgreSQL 14+**, or **SQLite 3.x**
- **Composer 2.x** (optional — required only when installing Packagist packages)

### Requirements Summary

[](#requirements-summary)

RequirementMinimumRecommendedPHP8.08.5+Apache2.42.4 (event + PHP-FPM)Nginx1.181.24+MySQL8.08.0+MariaDB10.310.6+PostgreSQL1416+SQLite3.03.35+Composer2.0latest 2.x (optional)---

8. Quick Start
--------------

[](#8-quick-start)

```
# 1. Clone the repository (branch 1.5)
git clone -b 1.5 https://github.com/se7enxweb/primer.git my-project
cd my-project

# 2. (Optional) Install Composer packages
composer install

# 3. Point your web server DocumentRoot to the project's public/ directory
#    This keeps lib/, apps/, vendor/, composer.json, etc. off the web.
#    See INSTALL.md for Apache and Nginx virtual host examples.

# 4. Open in a browser
#    GET /         → 301 redirect to /version
#    GET /version  → live status dashboard (all 8 core class checks)
```

---

9. Main Features
----------------

[](#9-main-features)

- **Convention-over-configuration MVC** — modules, actions, and templates follow a predictable naming convention; zero config required for the happy path
- **sfPatternRouting** — named routes, parameter requirements, default values, and reverse URL generation
- **Action pipeline** — pre-filters, post-filters, and slots for cross-cutting concerns (auth, logging, caching)
- **symfony1-style autoloading** — `sfCoreAutoload` discovers every class in `lib/` automatically
- **Composer integration** (new in v1.5) — `vendor/autoload.php` loads alongside `sfCoreAutoload`when present; install any Packagist package with `composer require`
- **Form system** — `sfForm`, `sfFormField`, `sfWidget`, and `sfValidator` for type-safe form handling
- **i18n / l10n** — `sfI18N`, `sfDateFormat`, `sfNumberFormat` for internationalised applications
- **Lime test framework** — TAP-based unit and functional testing with 600+ passing tests
- **sfDoctrinePlugin** — Doctrine 1.x ORM with model generation, migrations, and fixtures
- **sfPropelPlugin** — Propel 1.x ORM as an alternative
- **Cache drivers** — filesystem, APC, SQLite, and Memcache cache backends
- **Swift Mailer** — bundled for transactional email
- **YAML configuration** — sfYaml parser for configuration files
- **PHP 8.0–8.5 full compatibility** — all breaking changes addressed in 62 core library files

---

10. Developer Toolbar
---------------------

[](#10-developer-toolbar)

When running in the **dev environment**, 7x Primer injects the **7x Primer Developer Toolbar** — a dark, fixed-bottom debug bar — into every HTML response. It shows request metadata, logs, memory usage, and timing information at a glance.

### Accessing the Dev Environment

[](#accessing-the-dev-environment)

The dev entry point is `public/index_dev.php`. Prefix any URL path with `/index_dev.php` to use it:

```
# Production URL (no toolbar)
https://yourapp.com/articles/hello-world

# Development URL (toolbar visible)
https://yourapp.com/index_dev.php/articles/hello-world

# Home page in dev mode
https://yourapp.com/index_dev.php/

# Version / status page in dev mode
https://yourapp.com/index_dev.php/version

```

> **Note:** `index_dev.php` is IP-guarded. Only requests from allowlisted addresses are served — all others receive `403 Forbidden`. See [IP Allowlist](#ip-allowlist) below.

### IP Allowlist

[](#ip-allowlist)

The allowed IP list is managed in `apps/site/config/dev.yml`. Edit this file to add your local or team IP addresses — no code changes needed.

```
# apps/site/config/dev.yml
dev:
  # IP addresses and CIDR ranges allowed to access public/index_dev.php.
  # Requests from any other address receive 403 Forbidden.
  allowed_ips:
    - '127.0.0.1'       # IPv4 localhost
    - '::1'             # IPv6 localhost
    - '192.168.0.0/16'  # Private LAN (Class C)
    - '10.0.0.0/8'      # Private LAN (Class A)
    - '203.0.113.42'    # Example: your office or home static IP
```

To find your current public IP:

```
curl -s https://ifconfig.me
# or
curl -s https://api.ipify.org
```

Add that IP under `allowed_ips`, save the file, and reload — no server restart required.

### Toolbar Layout

[](#toolbar-layout)

The toolbar is fixed to the bottom of every page. It has three display states, each persisted across reloads via `localStorage`:

StateHow to enterWhat you see**Full**Default on first loadComplete bar across the bottom**Collapsed**Click the **7x logo** (far left)Bar stays, panel buttons hidden, × visible**Minimized**Click the **×** button (far right)40 px red circle in the bottom-right cornerClick the **7x logo** in any reduced state to restore the full bar.

**Left info block** — always visible in full/collapsed mode:

CellExampleDescriptionMethod`GET`HTTP method, colour-codedStatus`200`HTTP response statusRoute`version`Matched route nameController`versionActions`Action class nameTime`4 ms`Total dispatch time**Right panel list** — click any item to open its detail popup:

- **Logs** — all `sfVarLogger` entries, filterable by Info / Warning / Error
- **Memory** — peak memory usage
- **Kernel** — 7x Primer version (`1.5.0.3`)

---

11. Building Pages, Routes, and Database Results
------------------------------------------------

[](#11-building-pages-routes-and-database-results)

See [INSTALL.md](INSTALL.md) for full step-by-step instructions. Below is the three-minute version.

### Define a route

[](#define-a-route)

```
// apps/site/config/routing.php
$routing->connect('articles', new sfRoute('/articles', [
    'module' => 'article',
    'action' => 'index',
]));
$routing->connect('article_show', new sfRoute('/articles/:slug', [
    'module' => 'article',
    'action' => 'show',
], ['slug' => '[a-z0-9\-]+']));
```

### Create an action

[](#create-an-action)

```
// apps/site/modules/article/actions/actions.class.php
class articleActions extends sfMicroAction
{
    public function executeIndex(): string
    {
        $pdo = new PDO('mysql:host=127.0.0.1;dbname=myapp;charset=utf8mb4', 'user', 'pass');
        $this->articles = $pdo->query('SELECT * FROM articles ORDER BY created_at DESC LIMIT 10')
                              ->fetchAll(PDO::FETCH_ASSOC);
        $this->title = 'Latest Articles';
        return sfView::SUCCESS;
    }

    public function executeShow(): string
    {
        $pdo = new PDO('mysql:host=127.0.0.1;dbname=myapp;charset=utf8mb4', 'user', 'pass');
        $stmt = $pdo->prepare('SELECT * FROM articles WHERE slug = ? LIMIT 1');
        $stmt->execute([$this->getRequest()->getParameter('slug')]);
        $this->article = $stmt->fetch(PDO::FETCH_ASSOC);
        if (!$this->article) {
            $this->forward404();
        }
        $this->title = $this->article['title'];
        return sfView::SUCCESS;
    }
}
```

### Create a template

[](#create-a-template)

```
