[FX.php List] Another Request for FX.php (version 4.0) feedback

Chris Hansen chris at iViking.org
Sat Jun 4 11:39:40 MDT 2005

Greetings List!

I hope everyone will give this message a read, regardless of FX.php 
experience level.  I really value your feedback!  If you'd like to 
comment, but would prefer not to post to the list, feel free to respond 
to me directly.

I've received a contribution from a fellow named Chuck Chang to add 
https support for connecting to FM7SA.  (This is a great new feature of 
FM7, so kudos to Chuck for his contribution.)  Very nice!  That said, 
he also suggested that perhaps the FX declaration is not the place to 
specify the return format (i.e. whether or not to add that last layer 
of the array) and I think I agree with him.  Here's what I propose:

* In the new version I've added this function:

function DoFXAction($currentAction, $returnDataSet = true, 
$useInnerArray=false, $returnType = 'object')

* This is used in conjunction with come new constants, like this:

$currentData = DoFXAction(FX_FIND, true, false);

* You'll note that now there's no need to remember multiple action 
functions.  Each action constant should be logical to remember: 
abbreviations.  Easy?

* $useInnerArray can default to false, since this is a new function.

* This does mean that support for removal of this last level wouldn't 
be present in the old functions, but old code wouldn't use this anyway.

* You might also note that new value -- object -- for $returnType.  
Basically, after the last discussion about removing the top level of 
the array (while mowing the lawn =), I realized "hey! this is an 
object.  People can pull error data, etc. by using class variables!"  
So, for the new function, the default return type will be 'object' 
which will return just the data.  I'll add new class variables for the 
other elements of the top level array.  True there will be some minor 
variable semi-duplication, but some functions need to work with the 
existing class variables, whereas the new ones will ONLY be set just 
before data return.

* With the new function, an error object will ALWAYS be returned on an 
error, even for FileMaker errors.

* The original action functions are STILL THERE for those who want the 
easiest way to access complex FileMaker data.

* Support for the new object return type will be added to the original 
action functions.

I realize that's a lot to sort through, but I really would like lots of 
feedback on this.  My hope is that these additions/changes will do 
three things:

1) simplify coding (one function to remember, with logical action 

2) simplify data handling (by stripping away extra, often unnecessary, 
data in the return when desired)

3) add power (by doing the above and ALWAYS returning an error for any 

I really appreciate any feedback, and thanks for reading through this 
monster message.


--Chris Hansen
   creator of FX.php
   "The best way from FileMaker to the Web."

More information about the FX.php_List mailing list