Learning php
Hi,
I'm starting to learn PHP for CWP and have bought a couple of the recent books detailing the PHP API. What PHP book(s) or websites other than filemaker API specific ones would people suggest for learning php?
Note that I'd like to use smartpill for future development to replace the functions of a couple of plugins that I'm using now (SMTPit Pro, MMScript, and Troi file) The examples that come with smartpill show how I can replace most of what I'm doing with SMTPit (except for the nice dialogs it provides for email sending) But what I really want to learn about is the php functions that can copy, create, delete, rename, etc.. files and folders, as well as mount and dismount shared drives.
Also, are there things that php can't do natively where one would have to revert to a vbscript or other shell script (registry functions on windows, GUI scripting (like AutoIt or WinBatch) or others. How have people best implemented these calls to external scripts (do you store the scripts in a container field or text field and export them, or just manually install them on the appropriate computers)
Thanks for any advice you can give on getting started.
Dana
Learning php
Hello Dana,
I like the Wrox books (www.wrox.com) but there are hundreds of books out there for all different levels. There's also a tremendous amount of free resources so you may be able to find articles specific to the problem you're trying to solve.
In regards to specific functions, like the file functions you mention, PHP's online manual is invaluable (www.php.net). You can find details regarding each function and then in the comments you'll find many good examples.
PHP can run shell scripts so that extends the possibilities quite a bit. We actually have a solution where we dynamically write out a VB file to disk and then execute it using the shell function.
As far as GUI scripting, this is really out of the realm of what PHP can do so you'd have to look at some other technology (assuming the GUI can't be done in FileMaker).
In regards to storing scripts, we sometimes store them in the database and then execute them from a field. We also put them in custom functions and often just include the code right in a script step (especially for small snippets). We have yet to write script files to disk. It certainly can be done but it adds an extra step.
Regards,
Micah