[FX.php List] Another Request for FX.php (version 4.0) feedback
Johan Visser
bpa.services at zonnet.nl
Sat Jun 4 12:11:04 MDT 2005
Chris,
Although I do not understand the $useInnerArray parameter yet, here is some
feedback.
The action constants make the call very clear now, can't you do the same for
the other parameters in the function call.
I find the true/false mean nothing at first glance, unless you look up the
documentation.
So
$currentData = DoFXAction(FX_FIND, true, false);
can become:
$currentData = DoFXAction(FX_FIND, RET_DATA, USE_OUTER);
this makes the call in all its variations even easier to read.
Keep up the good work,
Johan Visser
BPA Services, NL
-----Oorspronkelijk bericht-----
Van: fx.php_list-bounces at mail.iviking.org
[mailto:fx.php_list-bounces at mail.iviking.org]Namens Chris Hansen
Verzonden: zaterdag 4 juni 2005 19:40
Aan: FX.php Discussion List
Onderwerp: [FX.php List] Another Request for FX.php (version 4.0)
feedback
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:
FX_OPEN, FX_CLOSE, FX_DELETE, FX_DUPLICATE, FX_EDIT, etc. No
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
constants)
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
error)
I really appreciate any feedback, and thanks for reading through this
monster message.
Best,
--Chris Hansen
creator of FX.php
"The best way from FileMaker to the Web."
www.iViking.org
_______________________________________________
FX.php_List mailing list
FX.php_List at mail.iviking.org
http://www.iviking.org/mailman/listinfo/fx.php_list
More information about the FX.php_List
mailing list