/**
* URL Router
*
- * Cheap wrapper around Net_URL_Mapper
+ * Cheap wrapper around URLMapper
*
* @category URL
* @package StatusNet
// The second of these is needed to make the link work correctly
// when inserted into the page. The first is needed to match the
- // route on the way in. Seems to be another Net_URL_Mapper bug to me.
+ // route on the way in. Seems to be another URLMapper bug to me.
$m->connect('search/notice/rss?q=:q', array('action' => 'noticesearchrss'),
array('q' => '.+'));
$m->connect('search/notice/rss', array('action' => 'noticesearchrss'));
}
$url = $this->m->generate($args, $params, $fragment);
- // Due to a bug in the Net_URL_Mapper code, the returned URL may
+ // Due to a bug in the URLMapper code, the returned URL may
// contain a malformed query of the form ?p1=v1?p2=v2?p3=v3. We
// repair that here rather than modifying the upstream code...
*
* Converts a path into a set of parameters, and vice versa
*
- * We used to use Net_URL_Mapper, so there's a wrapper class at Router, q.v.
+ * We used to use URLMapper, so there's a wrapper class at Router, q.v.
*
* NUM's vagaries are the main reason we have weirdnesses here.
*
/**
* Hook for RouterInitialized event.
*
- * @param Net_URL_Mapper $m path-to-action mapper
+ * @param URLMapper $m path-to-action mapper
* @return boolean hook return
*/
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
// Discovery actions
$m->connect('main/amcd.json',
/**
* Map URLs to actions
*
- * @param Net_URL_Mapper $m path-to-action mapper
+ * @param URLMapper $m path-to-action mapper
*
* @return boolean hook value; true means continue processing, false means stop.
*/
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect('main/train/spam',
array('action' => 'train', 'category' => 'spam'));
$action->script($this->adScript);
}
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect('panel/adsense',
array('action' => 'adsenseadminpanel'));
}
}
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect('main/autocomplete/suggest', array('action'=>'autocomplete'));
}
/**
* Hook for RouterInitialized event.
*
- * @param Net_URL_Mapper $m path-to-action mapper
+ * @param URLMapper $m path-to-action mapper
* @return boolean hook return
*/
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect('panel/bitly',
array('action' => 'bitlyadminpanel'));
/**
* Add our actions to the URL router
*
- * @param Net_URL_Mapper $m URL mapper for this hit
+ * @param URLMapper $m URL mapper for this hit
*
* @return boolean hook return
*/
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect('panel/blacklist', array('action' => 'blacklistadminpanel'));
return true;
/**
* Map URLs to actions
*
- * @param Net_URL_Mapper $m path-to-action mapper
+ * @param URLMapper $m path-to-action mapper
*
* @return boolean hook value; true means continue processing, false means stop.
*/
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect('blog/new',
array('action' => 'newblogentry'));
/**
* Map URLs to actions
*
- * @param Net_URL_Mapper $m path-to-action mapper
+ * @param URLMapper $m path-to-action mapper
*
* @return boolean hook value; true means continue processing, false means stop.
*/
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
if (common_config('singleuser', 'enabled')) {
$nickname = User::singleUserNickname();
}
}
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
if (common_logged_in()) {
$m->connect('plugins/ClientSideShorten/shorten', array('action'=>'shorten'));
/**
* Map URLs to actions
*
- * @param Net_URL_Mapper $m path-to-action mapper
+ * @param URLMapper $m path-to-action mapper
*
* @return boolean hook value; true means continue processing,
* false means stop.
*/
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect(
return true;
}
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
if (common_config('globalapi', 'enabled')) {
foreach (array('register', 'login', 'recover') as $method) {
/**
* Map URLs to actions
*
- * @param Net_URL_Mapper $m path-to-action mapper
+ * @param URLMapper $m path-to-action mapper
*
* @return boolean hook value; true means continue processing, false means stop.
*/
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect('main/event/new',
array('action' => 'newevent'));
*
* Hook for RouterInitialized event.
*
- * @param Net_URL_Mapper $m URL mapper
+ * @param URLMapper $m URL mapper
*
* @return boolean hook return
*/
/**
* Map URLs to actions
*
- * @param Net_URL_Mapper $m path-to-action mapper
+ * @param URLMapper $m path-to-action mapper
*
* @return boolean hook value; true means continue processing, false means stop.
*/
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
// Always add the admin panel route
$m->connect('panel/facebook', array('action' => 'facebookadminpanel'));
return true;
}
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect('main/photo/new', array('action' => 'newphoto'));
$m->connect('main/photo/:id', array('action' => 'showphoto'));
$schema->ensureTable('GNUsocialPhotoAlbum', GNUsocialPhotoAlbum::schemaDef());
}
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect(':nickname/photos', array('action' => 'photos'));
$m->connect(':nickname/photos/:albumid', array('action' => 'photos'));
$schema = Schema::get();
$schema->ensureTable('GNUsocialProfileExtensionField', GNUsocialProfileExtensionField::schemaDef());
$schema->ensureTable('GNUsocialProfileExtensionResponse', GNUsocialProfileExtensionResponse::schemaDef());
-
}
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect(':nickname/bio', array('action' => 'bio'));
$m->connect('admin/profilefields', array('action' => 'profilefieldsAdminPanel'));
return true;
}
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect('main/postvideo', array('action' => 'postvideo'));
$m->connect('showvideo/:id', array('action' => 'showvideo'));
/**
* Hook for RouterInitialized event.
*
- * @param Net_URL_Mapper $m path-to-action mapper
+ * @param URLMapper $m path-to-action mapper
* @return boolean hook return
*/
- function onRouterInitialized(Net_URL_Mapper $m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect('group/:nickname/favorited',
array('action' => 'groupfavorited'),
/**
* Hook for RouterInitialized event.
*
- * @param Net_URL_Mapper $m URL mapper
+ * @param URLMapper $m URL mapper
*
* @return boolean hook return
*/
*
* @return boolean event handler return
*/
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect(':nickname/all/map',
array('action' => 'allmap'),
*
* Hook for RouterInitialized event.
*
- * @param Net_URL_Mapper $m URL mapper
+ * @param URLMapper $m URL mapper
*
* @return boolean hook return
*/
/**
* Hook for RouterInitialized event.
*
- * @param Net_URL_Mapper $m path-to-action mapper
+ * @param URLMapper $m path-to-action mapper
* @return boolean hook return
*/
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
// Discovery actions
$m->connect('main/ostatustag',
class OfflineBackupPlugin extends Plugin
{
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect('main/backupaccount',
array('action' => 'offlinebackup'));
*
* Hook for RouterInitialized event.
*
- * @param Net_URL_Mapper $m URL mapper
+ * @param URLMapper $m URL mapper
*
* @return boolean hook return
*/
return true;
}
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect('panel/openx',
array('action' => 'openxadminpanel'));
<?php
+/**
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2011, StatusNet, Inc.
+ *
+ * PHP version 5
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @category OpportunisticQMPlugin
+ * @package StatusNet
+ * @author Brion Vibber <brion@status.net>
+ * @copyright 2011 StatusNet, Inc.
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
+ * @link http://status.net/
+ */
class OpportunisticQMPlugin extends Plugin {
public $qmkey = false;
public $secs_per_action = 1; // total seconds to run script per action
public $rel_to_pageload = true; // relative to pageload or queue start
- public function onRouterInitialized($m)
+ public function onRouterInitialized(URLMapper $m)
{
$m->connect('main/runqueue', array('action' => 'runqueue'));
}
/**
* Map URLs to actions
*
- * @param Net_URL_Mapper $m path-to-action mapper
+ * @param URLMapper $m path-to-action mapper
*
* @return boolean hook value; true means continue processing, false means stop.
*/
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect('main/poll/new',
array('action' => 'newpoll'));
/**
* Map URLs to actions
*
- * @param Net_URL_Mapper $m path-to-action mapper
+ * @param URLMapper $m path-to-action mapper
*
* @return boolean hook value; true means continue processing, false means stop.
*/
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$UUIDregex = '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}';
*
* @return boolean hook return
*/
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect('/main/rsscloud/request_notify',
array('action' => 'RSSCloudRequestNotify'));
/**
* Hook for RouterInitialized event.
*
- * @param Net_URL_Mapper $m path-to-action mapper
+ * @param URLMapper $m path-to-action mapper
* @return boolean hook return
*/
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect('main/channel/:channelkey/keepalive',
array('action' => 'keepalivechannel'),
*/
public $disallowLogin = false;
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect('main/confirmfirst/:code',
array('action' => 'confirmfirstemail'));
* action will be named 'FoobarAction', where action = 'foobar'. The class
* must be loaded in the onAutoload() method.
*
- * @param Net_URL_Mapper $m path-to-action mapper
+ * @param URLMapper $m path-to-action mapper
*
* @return boolean hook value; true means continue processing, false means stop.
*/
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect('main/hello',
array('action' => 'hello'));
/**
* Map URLs to actions
*
- * @param Net_URL_Mapper $m path-to-action mapper
+ * @param URLMapper $m path-to-action mapper
*
* @return boolean hook value; true means continue processing, false means stop.
*/
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect('search/:search/subscribe',
array('action' => 'searchsub'),
/**
* Map URLs to actions
*
- * @param Net_URL_Mapper $m path-to-action mapper
+ * @param URLMapper $m path-to-action mapper
*
* @return boolean hook value; true means continue processing, false means stop.
*/
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect('sitemapindex.xml',
array('action' => 'sitemapindex'));
/**
* Hook for RouterInitialized event.
*
- * @param Net_URL_Mapper $m path-to-action mapper
+ * @param URLMapper $m path-to-action mapper
* @return boolean hook return
*/
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect('favorited/:slice',
array('action' => 'favoritedslice'),
/**
* Hook for RouterInitialized event.
*
- * @param Net_URL_Mapper $m path-to-action mapper
+ * @param URLMapper $m path-to-action mapper
* @return boolean hook return
*/
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect('settings/mirror',
array('action' => 'mirrorsettings'));
/**
* Map URLs to actions
*
- * @param Net_URL_Mapper $m path-to-action mapper
+ * @param URLMapper $m path-to-action mapper
*
* @return boolean hook value; true means continue processing, false means stop.
*/
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect('tag/:tag/subscribe',
array('action' => 'tagsub'),
*
* Hook for RouterInitialized event.
*
- * @param Net_URL_Mapper $m path-to-action mapper
+ * @param URLMapper $m path-to-action mapper
*
* @return boolean hook return
*/
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect('panel/twitter', array('action' => 'twitteradminpanel'));
/**
* Add our actions to the URL router
*
- * @param Net_URL_Mapper $m URL mapper for this hit
+ * @param URLMapper $m URL mapper for this hit
*
* @return boolean hook return
*/
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect('main/flag/profile', array('action' => 'flagprofile'));
$m->connect('main/flag/clear', array('action' => 'clearflag'));
class WebFingerPlugin extends Plugin
{
- public function onRouterInitialized($m)
+ public function onRouterInitialized(URLMapper $m)
{
$m->connect('.well-known/host-meta', array('action' => 'hostmeta'));
$m->connect('.well-known/host-meta.:format',
/**
* Hook for RouterInitialized event.
*
- * @param Net_URL_Mapper $m path-to-action mapper
+ * @param URLMapper $m path-to-action mapper
* @return boolean hook return
*/
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect('panel/yammer',
array('action' => 'yammeradminpanel'));