Article

Zend Framework 1 Project Structure for Maintainers

Map ZF1 application/, public/, library/, modules, and configs so modernization work targets the right layers.

ZF1 repositories rarely match modern skeleton docs. Before changing PHP versions or extracting features, draw the real tree: which directory is the document root, where configs live, and whether modules are first-class or copy-pasted controller folders.

Common layout

project/
  application/
    Bootstrap.php
    configs/application.ini
    controllers/
    models/
    views/scripts/
    modules/          # optional
  library/
    Zend/             # often vendored
    MyCompany/
  public/
    index.php
    .htaccess
  scripts/            # cron / CLI
// LEGACY public/index.php fragment
defined('APPLICATION_PATH')
    || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
require_once 'Zend/Application.php';
// MODERN hygiene — keep constants, but autoload app code via Composer
require dirname(__DIR__) . '/vendor/autoload.php';
// still bootstrap Zend_Application until strangler cutover

What to document in the repo

  • Document root and rewrite rules (Apache/nginx)
  • Include paths previously injected by Zend Studio project metadata
  • Environment names in APPLICATION_ENV
  • Non-web entry points under scripts/

Related: front controller, Composer, import existing PHP project.

Related tools

Related reading