Home arrow PHP arrow Page 2 - Mach-II for PHP: A Preview

Installation - PHP

Mach-II is a framework for organizing applications using standard OO techniques. This article will cover how to install, set up and configure a Mach-II application, and explore basic coding techniques.

TABLE OF CONTENTS:
  1. Mach-II for PHP: A Preview
  2. Installation
  3. Configuration
  4. Properties
  5. Event Handlers
  6. Basic Coding Techniques
  7. Creating Views
By: Mike Britton
Rating: starstarstarstarstar / 17
October 18, 2004

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

Let’s walk through a basic setup. This is often the most intimidating part of learning a new framework, but with Mach-II it’s surprisingly painless.

There are two ways to install Mach-II for PHP. The first and preferred method is using the PEAR installer. The second is a manual installation.

PEAR Installer

For anyone unfamiliar with using the PEAR installer with PHP, visit this link. It’s a snap to get running and will allow you to install Mach-II from the command line by issuing a command to PHP. Once the PEAR installer is set up, simply install the Mach-II package like any other PEAR package. Then at the command prompt enter the following:

pear install MachII-x.x.x.tgz

Manual Installation

First, open php.ini and make sure the path to your web root is listed (it should be).

include_path = ".; c:inetpubwwwroot;"

One feature of Mach-II is its core files only need to be installed once for multiple apps. In the case of the demo app, Mach-II was manually installed in the web root. Obviously you can install the framework anywhere, as long as the core files (and your application) can use the include path ./MachII.

Next, unarchive the Mach-II core files into a temp directory. You’ll see the following directory structure:

Getting Started with Mach-II for PHP

Figure 1  Core files in their directories

For the purpose of this demonstration, our application’s directory will reside at the same level as the core files. Create a directory in your web root called ./MachII and copy the contents of ./MachII-x.x.x into it. Create a new directory ./simpleApp inside your web root, as well. This is where we’ll put the demonstration application’s files.

Now unarchive the project files for this article into ./simpleApp. You should see the following directory structure:

Getting Started with Mach-II for PHP

Figure 2  Our demo’s directory structure



 
 
>>> More PHP Articles          >>> More By Mike Britton
 

blog comments powered by Disqus
   

PHP ARTICLES

- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...
- PHP: Building Concrete Validators
- Sanitizing Input with PHP
- Executing Shell Commands with PHP
- Handling File Data with PHP
- File Security and Resources with PHP
- ArrayObject PHP Class Examples
- ArrayObject PHP Class: An Introduction
- Getting File System Data with PHP
- PHP Tools for Working with the File and Oper...
- Working with the File and Operating System w...
- PHP Proxy Patterns: Completing a Blog


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 8 - Follow our Sitemap

Dev Shed Tutorial Topics: