*
* @param string $url URL to get content for
*/
-header('HTTP/1.0 500 Internal Server Error');
-header('Content-type: text/plain');
-
-require_once __DIR__ . '/../data/config.php';
-require_once 'stapibas/autoloader.php';
+require_once 'www-header.php';
if (!isset($_GET['url'])) {
header('HTTP/1.0 400 Bad Request');
*
* Has to be called via POST, url given in parameter "url".
*/
-header('HTTP/1.0 500 Internal Server Error');
-header('Content-type: text/plain');
-
-require_once __DIR__ . '/../data/config.php';
+require_once 'www-header.php';
if (!isset($_POST['url'])) {
header('HTTP/1.0 400 Bad Request');
}
-$db = new PDO($dbdsn, $dbuser, $dbpass);
$res = $db->query(
'SELECT f_id, f_needs_update FROM feeds WHERE f_url = ' . $db->quote($url)
);
--- /dev/null
+<?php
+namespace stapibas;
+header('HTTP/1.0 500 Internal Server error');
+header('Content-type: text/plain');
+
+require_once __DIR__ . '/../data/config.php';
+require_once 'stapibas/autoloader.php';
+
+$db = new PDO($dbdsn, $dbuser, $dbpass);
+$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
+?>
/**
* Simply stores all pingbacks in the database.
*/
-header('HTTP/1.0 500 Internal Server error');
-header('Content-type: text/plain');
-
-require_once __DIR__ . '/../data/config.php';
-require_once 'stapibas/autoloader.php';
-
-$db = new PDO($dbdsn, $dbuser, $dbpass);
-$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
+require_once 'www-header.php';
$s = new \PEAR2\Services\Linkback\Server();
$s->addCallback(new Linkback_DbStorage($db));