Download the PHP package sib-retail/fluent-fm without Composer
On this page you can find all versions of the php package sib-retail/fluent-fm. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sib-retail/fluent-fm
More information about sib-retail/fluent-fm
Files in sib-retail/fluent-fm
Package fluent-fm
Short Description A PHP package for FileMaker Server's Data API using a fluent query builder style interface.
License MIT
Informations about the package fluent-fm
FluentFM
FluentFM is a PHP package that connects to FileMaker Server's Data API using a fluent query builder style interface.
Requirements
- PHP 7.2+
- FileMaker Server 17
Installation
Using Composer
Use the command
or include in your composer.json
file
Prepare FileMaker
Important! All tables and layouts must contain an id
field.
If you wish to use soft deletes your table and layout must contain the field deleted_at
The following fields are also recommended:
created_at
(for sorting by latest)updated_at
(for sorting by last update)
All fields that you wish to access must be available in the layout that you provide while performing FileMaker operations through the api.
Ideally these will be hidden layouts that contain all fields raw, mirroring the table, but depending on your layout structure you may be able to use existing human-facing layouts.
Ensure that fmrest
is enabled on your privilege set, which you can define in
File > Manage > Security > [highlight user] > Privilege Set [Edit]
Also be sure that the Data API is enabled on the server.
If your server is installed locally this link should take you there:
http://localhost:16001/admin-console/app/connectors/fmdapi
Otherwise replace localhost
with the server address.
Usage
Getting records from layout
Performing a find operation
Creating a record
Updating a record
Deleting records
If you wish to use soft deletes your table and layout must contain the field deleted_at
Uploading and downloading files to a record's container
Running FileMaker scripts
Retrieving Metadata
To retrieve a Layout's metadata (columns types and properties)
Chainable commands
Chainable modifiers
End of chain methods
Misc commands
Persistent Authentication
If your PHP installation has the APCu module installed, this library is able to cache authentication tokens between requests.
Tokens are :
- associated to a filemaker host, database, user and password.
- valid for 15 minutes from time of creation or last use to query the Data API.
Everytime a token is used to make a new Data API request, its TTL (time to live) in the cache is prolonged by 14.5 minutes.
This mirrors Filemaker's mechanisms which extends the validity of tokens everytime they are used (with a maximum idle lifetime of 15 minutes).
If a token is invalidated while still stored in cache, the Exception is caught by the library and a single other attempt to authenticate and obtain a new token is done transparently by the library.
To define a custom TTL (and TTL extension duration), specify the token_ttl
when instanciating a FluentFMRepository
object.
This feature should not be used on shared hostings or servers on which you cannot ensure that your APCu is strictly yours
Troubleshooting
Error: SSL certificate problem: unable to get local issuer certificate
If you run into this error try adding 'client' => [ 'verify' => false ],
to the setup config, like so:
License
MIT License
Disclaimer
This project is an independent entity and has not been authorized, sponsored, or otherwise affiliated with FileMaker, Inc. FileMaker is a trademark of FileMaker, Inc., registered in the U.S. and other countries.
All versions of fluent-fm with dependencies
guzzlehttp/guzzle Version ^7.0.1
ext-json Version *
ramsey/uuid Version ^3.8 || ^4.0