Zend Framework 1 Documentation

repository·master·Indexed 18 days ago

https://github.com/zendframework/zf1

A comprehensive PHP web application framework. This project reached End-of-Life on 28 Sep 2016 and is no longer maintained. It requires PHP 5.2.11 or later and includes components such as Zend_EventManager, Zend_Mobile_Push, and Zend_Gdata_Analytics, as well as a command-line tool (zf) for managing components.

Tokens
42.1K
Snippets
158
Records
220
Agent score
63%

What's inside Zend Framework 1

  1. Target the correct branch for Pull Requests

    master

    When submitting a pull request, ensure you target the appropriate branch based on the nature of your changes:

    • master branch: Use this for fixes against the stable release.
    • develop branch: Use this for new features or fixes that introduce new elements to the public API (e.g., new public methods or properties).
  2. How Zend_EventManager works

    master

    Zend_EventManager is a component used to manage event-driven logic. It allows you to:

    • Attach and detach listeners to named events.
    • Manage listeners on a per-instance basis or via shared collections.
    • Trigger events.
    • Interrupt the execution of listeners.
  3. Configure Git user email for CLA verification

    master

    To have your contributions accepted, you must have a signed Contributor License Agreement (CLA) on file. The project verifies your CLA status by matching your Git commit email to the email used during CLA registration.

    If your GitHub username does not match your old Zend Framework issue tracker (JIRA) username, you must explicitly set your local Git email to match your CLA email.

    % git config user.email "your-email@example.org"
  4. Install Zend Framework

    master

    Zend Framework does not require a complex installation process. To install it:

    1. Download the framework distribution.
    2. Extract the contents to your desired directory.
    3. Add the framework's library directory to your PHP include_path.

    Note on Extras: If you intend to use components from the extras library, you must also add the extras/library directory to your PHP include_path.

    Note on Zend_Tool: To use Zend_Tool, add the following files to your system's executable path:

    • Windows: bin/zf.bat
    • Linux/macOS/Other: bin/zf.sh
  5. Build the Zend Framework 1 documentation

    master

    The documentation is written in Docbook XML. To build the source XML into HTML, you need a Unix-like operating system with the standard GNU toolchain and an XSLT processor like xsltproc.

    To compile the documentation, navigate to the directory containing manual.xml and execute the following commands:

    1. autoconf
    2. ./configure
    3. make
    $ autoconf
    $ ./configure
    $ make
  6. Set up a development environment using Vagrant

    master

    You can set up a virtual machine for ZF1 unit testing and library development using Vagrant. This environment provides a consistent setup for compiling PHP and running tests.

    Prerequisites

    Install the following on your host machine:

    • VirtualBox
    • Ruby
    • Vagrant

    Setup Steps

    1. Clone the repository:
      git clone git://github.com/zendframework/zf1.git zf1-dev
      cd zf1-dev
    2. Initialize the VM: Run vagrant up. This will download the VM image and provision it. This process may take a significant amount of time.
    3. Access the VM: Run vagrant ssh to enter the virtual machine environment.

    VM Details

    • File Syncing: The zf1-dev directory from your host is mounted inside the VM at /vagrant. You can use your preferred IDE on your host machine to edit files.
    • Port Forwarding:
      • SSH: 22 (VM) -> 2222 (localhost)
      • HTTP: 80 (VM) -> 8081 (localhost)
    • Background Mode: The VM runs as VBoxHeadless.
    git clone git://github.com/zendframework/zf1.git zf1-dev
    cd zf1-dev
    vagrant up
    vagrant ssh
  7. Clean up local and remote branches

    master

    After your changes have been merged into the canonical repository, clean up your branches to maintain a tidy workspace.

    # Remove a local branch
    % git branch -d <branchname>
    
    # Remove a remote branch
    % git push origin :<branchname>
  8. Set up the Cloud Explorer demonstration

    master

    Cloud Explorer is a demonstration of the Zend_Cloud component (Simple Cloud API implementation). It allows users to browse document storage collections, manage queues (create, send, receive messages), and perform file operations (upload/retrieve) via storage services.

    To run the demonstration, follow these setup steps:

    1. Framework Availability: Ensure Zend Framework is either in your PHP include_path or symlinked into the library/ subdirectory of the project.
    2. Web Server Configuration: Create a virtual host that sets the public/ subdirectory as the DocumentRoot.
    3. Configuration:
      • Copy application/configs/application.ini.dist to application/configs/application.ini.
      • Edit the new application.ini to specify your service endpoints and provide the necessary credentials for the cloud services you intend to use.
    4. Execution: Access the application by navigating to your configured virtual host in a web browser.
  9. Workflow for contributing changes to ZF1

    master

    The recommended workflow for implementing features or bugfixes is to use dedicated branches for each task. This facilitates code review and merging.

    1. Create a new local branch from master.
    2. Commit your changes.
    3. Push the branch to your remote repository.
    4. Submit a pull request (via GitHub) or send an email to <zf-devteam@zend.com> with the repository URL, branch name, and description of changes.
    % git checkout -b zf9295
    # ... work and commit ...
    % git push origin HEAD:zf9295
  10. Run ZF1 unit tests in the development VM

    master

    To run tests, navigate to the tests directory within the VM and use phpunit. It is recommended to use the --stderr flag and increase the memory_limit to ensure tests complete successfully.

    Example commands:

    cd /vagrant/tests
    phpunit --stderr -d memory_limit=-1 Zend/Acl/AclTest.php
    phpunit --stderr -d memory_limit=-1 Zend/Amf/AllTests.php
    cd /vagrant/tests
    phpunit --stderr -d memory_limit=-1 Zend/Acl/AclTest.php
  11. Obtain Development Versions of Zend Framework

    master

    If you need to preview enhancements or bug fixes not yet released, you can use Git or Subversion.

    Using Git

    The Zend Framework 1.X git repository is available at: https://github.com/zendframework/zf1

    To update a local working copy, use:

    git fetch && git rebase origin/master

    Using Subversion

    For versions 1.12.0 and later, use these URLs:

    • Development version: https://github.com/zendframework/zf1/trunk
    • Release tags: https://github.com/zendframework/zf1/tags/release-1.12.{maintenance version}
    • Extras trunk: https://github.com/zendframework/zf1-extras/trunk