msyk / FMDataAPI

FMDataAPI is a class developed by PHP to access FileMaker database with FileMaker Data API.
49 stars 18 forks source link
api database filemaker inter-mediator php

FMDataAPI Ver.32 Build Status

by Masayuki Nii (nii@msyk.net)

FMDataAPI is a class developed in PHP to access FileMaker database with Claris FileMaker Data API.

Contributers

They created pull requests. Thanks for cooperating.

At a Glance

The FileMaker database named "TestDB.fmp12" is hosted on localhost, and it sets the "fmrest" as access privilege. The account to connect with REST API is "web" and "password." This database has the layout named "person_layout," and you can use the layout name as a property of the FMDataAPI instance. The return value of the "query" method is Iterator and can repeat in the foreach statement with each record in the query result. This layout has the field named "FamilyName" and "GivenName," and can use the field name as a property.

$fmdb = new FMDataAPI("TestDB", "web", "password");
$result = $fmdb->person_layout->query();
foreach ($result as $record) {
    echo "name: {$record->FamilyName}, {$record->GivenName}";
}

For more details, I'd like to read codes and comments in file samples/FMDataAPI_Sample.php.

API Document is here: https://inter-mediator.info/FMDataAPI/packages/INTER-Mediator-FileMakerServer-RESTAPI.html

What's This?

The FileMaker Data API is the new feature of FileMaker Server 16, and it's the API with REST-based database operations. Although the Custom Web Publishing is the way to access the database for a long while, FileMaker Inc. has introduced the modern feature to operate the database. The current version of FMDataAPI works on just FileMaker 18 and 19 platform.

For now, I'm focusing on developing the web application framework "INTER-Mediator" (https://inter-mediator.com/ or https://github.com/INTER-Mediator/INTER-Mediator.git) which can develop the core features of database-driven web application with declarative descriptions. INTER-Mediator has already supported the Custom Web Publishing with FX.php, and I develop codes here for support REST APIs.

Bug reports and contributions are welcome.

Installing to Your Project

FMDataAPI has "composer.json," so you can add your composer.json file in your project as below.

...
"require": {
  ...
  "inter-mediator/fmdataapi":"31"
} ...

About Files and Directories

Licence

MIT License

Acknoledgement

History

(Previous history is here)