本文整理汇总了PHP中Graph::append方法的典型用法代码示例。如果您正苦于以下问题:PHP Graph::append方法的具体用法?PHP Graph::append怎么用?PHP Graph::append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Graph
的用法示例。
在下文中一共展示了Graph::append方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: httpStatusExit
if ($_input == 'raw') {
require_once 'if-match.php';
file_put_contents($_filename, $_data, FILE_APPEND | LOCK_EX);
httpStatusExit(201, 'Created');
}
$g = new Graph('', $_filename, '', $_base);
require_once 'if-match.php';
if ($_method == 'PATCH') {
if ($_input == 'json' && ($g->patch_json($_data) || 1)) {
librdf_php_last_log_level() && httpStatusExit(400, 'Bad Request', null, librdf_php_last_log_message());
$g->save();
header('Triples: ' . $g->size());
header("Link: <" . dirname($_base) . '/' . $metafile . ">; rel=meta", false);
header('Location: ' . $ldp_location);
httpStatusExit(201, 'Created');
}
} elseif (!empty($_input) && ($g->append($_input, $_data) || 1)) {
librdf_php_last_log_level() && httpStatusExit(400, 'Bad Request', null, librdf_php_last_log_message());
$g->save();
header("Triples: " . $g->size(), false);
header("Link: <" . $_base . $metafile . ">; rel=meta", false);
header('Location: ' . $ldp_location);
header('ETag: "' . md5_file($_filename) . '"');
httpStatusExit(201, 'Created');
} elseif ($_content_type == 'application/sparql-update') {
require_once 'SPARQL.php';
} else {
librdf_php_last_log_level() && httpStatusExit(400, 'Bad Request', null, librdf_php_last_log_message());
header('Accept-Post: ' . implode(',', $_content_types));
httpStatusExit(406, 'Content-Type (' . $_content_type . ') Not Acceptable');
}
示例2: header
$contents = $contents_chunks[$p - 1];
$complement = '?p=' . (string) $p;
}
// add paging headers
// set last page
header("Link: <" . $_base . "?p=" . (string) $pages . ">; rel='last'", false);
if ($p > 1) {
header("Link: <" . $_base . "?p=" . (string) ($p - 1) . ">; rel='prev'", false);
}
if ($p < $pages) {
header("Link: <" . $_base . "?p=" . (string) ($p + 1) . ">; rel='next'", false);
header("HTTP/1.1 333 Returning Related", false, 333);
}
// List LDPC info
$ldpc = "@prefix ldp: <http://www.w3.org/ns/ldp#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix p: <http://www.w3.org/ns/posix/stat#> ." . "<" . $_base . "> a ldp:Container, ldp:BasicContainer, p:Directory ; " . "p:mtime " . filemtime($_filename) . " ;" . "p:size " . filesize($_filename) . " ;";
$g->append('turtle', $ldpc);
// add extra LDPC metadata from .meta.<LDPC>
$meta_uri = dirname($_base) . '/.meta.' . basename($_base);
$meta_file = dirname($_filename) . '/.meta.' . basename($_filename);
$mg = new Graph('', $meta_file, '', $meta_uri);
if ($mg->size() > 0) {
// specific authorization
$q = 'SELECT * WHERE { <' . $_base . '> ?p ?o }';
$s = $mg->SELECT($q);
$res = $s['results']['bindings'];
if (isset($res) && count($res) > 0) {
foreach ($res as $t) {
$g->append_objects($_base, $t['p']['value'], array($t['o']));
}
}
}
示例3: httpStatusExit
httpStatusExit(403, 'Forbidden');
}
}
// check quota
if (check_quota($_root, $_SERVER["CONTENT_LENGTH"]) == false) {
httpStatusExit(507, 'Insufficient Storage');
}
// action
$d = dirname($_filename);
if (!file_exists($d)) {
mkdir($d, 0777, true);
}
$_data = file_get_contents('php://input');
if ($_input == 'raw') {
require_once 'if-match.php';
file_put_contents($_filename, $_data);
httpStatusExit(201, 'Created');
}
$g = new Graph('', $_filename, '', $_base);
require_once 'if-match.php';
$g->truncate();
if (!empty($_input) && $g->append($_input, $_data)) {
librdf_php_last_log_level() && httpStatusExit(400, 'Bad Request', null, librdf_php_last_log_message());
$g->save();
header('ETag: "' . md5_file($_filename) . '"');
httpStatusExit(201, 'Created');
} else {
librdf_php_last_log_level() && httpStatusExit(400, 'Bad Request', null, librdf_php_last_log_message());
header('Accept-Post: ' . implode(',', $_content_types));
httpStatusExit(406, 'Content-Type (' . $_content_type . ') Not Acceptable');
}