Jump to content
Sign in to follow this  
  • entries
    16
  • comments
    0
  • views
    541

myFMbutler — myFMApiLibrary for PHP, one library to rule them all

Sign in to follow this  
Marina Syhanath

322 views

myFMbutler — myFMApiLibrary for PHP, one library to rule them all

Lesterius Team has developed a PHP library to make the FileMaker Data Api 17 easier to use.

Lesterius co-creates FileMaker Platform based solutions with their customers. Sharing knowledge takes part of our DNA, that’s why we developed this library to make the FileMaker Data API easy-to-use with PHP.

We already used it for our FileMaker 16 internal projects and we improved it enough with FileMaker 17 to share it with the world.

1*XlDCO_6ml5lRCbxJZnkzow.jpegPhoto by Porapak Apichodilok on Pexels

Why do we provide a wrapper while the data REST API already works?

To make it simple.

In our library, we’ve already coded all cURL requests. You don’t need to read the FileMaker Data API documentation to make it work, you just have to follow our documentation. Readable by every PHP developers, you can use it even if you don’t know anything about FileMaker. Download it and it’s ready.

Go to our GitHub and download it or do a composer install:

composer require myFMbutler/myFMApiLibrary-for-PHP

See how to enable FileMaker Data Api on your FileMaker Server with this video, then create a user with the fmrest privilege and allow him to access your target data and layouts.

Here is an example that shows how to find records with credentials method login:

<?php
require_once __DIR__ . '/vendor/autoload.php';
// Link librairy to FileMalker database
dataApi = new \Lesterius\FileMakerApi\DataApi('https://test.fmconnection.com/fmi/data', 'MyDatabase');
// Log user using the credentials method
$dataApi->login('filemaker api user', 'filemaker api password', 'layout name');
// My search parameters
$query = [
[
'fields' => [
['fieldname' => 'FirstName', 'fieldvalue' => '==Test'],
['fieldname' => 'LastName', 'fieldvalue' => '==Test'],
],
'options' => [
'omit' => false
]
]
];

try {
  $results = $dataApi->findRecords('layout name', $query, $sort, $offset, $limit, $portals, $scripts, $responseLayout);
} catch(\Exception $e) {
// log exception here
}
// Show data
echo "<pre>", var_dump($results), "</pre>";
// Logout user
$dataApi->logout();

Enjoy. You can also see all the examples in the readme here.

That’s all?

Where there are no features, there is no pleasure.

We also have ideas for some new features:

  • Number of bytes per request,
  • Choose response format (xml, JSON, etc),
  • Same library, another language,
  • And more…
JOIN US ON GITHUB!

Free download

Download the latest version and documentation from Github.

You can also find the product page here.

1*QeBgI9y4y928CDq-FADJ-w.pngstat?event=post.clientViewed&referrerSource=full_rss&postId=f749e535a834

myFMbutler — myFMApiLibrary for PHP, one library to rule them all was originally published in Lesterius on Medium, where people are continuing the conversation by highlighting and responding to this story.


Afficher la totalité du billet

Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...