No account yet?

Links

Home arrow Articles arrow Programming arrow Web Publishing with FileMaker and PHP - A comparison of FX.php and the FileMaker API for PHP
Web Publishing with FileMaker and PHP - A comparison of FX.php and the FileMaker API for PHP PDF Print E-mail
Tag it:
Delicious
blogmarks
Stumble
Furl it!
Digg
YahooMyWeb
Technorati
User Rating: / 0
PoorBest 
  1. Introduction
    1. Who should read this document
      • FileMaker developers who are new to web publishing.
      • FileMaker developers who are feeling constrained by IWP.
      • FileMaker developers who have done CWP with FX.php.
      • FileMaker developers who have done CWP with XML/XSLT and are considering a move to PHP.
      • PHP developers who would like to learn how to work with a FileMaker backend.
      • CDML and Lasso developers who are planning to transition to a modern technology.
    2. Purpose of this document
      • This document was created to outline the basic similarities and differences of the FX.php and FileMaker.php classes.
      • This document maintains that developers writing CWP solutions should be familiar with both classes.
      • This document does not globally advocate either option.
      • This document is more conceptual that practical, therefore code examples will be kept to a minimum.
      • This document is not intended to teach the reader how to implement a CWP solution.
    3. Document conventions
      • Throughout this document, the terms "FileMaker API for PHP" and "Filemaker.php" will be used interchangebly.

COMPOUND FIND: FX

COMPOUND FIND: FILEMAKER API

CREATE RECORD: FX

CREATE RECORD: FILEMAKER API

DELETE RECORD: FX

DELETE RECORD: FILEMAKER API

DISPLAY PORTAL RECORDS: FX

DISPLAY PORTAL RECORDS: FILEMAKER API

EDIT RECORD: FX

EDIT RECORD: FILEMAKER API

EDIT MANY RECORDS: FX

EDIT MANY RECORDS: FILEMAKER API

FIND RECORDS: FX

FIND RECORDS: FILEMAKER API

FIND ALL RECORDS: FX

FIND ALL RECORDS: FILEMAKER API

FIND OR: FX

FIND OR: FILEMAKER API

2. Performance
1. Informal performance tests were done to compare the execution time of typical FileMaker web publishing operations.
2. The goal was to determine if there were any consisent performance differences between FX.php and FileMaker.php.
3. Performance tests were done on a PowerBook G4 15" with a 1.5 GHz processor and 1GB of RAM running OS 10.4.7, PHP 5.1.4, Apache 1.3.33, and FileMaker Server 8.0v4. 4.

Results * Create 1000 records
o FileMaker.php: 76 seconds
o FX.php: 69 seconds

* Return 1000 records
o FileMaker.php: 3 seconds
o FX.php: 2 seconds

* Edit 1000 records
o FileMaker.php: 73 seconds
o FX.php: 68 seconds

* Delete 1000 records
o FileMaker.php: 90 seconds
o FX.php: 73 seconds

3. Debugging and Error Handling
1. When publishing FileMaker data to the web, two general types of errors can occur:
    1) Connection errors, meaning that your PHP page could not make contact with FileMaker Server at all, and
    2) FileMaker Errors, which indicate that you page successfully connected to FileMaker, but FileMaker could not execute your request as expected.
2. Under FileMaker.php, debugging and error handling are centered around the FileMaker Error Object.
When testing for errors, you only need to test for one kind of error.
In the event of an error, you must perform a further check to determine if that error was FileMaker or connection related.
3. When using FX.php, connection errors return an FX Error Object.
FileMaker errors return a found set as normal, but with a found count of less than one, and flagged with the relevant FileMaker error code.
This means that one check needs to be made for a connection error, and a separate check -- with appropriate handling -- for FileMaker errors.
4. FileMaker.php provides localized versions of FileMaker error messages.
5. FX.php provides only English versions of FileMaker error messages.
6. FX.php also allows a DEBUG flag to be set, which will cause FX to output information related to the connection that it is attempting.
This output can then be used to check for missing parameters, or even to attempt the connection manually.
7. FileMaker.php does not provide access to connection information.
Potential Gotcha: Because FX.php sends POST requests to FileMaker by default, and manual connections generally use GET, the connection performed via a manual connection for debugging is not precisely identical to the connection performed by FX.php.
Note: The latest release of FX.php includes the FX Fuzzy Debugger class which can be used as a debugging aid with either tool.
8. Debugging Examples (expanded from the FindAll examples, above):

4. Customizablity
1. FileMaker.php is not an open source product.
Therefore, it can be dificult or even impossible to customize it to your needs.
In fact, it is a violation of the license agreement to do so.
2. FX.php is an open source product. As such, developers are free to customize it as they wish.
Furthermore, it is a simple matter to "look under the hood" to see how it works, which can be very helpful at times.
Note: Wrapper classes can be created around either tool to add additional, custom functionality.
3. Installers
1. FileMaker.php
* FileMaker, Inc. distributes the FileMaker API for PHP in two forms: a traditional installer, and a bundled version.
Both installers are freely available on FileMaker.com.
* The traditional installer installs not only the FileMaker API for PHP, but also PHP itself.
This is very convenient for individuals who do not already have PHP installed.
* The bundled version is simply a compressed archive of text files that you manually download and place on your hard drive.
This is a good option for individuals who do not have root level access to their web server, or who already have PHP installed.
Potential Gotcha: If you do use the FileMaker API for PHP Installer, and then subsequently run the Uninstaller, you may need to manually edit your web server software's configuration.
In testing on Apache running on Mac OS X, this meant that Apache would not start until httpd.conf had been manually modified.
2. FX.php
* FX.php is only distributed as a bundle.
It is freely available at iViking.org.
* As with the FileMaker.php bundle, the FX.php distribution is a compressed archive of text files that you manually download and place on your hard drive.
Potential Gotcha: When doing the manual install for either tool, be sure that the privileges for all related files allow all users read (and possibly execute) access.
At the very least, give this level of access to the user under which the server process runs.
For security reasons, web server processes run under special low access accounts -- almost certainly not the account used to install the software.
4. Software Requirements & Compatibility
1. Platforms: Both technologies run on Mac, Windows, and Linux.
It should be noted that there is no FileMaker.php installer for Linux, so you would have to opt for the bundled distribution.
2. Web Servers: Both technologies work with Apache and IIS.
3. PHP Versions: Both technologies run on PHP 4.3 or greater.
4. FileMaker Versions: FileMaker.php requires FMSA 8.0v4 or greater. FX.php works with FileMaker 5 or greater.
5. Connection Methods: FileMaker.php requires cURL in order to function. FX.php uses cURL by default (if present), but will work without it.
6. Other Data Stores: FX.php can also be used to talk to MySQL, PostgreSQL, OpenBase, and ODBC data sources.
FileMaker.php only works with FileMaker Server Advanced.
Note: On Mac OS X, cURL is present by default, and cURL is installed by the FileMaker installer, if used.
Potential Gotcha: As is always the case when working with web-based solutions, firewalls and server addressing (among other things) can add complexity when installing, configuring, and/or testing with either tool.
5. About the Authors
1. Chris Hansen
* Chris Hansen, VP of Web Application Development at Scodigo, spent four plus years developing FileMaker web solutions with Lasso and decided there had to be a better way.
He was right. In 2001 Chris co-authored FX.php, an open-source class for working with FileMaker data via PHP, and has maintained it ever since.
FX.php is freely available at iviking.org.
* Chris taught himself AppleSoft BASIC at age 14, and has been programming in whatever language came along for over 20 years.
Expertise and interests include PHP, Java, HTML, FileMaker, OpenBase, CSS, JavaScript, C, Pascal, PostgreSQL, MySQL, Oracle, stuffing PC innards into Mac cases, and so on.
* Chris is currently co-authoring the definitive work on using FileMaker with PHP.
2. Jonathan Stark
* Jonathan Stark is an author and instructor who specializes in building FileMaker/PHP web applications for creative professionals.
He maintains a free website of articles, downloads, and FAQs at jonathanstark.com.
Comments
Search
Only registered users can write comments!
Last Updated ( Thursday, 15 October 2009 )
 
< Prev   Next >