return parent::arg($arg, $def);
}
- function prepare($args)
+ protected function prepare($args)
{
StatusNet::setApi(true); // reduce exception reports to aid in debugging
return parent::prepare($args);
}
- function handle()
+ protected function handle()
{
$mode = $this->trimmed('hub.mode');
switch ($mode) {
throw new ClientException(sprintf(_m('Invalid hub.secret "%s". It must be under 200 bytes.'),$secret));
}
- $sub = HubSub::staticGet($topic, $callback);
+ $sub = HubSub::getByHashkey($topic, $callback);
if (!$sub) {
// Creating a new one!
$sub = new HubSub();
$groupFeed = common_local_url('ApiTimelineGroup', $params);
if ($feed == $userFeed) {
- $user = User::staticGet('id', $id);
+ $user = User::getKV('id', $id);
if (!$user) {
// TRANS: Client exception. %s is a feed URL.
throw new ClientException(sprintt(_m('Invalid hub.topic "%s". User does not exist.'),$feed));
}
}
if ($feed == $groupFeed) {
- $user = User_group::staticGet('id', $id);
+ $user = User_group::getKV('id', $id);
if (!$user) {
// TRANS: Client exception. %s is a feed URL.
throw new ClientException(sprintf(_m('Invalid hub.topic "%s". Group does not exist.'),$feed));
$listFeed = common_local_url('ApiTimelineList', $params);
if ($feed == $listFeed) {
- $list = Profile_list::staticGet('id', $id);
- $user = User::staticGet('id', $user);
+ $list = Profile_list::getKV('id', $id);
+ $user = User::getKV('id', $user);
if (!$list || !$user || $list->tagger != $user->id) {
// TRANS: Client exception. %s is a feed URL.
- throw new ClientException(sprintf(_m('Invalid hub.topic %s; people tag does not exist.'),$feed));
+ throw new ClientException(sprintf(_m('Invalid hub.topic %s; list does not exist.'),$feed));
} else {
return true;
}
$url = $this->arg($arg);
$params = array('domain_check' => false, // otherwise breaks my local tests :P
'allowed_schemes' => array('http', 'https'));
- if (Validate::uri($url, $params)) {
+ $validate = new Validate;
+ if ($validate->uri($url, $params)) {
return $url;
} else {
// TRANS: Client exception.
*/
protected function getSub($feed, $callback)
{
- return HubSub::staticGet($feed, $callback);
+ return HubSub::getByHashkey($feed, $callback);
}
}