本文整理汇总了PHP中FileMaker类的典型用法代码示例。如果您正苦于以下问题:PHP FileMaker类的具体用法?PHP FileMaker怎么用?PHP FileMaker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FileMaker类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: Unpack
public function Unpack()
{
global $varChecker;
$path = $varChecker->getValue('path');
$zipper = new Zipper();
if ($zipper->IsZipFile($path)) {
$fmaker = new FileMaker();
$filename = substr($path, strrpos($path, '/') + 1);
$folderpath = str_replace($filename, '', $path);
$folderpath = $folderpath . 'resources/';
$fmaker->makeDirectory($folderpath, true);
$files = $zipper->Decompress($path, $folderpath);
$processedFiles = $this->saveFiles($files, $folderpath);
$savedFiles = $processedFiles['saved'];
$errorfiles = $processedFiles['error'];
} else {
//create files array with just one file
}
if (count($savedFiles) > 0) {
$result = array('success' => 'resourcesuploaded', 'files' => $savedFiles, 'errorfiles' => $errorfiles, 'folder' => $folderpath, 'rawcount' => count($files));
} else {
$result = array('error' => 'resourcesfailed', 'files' => $savedFiles, 'errorfiles' => $errorfiles, 'folder' => $folderpath, 'rawcount' => count($files));
}
return $result;
}
开发者ID:ruffen,项目名称:Pixcel-CMS,代码行数:25,代码来源:files.controller.php
示例2: handleDBError
function handleDBError($request_object, $s_system_status = '')
{
if (FileMaker::isError($request_object)) {
$request_error_code = $request_object->getCode();
if ($request_error_code != 401) {
// Errors:
// - The requested URL returned error: 404
// - Possible reasons: Access via PHP not enabled. Instant Web Publishing not enabled
// - The requested URL returned error: 401
// - Invalid Username and password
//
//echo date("Y-m-d")." Error: " . $request_object->getCode()." - ".$request_object->getMessage() . "\n";
redirect('/oops/' . $request_error_code);
//exit;
} else {
return $request_error_code;
}
} elseif ($s_system_status != '') {
if (strtolower($s_system_status) != 'live') {
// System Offline
unset($_SESSION["user"]);
redirect('/maintenance.php?status=offline');
exit;
}
}
}
开发者ID:richard-clifford,项目名称:FileMaker-PHP-API-Interface,代码行数:26,代码来源:FileMaker.php
示例3: fmEvaluate
function fmEvaluate($connection, $expression)
{
// If the specified database connection isn't valid...
if (!isset($connection)) {
$error_message = 'fmEvaluate failed. It looks like the database connection that was specified is invalid.';
die($error_message);
}
// Setup the Find All command against the FMWebFrame Interface layout.
$fm_request = $connection->newFindAllCommand('FMWebFrame');
// Create the "newPerformScriptCommand" request.
$fm_request = $connection->newPerformScriptCommand('FMWebFrame', 'FMWebFrame', "evaluate\n" . $expression);
// Execute the request.
$fm_result = $fm_request->execute();
// If there was an error...
if (FileMaker::isError($fm_result)) {
$error_message = 'fmExecuteSQL failed with error ' . $fm_result->code . '.';
die($error_message);
} else {
// Get the result.
$result_records = $fm_result->getRecords();
$result_record = $result_records[0];
}
// Convert the result into an associative array.
$result_array = array();
$result_array['Expression'] = $expression;
$result_array['Result'] = $result_record->getField('Result_Data');
return $result_array;
}
开发者ID:timdietrich,项目名称:fmwebframe,代码行数:28,代码来源:evaluate.php
示例4: foreach
function &execute()
{
$V21ffce5b = $this->_getCommandParams();
$this->_setSortParams($V21ffce5b);
$this->_setRangeParams($V21ffce5b);
$this->_setRelatedSetsFilters($V21ffce5b);
if (count($this->_findCriteria) || $this->_recordId) {
$V21ffce5b['-find'] = true;
} else {
$V21ffce5b['-findall'] = true;
}
if ($this->_recordId) {
$V21ffce5b['-recid'] = $this->_recordId;
}
if ($this->Vf951bdce) {
$V21ffce5b['-lop'] = $this->Vf951bdce;
}
foreach ($this->_findCriteria as $Vd1148ee8 => $Ve9de89b0) {
$V21ffce5b[$Vd1148ee8] = $Ve9de89b0;
}
$V0f635d0e = $this->_fm->_execute($V21ffce5b);
if (FileMaker::isError($V0f635d0e)) {
return $V0f635d0e;
}
return $this->_getResult($V0f635d0e);
}
开发者ID:timdietrich,项目名称:fmeasyweb,代码行数:26,代码来源:FindImpl.php
示例5: pushDocumentDataToFM
function pushDocumentDataToFM($original, $temp, $pkId)
{
global $fmOrderDB, $log;
/* TODO need to investigate why getRelatedRecords() Stopped Working */
$metaFind = $fmOrderDB->newFindCommand('[WEB] Project Meta Fields');
$metaFind->addFindCriterion('__pk_ID', '==' . $pkId);
$metaResults = $metaFind->execute();
if (FileMaker::isError($metaResults)) {
$errorTitle = "FileMaker Error";
$log->error("pushDocumentDataToFM - Failure to open " . $metaResults . " " . $metaResults->getMessage() . " " . $metaResults->getCode());
processError($metaResults->getMessage(), $metaResults->getErrorString(), "deliverableService.php", $pkId, $errorTitle);
exit;
}
$metaRelatedRecords = $metaResults->getRecords();
$metaRecord = $metaRelatedRecords[0];
$metaRecord->setField('Upload_Filename_Original_t', $original);
$metaRecord->setField("Upload_Filename_Temp_t", $temp);
$result = $metaRecord->commit();
if (FileMaker::isError($result)) {
$errorTitle = "FileMaker Error";
$log->error("pushDocumentDataToFM - Failure to open " . $metaResults . " " . $result->getMessage() . " " . $result->getCode());
processError($result->getMessage(), $result->getErrorString(), "deliverableService.php", $pkId, $errorTitle);
exit;
}
}
开发者ID:billtucker,项目名称:onweb,代码行数:25,代码来源:documentUploader.php
示例6: isError
/**
* Checks whether there is an error in the resource given.
*
* @author RichardC
* @since 1.0
*
* @version 1.6
*
* @param obj $request_object
*
* @return int
*/
public static function isError($request_object)
{
if (is_array($request_object) && preg_grep('/^([^*)]*)error([^*)]*)$/', array_keys($request_object))) {
foreach ($request_object as $key => $val) {
return (int) $val;
}
}
return FileMaker::isError($request_object) ? (int) $request_object->getCode() : 0;
}
开发者ID:richard-clifford,项目名称:FileMaker-PHP-API-Interface,代码行数:21,代码来源:class.fmdb.php
示例7: execute
function execute()
{
$commandParams = $this->_getCommandParams();
$commandParams['-findany'] = true;
$result = $this->_fm->_execute($commandParams);
if (FileMaker::isError($result)) {
return $result;
}
return $this->_getResult($result);
}
开发者ID:richard-clifford,项目名称:FileMaker-PHP-API-Interface,代码行数:10,代码来源:PerformScriptImpl.php
示例8: getErrorString
/**
* Returns the string representation of $this->code in the language
* currently set for PHP error messages in FileMaker Server Admin
* Console.
*
* You should call getMessage() in most cases, if you are not sure whether
* the error is a FileMaker Web Publishing Engine error with an error code.
*
* @return string Error description.
*/
function getErrorString()
{
// Default to English.
$lang = basename($this->_fm->getProperty('locale'));
if (!$lang) {
$lang = 'en';
}
static $strings = array();
if (empty($strings[$lang])) {
if (!@(include_once dirname(__FILE__) . '/Error/' . $lang . '.php')) {
include_once dirname(__FILE__) . '/Error/en.php';
}
$strings[$lang] = $__FM_ERRORS;
}
if (isset($strings[$lang][$this->getCode()])) {
return $strings[$lang][$this->getCode()];
}
return $strings[$lang][-1];
}
开发者ID:jgwiazdowski,项目名称:FMcallback,代码行数:29,代码来源:Error.php
示例9: execute
function execute()
{
$V21ffce5b = $this->_getCommandParams();
$V21ffce5b['-findany'] = true;
$V0f635d0e = $this->_fm->_execute($V21ffce5b);
if (FileMaker::isError($V0f635d0e)) {
return $V0f635d0e;
}
return $this->_getResult($V0f635d0e);
}
开发者ID:kolotoc,项目名称:filemaker-api,代码行数:10,代码来源:FindAnyImpl.php
示例10: getErrorString
/**
* Returns the string representation of $this->code in the language
* currently set for PHP error messages in FileMaker Server Admin
* Console.
*
* You should call getMessage() in most cases, if you are not sure whether
* the error is a FileMaker Web Publishing Engine error with an error code.
*
* @param int $code Error code
* @return string Error description.
*/
public function getErrorString($code)
{
// Default to English.
$lang = basename($this->_fm->getProperty('locale'));
if (!$lang) {
$lang = 'en';
}
if (empty(self::$strings[$lang])) {
if (file_exists(dirname(__FILE__) . '/Error/' . $lang . '.php')) {
$path = dirname(__FILE__) . '/Error/' . $lang . '.php';
} else {
$path = dirname(__FILE__) . '/Error/en.php';
}
$strings[$lang] = (require $path);
}
if (isset($strings[$lang][$code])) {
return $strings[$lang][$code];
}
return $strings[$lang][-1];
}
开发者ID:airmoi,项目名称:filemaker,代码行数:31,代码来源:FileMakerException.php
示例11: testMagicSet
/**
* @covers \airmoi\FileMaker\FileMaker::__set
*/
public function testMagicSet()
{
if ($GLOBALS['OFFICIAL_API']) {
return true;
}
$this->fm->logLevel = 5;
$this->assertEquals(5, $this->fm->getProperty('logLevel'));
try {
$this->fm->fakeVar = "Hello World";
} catch (FileMakerException $e) {
$this->assertTrue(FileMaker::isError($e));
}
}
开发者ID:airmoi,项目名称:filemaker,代码行数:16,代码来源:FileMakerTest.php
示例12: fmSearchResults
function fmSearchResults($searchArray, $searchLayout, $sortArray, $page)
{
// Grabs variables from outside the function
global $fm, $max, $querystring, $fmDefaultSortArray;
// Uses maximum and URL to tell page how many to skip.
$skip = ($page - 1) * $max;
// Create FileMaker_Command_CompoundFind object on layout to search
$compoundFind =& $fm->newCompoundFindCommand($searchLayout);
$compoundFindNum = 0;
$findreq =& $fm->newFindRequest($searchLayout);
// Create find requests on layout
foreach ($searchArray as $searchName => $searchCriteria) {
// adds find criteria
if (strpos($searchName, 'EXACT_') !== false) {
//If given keywords with "EXACT_" prefix, searches for exact match in field
$searchNameExact = str_replace("EXACT_", "", $searchName);
$findreq->addFindCriterion($searchNameExact, "=={$searchCriteria}");
} elseif ($searchName == "Work_Date_Begin") {
$findreq->addFindCriterion($searchName, ">{$searchCriteria}");
} elseif ($searchName == "page") {
} else {
$findreq->addFindCriterion($searchName, $searchCriteria);
}
$compoundFind->add($compoundFindNum, $findreq);
}
// Set Range
$compoundFind->setRange($skip, $max);
// Set sort order
$sorti = 1;
foreach ($sortArray as $sortName => $sortCriteria) {
if ($sortCriteria == "descend") {
$compoundFind->addSortRule($sortName, $sorti, FILEMAKER_SORT_DESCEND);
} else {
$compoundFind->addSortRule($sortName, $sorti, FILEMAKER_SORT_ASCEND);
}
$sorti++;
}
$defaultSortOrder = $fmDefaultSortArray[$searchLayout];
$compoundFind->addSortRule($defaultSortOrder, $sorti, FILEMAKER_SORT_ASCEND);
// Execute compound find command
$result = $compoundFind->execute();
if (FileMaker::isError($result)) {
echo "Error: " . $result->getMessage() . "<br>";
return null;
//exit;
} else {
$records = $result->getRecords();
return $records;
}
}
开发者ID:GSAPP-visualresources,项目名称:conf,代码行数:50,代码来源:fm-search.php
示例13: fmDisplaySearchResults
function fmDisplaySearchResults($result, $whetherToPaginate)
{
global $skip, $paginate_number, $max, $page, $querystring;
// If an error is found, return a message and exit.
if (FileMaker::isError($result)) {
echo "Error: " . $result->getMessage() . "<br>";
//exit;
} else {
// Get records from found set
$records = $result->getRecords();
$found = $result->getFoundSetCount();
//Setup sort by type
$fileType = $records[0]->getField('Source_Type');
if ($fileType != "Video") {
$fileType = "Images";
}
echo '<div class="recordSeparator">' . $fileType . '</div>';
foreach ($records as $record) {
//searchResultDisplay($record,$fileType);
if ($record->getField('Source_Type') == "Video") {
displayVideoPreview($record);
} else {
if ($fileType != "Images") {
echo '<p> </p><div class="recordSeparator">Images</div>';
}
displayImgPreview($record);
$fileType = "Images";
}
}
if ($whetherToPaginate) {
// adds pagination if specified. Disabled for "recent additions" mode.
?>
<div style="clear: both; padding-top: 20px; text-align: right;"><!--pagination div-->
<?php
//pagination
$displayed = count($records);
$pagenum = ceil($skip / $max + 1);
$pagetotal = ceil($found / $max);
if ($skip + $max > $found) {
$next = $skip;
}
echo "Displaying <b>{$displayed}</b> of <b>{$found}</b> results<br /><br />";
paginate($querystring, $page, $pagetotal);
?>
</div>
<?php
}
}
}
开发者ID:GSAPP-visualresources,项目名称:conf,代码行数:50,代码来源:fm-display-functions.php
示例14: FileMaker_Error
function &execute()
{
if (empty($this->_recordId)) {
$Vcb5e100e = new FileMaker_Error($this->_fm, 'Delete commands require a record id.');
return $Vcb5e100e;
}
$V21ffce5b = $this->_getCommandParams();
$V21ffce5b['-delete'] = true;
$V21ffce5b['-recid'] = $this->_recordId;
$V0f635d0e = $this->_fm->_execute($V21ffce5b);
if (FileMaker::isError($V0f635d0e)) {
return $V0f635d0e;
}
return $this->_getResult($V0f635d0e);
}
开发者ID:timdietrich,项目名称:fmeasyweb,代码行数:15,代码来源:DeleteImpl.php
示例15: FX_Fuzzy_Debugger
function FX_Fuzzy_Debugger(&$fmConnection, &$dataSet = '')
{
if ((bool) (is_object($fmConnection) && (strtolower(get_class($fmConnection)) == 'filemaker' || is_subclass_of($fmConnection, 'filemaker')))) {
require_once 'FileMaker.php';
$this->connectionType = FILEMAKER_API_CONNECTION;
$this->currentConnection = clone $fmConnection;
$this->currentDataSet = $dataSet;
if (FileMaker::isError($dataSet)) {
if (!isset($dataSet->code) || strlen(trim($dataSet->code)) < 1) {
$currentErrorMessage = "<p>A connection or XML error occured during your FileMaker query.<br />\n";
$currentErrorMessage .= "You may be able to get additional information by performing the same query using FX.php,<br />\n";
$currentErrorMessage .= "combined with a DEBUG constant and php's print_r() function.<br />\n";
$currentErrorMessage .= "Also, check your <strong>FileMaker Server Advanced configuration</strong>, and verify the <strong>server address</strong> used.</p>\n";
return $currentErrorMessage;
} else {
$this->currentErrorCode = $dataSet->code;
}
} else {
$this->currentErrorCode = 0;
}
$this->currentDatabase = $this->currentConnection->getProperty('database');
$this->currentLayout = '';
} elseif ((bool) (is_object($fmConnection) && (strtolower(get_class($fmConnection)) == 'fx' || is_subclass_of($fmConnection, 'fx')))) {
require_once 'FX.php';
$this->connectionType = FX_CONNECTION;
$this->currentConnection = clone $fmConnection;
if (is_array($dataSet) && isset($dataSet['errorCode'])) {
$this->currentErrorCode = $dataSet['errorCode'];
} else {
$this->currentErrorCode = $fmConnection->lastErrorCode;
}
$this->currentDatabase = $this->currentConnection->database;
$this->currentLayout = $this->currentConnection->layout;
foreach ($this->currentConnection->lastQueryParams as $tempParam) {
if (substr($tempParam['name'], 0, 1) != '-') {
// as long as the current field name doesn't begin with a '-' (FM reserved), add it to the list of fields
$this->currentFieldsArray[] = $tempParam['name'];
}
}
} else {
$currentErrorMessage = "<p>The FX Fuzzy Debugger does not support the type of connection that was passed in.<br />\n";
$currentErrorMessage .= "Double check that the first parameter is either an FX object or a FileMaker object.</p>\n";
$this->fuzzyOut = $currentErrorMessage;
return;
}
$this->fuzzyOut = $this->ProcessErrorCode();
}
开发者ID:SmartPCGuy,项目名称:fxphp,代码行数:47,代码来源:FX_Fuzzy_Debugger.php
示例16: execute
function execute()
{
$V090cbceb = null;
$V8ac10dab = 0;
$V31c3c8cf = 0;
$V40677621 = 1;
$Ve2942a04 = 1;
$V21ffce5b = $this->_getCommandParams();
$this->_setSortParams($V21ffce5b);
$this->_setRangeParams($V21ffce5b);
$this->_setRelatedSetsFilters($V21ffce5b);
ksort($this->Vad2bfd5a);
$V31c3c8cf = count($this->Vad2bfd5a);
foreach ($this->Vad2bfd5a as $V70a17ffa => $V9a7aa128) {
$V15c46c6e = $V9a7aa128->_impl->_findCriteria;
$V8ac10dab = count($V15c46c6e);
$V090cbceb = $V090cbceb . '(';
$V4111477f = 0;
foreach ($V15c46c6e as $Vd1148ee8 => $Ve9de89b0) {
$V21ffce5b['-q' . $Ve2942a04] = $Vd1148ee8;
$V21ffce5b['-q' . $Ve2942a04 . '.' . "value"] = $Ve9de89b0;
$V090cbceb = $V090cbceb . 'q' . $Ve2942a04;
$Ve2942a04++;
$V4111477f++;
if ($V4111477f < $V8ac10dab) {
$V090cbceb = $V090cbceb . ',';
}
}
$V090cbceb = $V090cbceb . ")";
$V40677621++;
if ($V40677621 <= $V31c3c8cf) {
$V4b22ce92 = $this->Vad2bfd5a[$V40677621];
if ($V4b22ce92->_impl->_omit == true) {
$V090cbceb = $V090cbceb . ';!';
} else {
$V090cbceb = $V090cbceb . ';';
}
}
}
$V21ffce5b['-query'] = $V090cbceb;
$V21ffce5b['-findquery'] = true;
$V0f635d0e = $this->_fm->_execute($V21ffce5b);
if (FileMaker::isError($V0f635d0e)) {
return $V0f635d0e;
}
return $this->_getResult($V0f635d0e);
}
开发者ID:kolotoc,项目名称:filemaker-api,代码行数:47,代码来源:CompoundFindImpl.php
示例17: getRespondentRecordFromRespondentID
/**
* この関数は、$respondent_id 経由で渡された値を使用して、'Respondent' レイアウト上で検索を実行します。
* 見つかった場合には、最初に一致したレコードを返します。その他の場合は、null を返します。
*/
function getRespondentRecordFromRespondentID($respondent_id)
{
global $fm;
//レイアウトを指定
$find = $fm->newFindCommand('Respondent');
//フィールドおよび一致する値を指定します。 この場合は、'Respondent ID' がフィールドで、
// $respondent_id が値です。
$find->addFindCriterion('Respondent ID', $respondent_id);
//検索の実行
$results = $find->execute();
//エラーをチェック
if (!FileMaker::isError($results)) {
//エラーなし、最初に一致した結果を返す
$records = $results->getRecords();
return $records[0];
} else {
//エラーがあった。null を返す (つまり、一致は見つからなかった)
return null;
}
}
开发者ID:rjakes,项目名称:SimpleFM,代码行数:24,代码来源:dbaccess.php
示例18: getRespondentRecordFromRespondentID
/**
* Den här funktionen utför en sökning i layouten 'Respondent' med hjälp av det värde som
* skickas via $respondent_id. Om det hittas, returneras den första matchande posten. Annars returneras noll.
*/
function getRespondentRecordFromRespondentID($respondent_id)
{
global $fm;
//Ange layout
$find = $fm->newFindCommand('Respondent');
//Ange fält och värde för matchning. I det här fallet är fältet 'Respondent ID'
// och värdet är $respondent_id.
$find->addFindCriterion('Respondent ID', $respondent_id);
//Utför sökningen
$results = $find->execute();
//Felkontroll
if (!FileMaker::isError($results)) {
//Inga fel, returnera första matchande resultat.
$records = $results->getRecords();
return $records[0];
} else {
//Det fanns fel, returnera noll (dvs inga matchningar hittades)
return null;
}
}
开发者ID:rjakes,项目名称:SimpleFM,代码行数:24,代码来源:dbaccess.php
示例19: getRespondentRecordFromRespondentID
/**
* Die Fkt. führt eine Suche im Layout 'Respondent' mit dem über $respondent_id
* übergeb. Wert durch. Wenn vorh., wird 1. entspr. Datens. zurückg., sonst null.
*/
function getRespondentRecordFromRespondentID($respondent_id)
{
global $fm;
//Layout angeben
$find = $fm->newFindCommand('Respondent');
//Geben Sie das Feld und den Wert für den Abgleich an. In diesem Fall ist 'Respondent ID' das Feld
// und $respondent_id der Wert.
$find->addFindCriterion('Respondent ID', $respondent_id);
//Suche durchführen
$results = $find->execute();
//Auf Fehler überprüfen
if (!FileMaker::isError($results)) {
//Keine Fehler, erstes entsprechendes Ergebnis zurückgeben
$records = $results->getRecords();
return $records[0];
} else {
//Fehler aufgetreten, null zurückgeben (d. h. keine Datensätze gefunden)
return null;
}
}
开发者ID:rjakes,项目名称:SimpleFM,代码行数:24,代码来源:dbaccess.php
示例20: getRespondentRecordFromRespondentID
/**
* Questa funzione esegue una ricerca sul formato 'Respondent' con il valore passato
* attraverso $respondent_id e restituisce il primo record corrispondente, altrimenti restituisce zero.
*/
function getRespondentRecordFromRespondentID($respondent_id)
{
global $fm;
//Specificare il formato
$find = $fm->newFindCommand('Respondent');
//Specificare il campo e il valore da confrontare. In questo caso, 'Respondent ID' è il campo
// e $respondent_id è il valore.
$find->addFindCriterion('Respondent ID', $respondent_id);
//Eseguire la ricerca
$results = $find->execute();
//Verificare che non vi siano errori
if (!FileMaker::isError($results)) {
//Nessun errore, restituire il primo risultato corrispondente
$records = $results->getRecords();
return $records[0];
} else {
//Errore, restituire zero (ossia nessuna corrispondenza trovata)
return null;
}
}
开发者ID:rjakes,项目名称:SimpleFM,代码行数:24,代码来源:dbaccess.php
注:本文中的FileMaker类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论