コード例 #1
0
ファイル: resupdate.php プロジェクト: josf/folkso
 * Web interface for updating basic information about a resource by
 * repolling that resource.
 *
 * These functions are separated from resource.php because they use
 * the Curl libraries that do not usually need to be called.
 *
 * @package Folkso
 * @author Joseph Fahey
 * @copyright 2008 Gnu Public Licence (GPL)
 * @subpackage Tagserv
 */
require_once 'folksoUrl.php';
require_once 'folksoQuery.php';
$srv = new folksoServer(array('methods' => array('POST'), 'access_mode' => 'ALL'));
$srv->addResponseObj(new folksoResponse('post', array('required' => array('res')), 'reload'));
$srv->Respond();
/**
 * Given a resource, this function fetches that resource and updates
 * its status in the database if anything has changed, in particular
 * the title field.
 *
 * If the resource is no longer available (returns 404), the resource
 * is removed. Is this too radical?
 *
 */
function reload(folksoQuery $q, folksoWsseCreds $cred, folksoDBconnect $dbc)
{
    $i = new folksoDBinteract($dbc);
    if ($i->db_error()) {
        header('HTTP/1.0 501 Database connection error');
        die($i->error_info());