PHP
  Home arrow PHP arrow Page 3 - Mach-II for PHP: A Preview
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Mobile Linux 
App Generation ROI 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Mach-II for PHP: A Preview
By: Mike Britton
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 17
    2004-10-18

    Table of Contents:
  • Mach-II for PHP: A Preview
  • Installation
  • Configuration
  • Properties
  • Event Handlers
  • Basic Coding Techniques
  • Creating Views

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Mach-II for PHP: A Preview - Configuration


    (Page 3 of 7 )

    Programs that use implicit invocation are frequently referred to as event-driven or event-based. Events are announced, and listeners respond if they are subscribed to them. This is how Mach-II works.

    In order to understand what is meant by this, we should begin with mach-ii.xml. This is the configuration file used to define event relationships in a Mach-II application.

    <!--
        phpMachII
            config
                mach-ii.xml
       
        I define the basic control flow for this demo application.
    -->
    <mach-ii>

        <!-- PROPERTIES -->
        <properties>
            <!-- MACH II REQUIRED -->
            <property name="defaultEvent" value="showMain" />
            <property name="exceptionEvent" value="exception" />
            <property name="applicationRoot" value="/phpMachII" />
            <property name="eventParameter" value="event" />
            <property name="parameterPrecedence" value="form" />
            <property name="maxEvents" value="10" /> 
        </properties>

        <!-- LISTENERS -->
     <listeners>
      <listener name="processForm" type="phpMachII.model.processForm">
       <invoker type="MachII.framework.invokers.ObjectEvent" />
      </listener>  
     </listeners>
       
        <!-- EVENT FILTERS -->
        <event-filters>
      <event-filter name="GlobalsToEvent" type="phpMachII.filters.GlobalsToEvent" />
        </event-filters>

        <!-- EVENTS -->
     <event-handlers>
     
      <!-- Main (landing page) -->
      <event-handler event="showMain" access="public">
       <event-arg name="page" value="Main" />  
       <view-page name="main" />
      </event-handler>
     
      <!-- Process a few form variables for demonstration purposes -->
      <event-handler event="processForm" access="public">
       <event-mapping event="success" mapping="showResults" />
       <event-mapping event="noSuccess" mapping="showMain" />
       <notify listener="processForm" method="validateForm" resultKey="GLOBALS['results']" />
      </event-handler> 
     
      <!-- Display results of form processing -->
      <event-handler event="showResults" access="public">
       <event-arg name="pageName" value="Success" />
       <view-page name="results" /> 
      </event-handler>
       
      <event-handler event="exception">
       <event-arg name="page" value="Failure" />
       <view-page name="exception" />
      </event-handler>
     
     </event-handlers>

        <!-- VIEWS -->
        <page-views>
     <page-view name="main" page="/views/main.php" />
     <page-view name="results" page="/views/results.php" />
            <!-- Exception -->
            <page-view name="exception" page="/views/exception.php" /> 
        </page-views>
       
        <!-- PLUGINS -->
        <plugins>
        </plugins>

    </mach-ii>

    Figure 3  The demo app’s mach-ii.xml structure

    This file is the control center of a Mach-II application. As you can see by looking at our example’s mach-ii.xml file, the application is composed of properties, listeners, event-handlers, plugins and filters. mach-ii.xml is where you define the properties and relationships that make up your application. It can be found in an application’s /configure/ directory.

    More PHP Articles
    More By Mike Britton


       · The link that says "available for download" does not actually provide the download...
       · The posting of this article is premature. Mach-II for PHP has not been released...
       · Article has been updated for accuracy. The article will once again be updated once...
       · I was really excited to hear about Mach-II for PHP, I did a lot of recent work in...
       · Looking across the spectrum of other frameworks, compare Mach II against Logicreate...
       · Logicreate is more of an closed-ended CMS framework. It look spretty solid, but is...
       · http://sourceforge.net/projects/pulpo/
       · Sorry - had to reply on this. As one of the principal developers of LC, I have to...
       · You can view Alan's status update in this fusebox.org thread. ...
       · So we need to register with fusebox to get an update on how its coming...
       · Mach-II for PHP has been available for download for a little over a month as of this...
     

       

    PHP ARTICLES

    - Working With Different Namespaces in PHP 5
    - User Management Explained: Overview
    - Using Namespaces in PHP 5
    - Database Security: Guarding Against SQL Inje...
    - Building a Modular Exception Class in PHP 5
    - Database and Password Security for Web Appli...
    - Handling MySQL Data Set Failures in PHP 5
    - Building Site Registration for Web Applicati...
    - Intercepting Customized Exceptions in PHP 5
    - Securing Your Web Application Against Attacks
    - Sub Classing Exceptions in PHP 5
    - Authentication for Web Application Security
    - Building a Content Management System with Co...
    - Filters and Login Systems for Web Applicatio...
    - Working with the Email Class in Code Igniter





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
    Stay green...Green IT