Skip to content

Instantly share code, notes, and snippets.

@melvincarvalho
Created July 15, 2009 11:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save melvincarvalho/147659 to your computer and use it in GitHub Desktop.
Save melvincarvalho/147659 to your computer and use it in GitHub Desktop.
if (preg_match('/^post$/i', $_SERVER['REQUEST_METHOD']))
{
// logger('/home/foaf/www/datawiki/post.log', $webid, $username);
include_once('arc/ARC2.php');
/* configuration */
$config = array(
// no config needed for now
);
/* instantiation */
$wiki = ARC2::getComponent('DataWikiPlugin', $config);
if ($_SERVER['HTTPS'] == 'on')
$foaf = 'https';
else
$foaf = 'http';
$foaf = $foaf . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
if ($q = @file_get_contents('php://input')) {
$ret = $wiki->go($webid, $foaf);
if (file_exists($ret))
{
$rdf = file_get_contents($ret);
if (strcmp($rdf,'')!=0)
{
//rdfLog('sparul', $username, $webid, $q, $rdf);
$sql = " update foaf set rdf = '$rdf' , rdf2 = '$rdf' where username like '$username' ";
$res = dbinsertquery($sql);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment