Anyone have any suggested methods for really familiarizing oneself with the scripting docs? Specifically, the PHP scripts.
I know the engineers are working on the documentation for DF 2.0, but I’m just wondering where the best place to learn the methods, functions, etc… that I can call within a script. Where should I look within the install directory to gain more insight into the available methods?
For example, I am trying to call something like “platform.api.get()” using PHP, but it doesn’t seem to work so I’m trying to figure out how to use the following code from the PHP scripting example to create an internal GET request from within a custom script to download a file:
DreamFactory\Core\Utility\ServiceHandler::handleRequest(
‘POST’,
‘push’,
‘topic/arn:aws:sns:us-east-1:xxxxxx:new_todo’,
[],
[
“Message” => “A new Todo named “.$payload[‘name’].” was just created.”,
“Subject” => “New Todo Created”,
]
);
(obviously I need to modify that code)
I’m trying to basically make a custom pre_process script for my file storage service which changes the inbound URL request. It seems the pre/post processing server scripts do not fire for some reason currently. Someone else reported this issue, but I can’t find the link ATM. Like the user who reported the issue, I’m trying to take an inbound folder request and internally modify the link to their folder.
Unlike with JavaScript we don’t have all those classes pre-built.
Here is a sample PHP script for interacting with the API that one of the engineers sent me. Hopefully it’s enough to get you going.
Hey Kim, any idea when the documentation related to PHP scripting will be up on the website. There are few examples on the documentation but that isn’t fully useful if we have to write a complex PHP script.
This is helpful. I’m trying to use this to retrieve all records from a table on a post post using: $csvInfo = DreamFactory\Core\Utility\ServiceHandler::handleRequest('GET','mysql','_table/saa-recipients'); var_dump($csvInfo);
It’s only returning the record I just submitted via POST and not all records. This is sort of useless as my post data is available as \Request::json()->all();