Skip to content
This repository was archived by the owner on Mar 23, 2023. It is now read-only.

Code Structure

te11iott edited this page Feb 2, 2017 · 6 revisions

ACORN is a PHP application that utilizes the Zend Framework and the Yahoo User Interface (YUI).

Zend version: 1.12.20 - there is no guarantee that it will work with later versions of the framework.

Zend API: https://framework.zend.com/docs/api/zf1

YUI version 2.8.2: http://developer.yahoo.com/yui/download/

The directory structure is described here. Below you will find more details on what each directory contains.

application (MVC)
    .htaccess - Rewrite to public/index.php
    controllers - Instances of Zend_Controller_Action. These controllers are what receive and delegate all of the requests. A controller generally does one of two things: displays a particular view based on the action called OR saves or retrieves data from a model object.
    layout - Holds the general layout template. The layout template has common js and css includes, placeholders for custom js and css includes, the menu, a place for error messages, and the logout link.
    models
        domain - Model objects that are populated by the DAOs and stored throughout the session.
        dao - Objects that communicate with the MySQL database. Each model is an instance of Zend_Db_Table.
    views
        filters - Instances of Zend_Filter. These help filter data entered into the fields by the users. For example, the custom password filter takes in the user entered data and returns it in md5 encryption.
        forms - Instances of Zend_Form. Each instance populates the elements that will appear in the view.
        helpers - Instances of Zend_View_Helper. These are functions that are called repetitively and therefore can be simplified to a single call using a helper.
        includes - common phtml files that are included in various scripts.
        scripts - These are the actual views. They resemble PHP pages. Each script matches to a form element from the forms directory.
        validators - Instances of Zend_Validate. These help to validate the data that the user enters. For example, ensures that a field that should have only numerical entries does.
    bootstrap.php - The Zend bootstrap file. This file loads the environment type, include path, registers the configuration file, registers the default database adapter, and registers the controllers. PLEASE NOTE: The environment type must be set here before uploading it to the server ('prod', 'test', 'dev'). The environment type determines what type of logging, where to log, and the database configuration to use.
    clibootstrap.php - The Zend bootstrap file for the command line scripts. This file loads the environment type, include path, registers the configuration file and registers the default database adapter. PLEASE NOTE: The environment type must be set here before uploading it to the server ('prod', 'test', 'dev'). The environment type determines what type of logging, where to log, and the database configuration to use.
    CLIInitializer.php - Used by clibootstrap.php in configuring the application. No views or controllers are configured here since it is for command line usage.
    config.ini - The configuration file for items not related to the database (directory paths, logging levels, etc.).
    dbconfig.ini - The database configuration file.
    Initializer.php - Used by bootstrap.php in configuring the application.

library - The Zend library files. These should be included here so that other projects working on the same server may use their own instances of the framework.

logs - The access, error, and custom logs. NOTE: This directory should have group = apache and group should have rwx access.

public (css, js, images) - Holds the images, css, and js files as well as the bootstrap initializer file.
    .htaccess - Rewrites to index.php
    userfiles - The location in which non-image user files are stored
        .htaccess - Rewrite rule off so reports can be viewed
    userreports - The location in which the user reports are generated. NOTE: This directory should have group = apache and group should have rwx access.
        .htaccess - Rewrite rule off so reports can be viewed
    index.php - Calls the Zend bootstrap file.