rjakes/rjakessimplefm
Composer 安装命令:
composer require rjakes/rjakessimplefm
包简介
Wrapper for soliantconsulting/simplefm
关键字:
README 文档
README
Wrapper/facade that extends Jeremiah Small's SimpleFM class for communicating with FileMaker Server:
https://github.com/soliantconsulting/SimpleFM
This class is a convenience wrapper to SimpleFM that offers quick and easy CRUD operations, as well as a very easy method to execute FileMaker scripts from PHP. It's helpful for programmers that don't want or need to build out the query parameters that the FileMaker Web Pushinging Engine requires.
Author Roger Jacques - roger@rjakes.com
System Requirements
- PHP 5.3+
- FileMaker Server 12+
Quickstart via Trivial Examples
The quickstart files below will work with the FMServer_Example file that installs with FileMaker Server, and, they will work with fuelPHP without modification. The best way to get the required classes is to add an entry to the composer.json file that you will find at the root of your project folder after creating a new fuelPHP project.
"require": {
"php": ">=5.3.3",
"composer/installers": "~1.0",
"fuel/docs": "1.7.2",
"fuel/core": "1.7.2",
"fuel/auth": "1.7.2",
"fuel/email": "1.7.2",
"fuel/oil": "1.7.2",
"fuel/orm": "1.7.2",
"fuel/parser": "1.7.2",
"fuelphp/upload": "2.0.1",
"monolog/monolog": "1.5.*",
"michelf/php-markdown": "1.4.0",
"rjakes/rjakessimplefm": "dev-master"
},
Then, from your project directory, run:
composer.phar update
These examples will work in any project or framework that can load the required classes, with minimal modification (the controller below has a bit of fuelPHP specific code.)
Base Model
<?php
/*
* This is a base model that exists in a single location to instantiate
* the connection to FileMaker.
* All other models are extended from this model.
*
* There are other ways to instantiate an object, and if you understand them
* then you probably don't need a quickstart from me.
*/
namespace Model;
use \rjakes\RjakesSimpleFM\Facade;
class BaseModel {
public $fmpConn = FALSE;
public function __construct()
{
$hostParams = array(
'hostname' => '127.0.0.1',
'dbname' => 'FMServer_Sample',
'username' => 'admin',
'password' => '');
$this->fmpConn = new Facade($hostParams);
}
}
Model
<?php
/**
* This model extends the base class and the database connection.
*
**/
namespace Model;
use \Model\BaseModel;
class Language extends BaseModel {
public function __construct()
{
// don't forget to call the parent constructor
// else you will not get your connection object
parent::__construct();
// Set a default layout for this model, this can be overridden as needed.
// The layout is a required parameter for all database interactions,
// it sets the context, controling which table is queried,
// dictating which fields are available for querying and which are
// returned.
$this->fmpConn->setDefaultLayoutName('PHP Technology Test');
}
public function getStrings($language)
{
$language = 'SAMPLE_' . $language;
$this->fmpConn->addWhereCriteria('LANGUAGE MATCH FIELD', $language, 'eq');
// use the default layout that was set in the constructor of this class
$result = $this->fmpConn->select();
return $result;
}
}
Controller
<?php
/**
* This is a fuelPHP controller, provided just to make the example complete.
* There is nothing here that is specific to RjakesSimpleFM
*/
use \Model\Language;
class Controller_Example extends Controller
{
public $language = FALSE;
public function before()
{
$this->language = new Language(); // grab an instance of the model
}
public function action_index()
{
$results['data']['getLanguage'] = $this->language->getStrings('German');
return Response::forge(View::forge('welcome/index', $results));
}
The Response
// Here is what you get back from the model method call in the above controller.
// This structure is provided by SimpleFM.
Array
(
[getLanguage] => Array
(
[url] => http://admin:[...]@192.168.0.11:80/fmi/xml/fmresultset.xml?-db=FMServer_Sample&-lay=PHP Technology Test&LANGUAGE+MATCH+FIELD=SAMPLE_German&LANGUAGE+MATCH+FIELD.op=eq&-find
[error] => 0
[errortext] => No error
[errortype] => FileMaker
[count] => 20
[fetchsize] => 20
[rows] => Array
(
[0] => Array
(
[index] => 0
[recid] => 399
[modid] => 13
[LANGUAGE MATCH FIELD] => SAMPLE_German
[Task Name Sample] => Sitemap-Skizze
[Task Start Date Sample] => 03/19/2014
[Task Due Date Sample] => 05/02/2014
[Task Completion Percentage Sample] => 80
)
[1] => Array
(
[index] => 1
[recid] => 400
[modid] => 13
[LANGUAGE MATCH FIELD] => SAMPLE_German
[Task Name Sample] => Grafiken an Anbieter senden
[Task Start Date Sample] => 04/04/2014
[Task Due Date Sample] => 04/05/2014
[Task Completion Percentage Sample] => 0
)
)
)
)
License
RjakesSimpleFM is free for commercial and non-commercial use, licensed under the business-friendly standard MIT license.
rjakes/rjakessimplefm 适用场景与选型建议
rjakes/rjakessimplefm 是一款 基于 TeX 开发的 Composer 扩展包,目前已累计 77 次下载、GitHub Stars 达 1, 最近一次更新时间为 2014 年 07 月 24 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「adapter」 「FileMaker」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 rjakes/rjakessimplefm 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 rjakes/rjakessimplefm 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 rjakes/rjakessimplefm 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Adapter designed to add Framework Agnosticism for Caching within PHP Packages.
flysystem cache Adapter
Virtual Filesystem Storage Adapter for Laravel
A simple interface for composite Flysystem adapters
FileMaker Server XML API Adapter
A filemaker wrapper for laravel
统计信息
- 总下载量: 77
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-07-24