.DS_Store
nbproject
*.mo
-
+*log*
+htaccess-sample
+installer.txt
+extlib/DB.php
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
// Throws exception on error
$ptag = Profile_tag::setTag($this->user->id, $this->tagged->id,
* @return boolean false if user doesn't exist
*
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
$nickname = $this->trimmed('nickname');
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
* Check whether the credentials are valid and output the result
*
* @param array $args $_REQUEST data (unused)
- *
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
*
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
* @return boolean success flag
*
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
$this->user = $this->getTargetUser($this->arg('id'));
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
$_SERVER['REQUEST_METHOD'] == 'HEAD') {
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
$this->showMessages();
*
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
* @return boolean success flag
*
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
*
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
return true;
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean is_read-only=false
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return false;
}
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
$this->prev_cursor) = Profile_list::getAtCursor($fn, array($this->auth_user), $cursor, $count);
}
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return false;
}
{
var $list = null;
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
return true;
}
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
*
* @return boolean false
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return false;
}
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
*
* @return boolean success
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
common_debug("In apisearchatom handle()");
*
* @return boolean true if nothing goes wrong
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
$this->showResults();
*
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return ($_SERVER['REQUEST_METHOD'] == 'GET' || $_SERVER['REQUEST_METHOD'] == 'HEAD');
}
*
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
* @return boolean success flag
*
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
$this->showTimeline();
*
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
* @return boolean success flag
*
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
$this->showTimeline();
*
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return ($_SERVER['REQUEST_METHOD'] == 'GET' || $_SERVER['REQUEST_METHOD'] == 'HEAD');
}
*
* @return boolean false if user doesn't exist
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
return true;
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
$this->showTrends();
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
/**
* Prepare to run
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
/**
* Prepare to run
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
$cur = common_current_user();
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
$_SERVER['REQUEST_METHOD'] == 'HEAD') {
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
$_SERVER['REQUEST_METHOD'] == 'HEAD') {
*
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
if ($_SERVER['REQUEST_METHOD'] == 'DELETE') {
return false;
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return $_SERVER['REQUEST_METHOD'] != 'POST';
}
*
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
common_redirect($url, 302);
}
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
if (!parent::prepare($args)) {
return false;
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if ($this->arg('no')) {
{
var $page = null;
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
/**
* Prepare to run
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
if (!common_logged_in()) {
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return false;
}
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
if (!parent::prepare($args)) {
return false;
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
* @fixme merge common setup code with other group actions
* @fixme allow group admins to delete their own groups
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
var $profile = null;
var $user_profile = null;
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
return true;
}
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
if (!parent::prepare($args)) {
return false;
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if ($this->arg('no')) {
var $filename = null;
var $title = null;
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return nothing
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
$this->showPage();
*
* @return boolean read-only flag (false)
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
/**
* Prepare to run
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
* Prepare to run
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
{
var $page = null;
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
$this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
}
}
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
// @todo XXX: Documentation missing.
class FoafAction extends Action
{
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
return true;
}
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
// @todo XXX: Documentation missing.
class FoafGroupAction extends Action
{
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
return true;
}
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
var $lon = null;
var $location = null;
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
$token = $this->trimmed('token');
* @return nothing
*
*/
- function handle($args)
+ function handle(array $args=array())
{
header('Content-Type: application/json; charset=utf-8');
$location_object = array();
*
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
if (!parent::prepare($args)) {
return false;
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
if (!common_logged_in()) {
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
*
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
common_redirect($this->group->homeUrl(), 303);
}
{
var $page = null;
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
{
var $page = null;
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
var $page = null;
var $profile = null;
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
}
}
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
$this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
return true;
}
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
$this->showPage();
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
if (!common_logged_in()) {
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
return;
}
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return false;
}
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
if (!common_config('invite', 'enabled')) {
*
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return false;
}
*
* @return nothing
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
if (!common_logged_in()) {
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
if (!common_logged_in()) {
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
*
* @return nothing
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
print $user->nickname . ': ' . $notice->content;
}
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*/
class NewgroupAction extends FormAction
{
+ protected $group;
+
+ function getGroup() {
+ return $this->group;
+ }
+
function title()
{
// TRANS: Title for form to create a group.
{
protected $q = null;
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
return true;
}
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
$this->notices = $this->getNotices();
return null;
}
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return nothing
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
}
}
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
{
var $page = 0;
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
$this->page = ($this->arg('page')) ? ($this->arg('page') + 0) : 1;
var $page = null;
var $oauth_token = null;
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
$this->oauth_token = $this->arg('oauth_token');
*
* @return boolean false if user doesn't exist
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
$type = $this->trimmed('type');
$this->endXML();
}
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
var $returnto;
var $lt;
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
return true;
}
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
var $page = null;
var $tag = null;
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
}
}
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
$this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
return true;
}
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
$this->showPage();
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
- //common_log(LOG_DEBUG, 'Autocomplete data: ' . json_encode($this->tags));
+ //common_debug('Autocomplete data: ' . json_encode($this->tags));
if ($this->tags) {
print(json_encode($this->tags));
exit(0);
var $peopletag = null;
var $tagger = null;
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
$this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
}
}
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
$this->showPage();
var $tagger = null;
var $tags = null;
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
}
}
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
return true;
}
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
- # Post from the tag dropdown; redirect to a GET
+ // Post from the tag dropdown; redirect to a GET
- if ($_SERVER['REQUEST_METHOD'] == 'POST') {
- common_redirect(common_local_url('peopletagsbyuser', $this->getSelfUrlArgs()), 303);
- }
+ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
+ common_redirect(common_local_url('peopletagsbyuser', $this->getSelfUrlArgs()), 303);
+ }
$this->showPage();
}
var $page = null;
var $tagged = null;
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
}
}
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
return true;
}
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
$this->showPage();
var $peopletag = null;
var $tagger = null;
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
$this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
}
}
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
$this->showPage();
var $page = null;
var $profile = null;
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
}
}
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
return true;
}
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
$this->showPage();
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
$key = 'disable-' . $this->plugin;
Config::save('plugins', $key, $this->overrideValue());
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
$this->msg = null;
*
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
common_redirect($this->peopletag->homeUrl(), 303);
}
var $notice;
var $userProfile = null;
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean success value
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
$this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
* @param array $args Arguments from $_REQUEST
* @return boolean success
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
$this->notices = $this->getNotices($this->limit);
// nop
}
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*/
class PublictagcloudAction extends Action
{
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
$this->elementEnd('div');
}
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
$this->showPage();
// This should probably be cached rather than recalculated
$tags = new Notice_tag();
- #Need to clear the selection and then only re-add the field
- #we are grouping by, otherwise it's not a valid 'group by'
- #even though MySQL seems to let it slide...
+ /*
+ * Need to clear the selection and then only re-add the field
+ * we are grouping by, otherwise it's not a valid 'group by'
+ * even though MySQL seems to let it slide...
+ */
$tags->selectAdd();
$tags->selectAdd('tag');
- #Add the aggregated columns...
+ // Add the aggregated columns...
$tags->selectAdd('max(notice_id) as last_notice_id');
$calc = common_sql_weight('created', common_config('tag', 'dropoff'));
$cutoff = sprintf("notice_tag.created > '%s'",
*
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return nothing
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
$xrdsOutputter = new XRDSOutputter();
var $msg = null;
var $success = null;
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
if (common_logged_in()) {
* @return boolean read-only flag (false)
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return nothing
*/
- function handle($args)
+ function handle(array $args=array())
{
common_redirect(common_local_url($this->arg('nextAction'), $this->arg('args')));
}
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
* @param $args
* @return string title
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
$this->code = $this->trimmed('code');
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
// Throws exception on error
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
$this->showPage();
$this->elementEnd('div');
}
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
{
var $user = null;
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
$nickname = $this->trimmed('nickname');
return $profile->avatarUrl(AVATAR_PROFILE_SIZE);
}
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return false;
}
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
if (!parent::prepare($args)) {
return false;
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
if (Event::handle('StartRobotsTxt', array($this))) {
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return nothing
*/
- function handle($args)
+ function handle(array $args=array())
{
header('Content-Type: application/rsd+xml');
*
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
if (!parent::prepare($args)) {
return false;
*
* @return success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
*
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
return true;
}
- function handle($args)
+ function handle(array $args=array())
{
$this->showPage();
}
$this->elementEnd('ul');
}
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
{
var $notice, $tagger, $peopletag, $userProfile;
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
return true;
}
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
if (!parent::prepare($args)) {
return false;
{
var $profile = null;
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
return true;
}
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
// Throws exception on error
/**
* Prepare to run
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
// @todo FIXME: documentation needed.
class SupAction extends Action
{
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
return $updates;
}
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
}
}
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
{
var $tag;
- function prepare($args) {
+ function prepare(array $args=array()) {
parent::prepare($args);
$tag = common_canonical_tag($this->trimmed('tag'));
$this->tag = Notice_tag::getKV('tag', $tag);
return $c;
}
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*/
class UnblockAction extends ProfileFormAction
{
- function prepare($args)
+ function prepare(array $args=array())
{
if (!parent::prepare($args)) {
return false;
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
if (!parent::prepare($args)) {
return false;
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
if (!parent::prepare($args)) {
return false;
*/
class UnsubscribeAction extends Action
{
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
if (!common_logged_in()) {
* Prepare to run
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
*
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
{
var $tag = null;
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
$nickname = $this->trimmed('nickname');
parent::initRss($limit);
}
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
public static function deleteFromProfile(Profile $target, $original=true) {
try {
$avatars = self::getProfileAvatars($target);
+
foreach ($avatars as $avatar) {
+ assert($avatar instanceof Avatar);
+
if ($avatar->original && !$original) {
continue;
}
+
$avatar->delete();
}
} catch (NoAvatarException $e) {
}
$size = "{$width}x{$height}";
+
if (!isset(self::$_avatars[$target->id])) {
self::$_avatars[$target->id] = array();
} elseif (isset(self::$_avatars[$target->id][$size])){
}
$avatar = null;
+
if (Event::handle('StartProfileGetAvatar', array($target, $width, &$avatar))) {
$avatar = self::pkeyGet(
array(
'height' => $height,
)
);
+
Event::handle('EndProfileGetAvatar', array($target, $width, &$avatar));
}
}
if ($path[0] != '/') {
- $path = '/'.$path;
+ $path = '/' . $path;
}
$server = common_config('avatar', 'server');
try {
return self::byProfile($target, $width, $height)->displayUrl();
} catch (Exception $e) {
+ common_debug(sprintf('target=>id=%s,width=%s,height=%s,message=%s',
+ $target->id,
+ $width,
+ $height,
+ $e->getMessage()
+ ));
return self::defaultImage($width);
}
}
static $sizenames = array(AVATAR_PROFILE_SIZE => 'profile',
AVATAR_STREAM_SIZE => 'stream',
AVATAR_MINI_SIZE => 'mini');
- return Theme::path('default-avatar-'.$sizenames[$size].'.png');
+ return Theme::path('default-avatar-' . $sizenames[$size] . '.png');
}
static function newSize(Profile $target, $width) {
} else {
$msg = sprintf("DB query (%0.3fs): %s", $delta, $clean);
}
- common_log(LOG_DEBUG, $msg);
+ common_debug($msg);
}
if ($fail) {
* Record the given set of hash tags in the db for this notice.
* Given tag strings will be normalized and checked for dupes.
*/
- function saveKnownTags($hashtags)
+ function saveKnownTags(array $hashtags)
{
//turn each into their canonical tag
//this is needed to remove dupes before saving e.g. #hash.tag = #hashtag
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php?p=$1 [L,QSA]
+<<<<<<< HEAD
## You can also use PATHINFO by using this RewriteRule instead:
# RewriteRule (.*) index.php/$1 [L,QSA]
# Use this instead for Apache >2.4 (mod_authz_host)
# Require all denied
</FilesMatch>
+=======
+</IfModule>
+
+<FilesMatch "\.(ini)">
+ Order allow,deny
+</FilesMatch>
+
+>>>>>>> Adding htaccess.sample back*shame*
--- /dev/null
+<?php
+
+/**
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2009-2010, StatusNet, Inc.
+ *
+ * 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 Installation
+ * @package Installation
+ *
+ * @author Adrian Lang <mail@adrianlang.de>
+ * @author Brenda Wallace <shiny@cpan.org>
+ * @author Brett Taylor <brett@webfroot.co.nz>
+ * @author Brion Vibber <brion@pobox.com>
+ * @author CiaranG <ciaran@ciarang.com>
+ * @author Craig Andrews <candrews@integralblue.com>
+ * @author Eric Helgeson <helfire@Erics-MBP.local>
+ * @author Evan Prodromou <evan@status.net>
+ * @author Mikael Nordfeldth <mmn@hethane.se>
+ * @author Robin Millette <millette@controlyourself.ca>
+ * @author Sarven Capadisli <csarven@status.net>
+ * @author Tom Adams <tom@holizz.com>
+ * @author Zach Copley <zach@status.net>
+ * @copyright 2009-2010 StatusNet, Inc http://status.net
+ * @copyright 2009-2014 Free Software Foundation, Inc http://www.fsf.org
+ * @license GNU Affero General Public License http://www.gnu.org/licenses/
+ * @version 1.0.x
+ * @link http://status.net
+ */
+
+abstract class Installer
+{
+ /** Web site info */
+ public $sitename, $server, $path, $fancy, $siteProfile, $ssl;
+ /** DB info */
+ public $host, $database, $dbtype, $username, $password, $db;
+ /** Administrator info */
+ public $adminNick, $adminPass, $adminEmail, $adminUpdates;
+ /** Should we skip writing the configuration file? */
+ public $skipConfig = false;
+
+ public static $dbModules = array(
+ 'mysql' => array(
+ 'name' => 'MySQL',
+ 'check_module' => 'mysqli',
+ 'scheme' => 'mysqli', // DSN prefix for PEAR::DB
+ ),
+ 'pgsql' => array(
+ 'name' => 'PostgreSQL',
+ 'check_module' => 'pgsql',
+ 'scheme' => 'pgsql', // DSN prefix for PEAR::DB
+ ),
+ );
+
+ /**
+ * Attempt to include a PHP file and report if it worked, while
+ * suppressing the annoying warning messages on failure.
+ */
+ private function haveIncludeFile($filename) {
+ $old = error_reporting(error_reporting() & ~E_WARNING);
+ $ok = include_once($filename);
+ error_reporting($old);
+ return $ok;
+ }
+
+ /**
+ * Check if all is ready for installation
+ *
+ * @return void
+ */
+ function checkPrereqs()
+ {
+ $pass = true;
+
+ $config = INSTALLDIR.'/config.php';
+ if (file_exists($config)) {
+ if (!is_writable($config) || filesize($config) > 0) {
+ if (filesize($config) == 0) {
+ $this->warning('Config file "config.php" already exists and is empty, but is not writable.');
+ } else {
+ $this->warning('Config file "config.php" already exists.');
+ }
+ $pass = false;
+ }
+ }
+
+ if (version_compare(PHP_VERSION, '5.3.2', '<')) {
+ $this->warning('Require PHP version 5.3.2 or greater.');
+ $pass = false;
+ }
+
+ $reqs = array('gd', 'curl', 'json',
+ 'xmlwriter', 'mbstring', 'xml', 'dom', 'simplexml');
+
+ foreach ($reqs as $req) {
+ if (!$this->checkExtension($req)) {
+ $this->warning(sprintf('Cannot load required extension: <code>%s</code>', $req));
+ $pass = false;
+ }
+ }
+
+ // Make sure we have at least one database module available
+ $missingExtensions = array();
+ foreach (self::$dbModules as $type => $info) {
+ if (!$this->checkExtension($info['check_module'])) {
+ $missingExtensions[] = $info['check_module'];
+ }
+ }
+
+ if (count($missingExtensions) == count(self::$dbModules)) {
+ $req = implode(', ', $missingExtensions);
+ $this->warning(sprintf('Cannot find a database extension. You need at least one of %s.', $req));
+ $pass = false;
+ }
+
+ // @fixme this check seems to be insufficient with Windows ACLs
+ if (!is_writable(INSTALLDIR)) {
+ $this->warning(sprintf('Cannot write config file to: <code>%s</code></p>', INSTALLDIR),
+ sprintf('On your server, try this command: <code>chmod a+w %s</code>', INSTALLDIR));
+ $pass = false;
+ }
+
+ // Check the subdirs used for file uploads
+ $fileSubdirs = array('avatar', 'background', 'file');
+ foreach ($fileSubdirs as $fileSubdir) {
+ $fileFullPath = INSTALLDIR."/$fileSubdir/";
+ if (!is_writable($fileFullPath)) {
+ $this->warning(sprintf('Cannot write to %s directory: <code>%s</code>', $fileSubdir, $fileFullPath),
+ sprintf('On your server, try this command: <code>chmod a+w %s</code>', $fileFullPath));
+ $pass = false;
+ }
+ }
+
+ return $pass;
+ }
+
+ /**
+ * Checks if a php extension is both installed and loaded
+ *
+ * @param string $name of extension to check
+ *
+ * @return boolean whether extension is installed and loaded
+ */
+ function checkExtension($name)
+ {
+ if (extension_loaded($name)) {
+ return true;
+ } elseif (function_exists('dl') && ini_get('enable_dl') && !ini_get('safe_mode')) {
+ // dl will throw a fatal error if it's disabled or we're in safe mode.
+ // More fun, it may not even exist under some SAPIs in 5.3.0 or later...
+ $soname = $name . '.' . PHP_SHLIB_SUFFIX;
+ if (PHP_SHLIB_SUFFIX == 'dll') {
+ $soname = "php_" . $soname;
+ }
+ return @dl($soname);
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Basic validation on the database paramters
+ * Side effects: error output if not valid
+ *
+ * @return boolean success
+ */
+ function validateDb()
+ {
+ $fail = false;
+
+ if (empty($this->host)) {
+ $this->updateStatus("No hostname specified.", true);
+ $fail = true;
+ }
+
+ if (empty($this->database)) {
+ $this->updateStatus("No database specified.", true);
+ $fail = true;
+ }
+
+ if (empty($this->username)) {
+ $this->updateStatus("No username specified.", true);
+ $fail = true;
+ }
+
+ if (empty($this->sitename)) {
+ $this->updateStatus("No sitename specified.", true);
+ $fail = true;
+ }
+
+ return !$fail;
+ }
+
+ /**
+ * Basic validation on the administrator user paramters
+ * Side effects: error output if not valid
+ *
+ * @return boolean success
+ */
+ function validateAdmin()
+ {
+ $fail = false;
+
+ if (empty($this->adminNick)) {
+ $this->updateStatus("No initial user nickname specified.", true);
+ $fail = true;
+ }
+ if ($this->adminNick && !preg_match('/^[0-9a-z]{1,64}$/', $this->adminNick)) {
+ $this->updateStatus('The user nickname "' . htmlspecialchars($this->adminNick) .
+ '" is invalid; should be plain letters and numbers no longer than 64 characters.', true);
+ $fail = true;
+ }
+ // @fixme hardcoded list; should use Nickname::isValid()
+ // if/when it's safe to have loaded the infrastructure here
+ $blacklist = array('main', 'panel', 'twitter', 'settings', 'rsd.xml', 'favorited', 'featured', 'favoritedrss', 'featuredrss', 'rss', 'getfile', 'api', 'groups', 'group', 'peopletag', 'tag', 'user', 'message', 'conversation', 'bookmarklet', 'notice', 'attachment', 'search', 'index.php', 'doc', 'opensearch', 'robots.txt', 'xd_receiver.html', 'facebook');
+ if (in_array($this->adminNick, $blacklist)) {
+ $this->updateStatus('The user nickname "' . htmlspecialchars($this->adminNick) .
+ '" is reserved.', true);
+ $fail = true;
+ }
+
+ if (empty($this->adminPass)) {
+ $this->updateStatus("No initial user password specified.", true);
+ $fail = true;
+ }
+
+ return !$fail;
+ }
+
+ /**
+ * Make sure a site profile was selected
+ *
+ * @return type boolean success
+ */
+ function validateSiteProfile()
+ {
+ if (empty($this->siteProfile)) {
+ $this->updateStatus("No site profile selected.", true);
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Set up the database with the appropriate function for the selected type...
+ * Saves database info into $this->db.
+ *
+ * @fixme escape things in the connection string in case we have a funny pass etc
+ * @return mixed array of database connection params on success, false on failure
+ */
+ function setupDatabase()
+ {
+ if ($this->db) {
+ throw new Exception("Bad order of operations: DB already set up.");
+ }
+ $this->updateStatus("Starting installation...");
+
+ if (empty($this->password)) {
+ $auth = '';
+ } else {
+ $auth = ":$this->password";
+ }
+ $scheme = self::$dbModules[$this->dbtype]['scheme'];
+ $dsn = "{$scheme}://{$this->username}{$auth}@{$this->host}/{$this->database}";
+
+ $this->updateStatus("Checking database...");
+ $conn = $this->connectDatabase($dsn);
+
+ // ensure database encoding is UTF8
+ if ($this->dbtype == 'mysql') {
+ // @fixme utf8m4 support for mysql 5.5?
+ // Force the comms charset to utf8 for sanity
+ // This doesn't currently work. :P
+ //$conn->executes('set names utf8');
+ } else if ($this->dbtype == 'pgsql') {
+ $record = $conn->getRow('SHOW server_encoding');
+ if ($record->server_encoding != 'UTF8') {
+ $this->updateStatus("GNU social requires UTF8 character encoding. Your database is ". htmlentities($record->server_encoding));
+ return false;
+ }
+ }
+
+ $res = $this->updateStatus("Creating database tables...");
+ if (!$this->createCoreTables($conn)) {
+ $this->updateStatus("Error creating tables.", true);
+ return false;
+ }
+
+ foreach (array('sms_carrier' => 'SMS carrier',
+ 'notice_source' => 'notice source',
+ 'foreign_services' => 'foreign service')
+ as $scr => $name) {
+ $this->updateStatus(sprintf("Adding %s data to database...", $name));
+ $res = $this->runDbScript($scr.'.sql', $conn);
+ if ($res === false) {
+ $this->updateStatus(sprintf("Can't run %s script.", $name), true);
+ return false;
+ }
+ }
+
+ $db = array('type' => $this->dbtype, 'database' => $dsn);
+ return $db;
+ }
+
+ /**
+ * Open a connection to the database.
+ *
+ * @param <type> $dsn
+ * @return <type>
+ */
+ function connectDatabase($dsn)
+ {
+ global $_DB;
+ return $_DB->connect($dsn);
+ }
+
+ /**
+ * Create core tables on the given database connection.
+ *
+ * @param DB_common $conn
+ */
+ function createCoreTables(DB_common $conn)
+ {
+ $schema = Schema::get($conn);
+ $tableDefs = $this->getCoreSchema();
+ foreach ($tableDefs as $name => $def) {
+ if (defined('DEBUG_INSTALLER')) {
+ echo " $name ";
+ }
+ $schema->ensureTable($name, $def);
+ }
+ return true;
+ }
+
+ /**
+ * Fetch the core table schema definitions.
+ *
+ * @return array of table names => table def arrays
+ */
+ function getCoreSchema()
+ {
+ $schema = array();
+ include INSTALLDIR . '/db/core.php';
+ return $schema;
+ }
+
+ /**
+ * Return a parseable PHP literal for the given value.
+ * This will include quotes for strings, etc.
+ *
+ * @param mixed $val
+ * @return string
+ */
+ function phpVal($val)
+ {
+ return var_export($val, true);
+ }
+
+ /**
+ * Return an array of parseable PHP literal for the given values.
+ * These will include quotes for strings, etc.
+ *
+ * @param mixed $val
+ * @return array
+ */
+ function phpVals($map)
+ {
+ return array_map(array($this, 'phpVal'), $map);
+ }
+
+ /**
+ * Write a stock configuration file.
+ *
+ * @return boolean success
+ *
+ * @fixme escape variables in output in case we have funny chars, apostrophes etc
+ */
+ function writeConf()
+ {
+ $vals = $this->phpVals(array(
+ 'sitename' => $this->sitename,
+ 'server' => $this->server,
+ 'path' => $this->path,
+ 'ssl' => in_array($this->ssl, array('never', 'sometimes', 'always'))
+ ? $this->ssl
+ : 'never',
+ 'db_database' => $this->db['database'],
+ 'db_type' => $this->db['type']
+ ));
+
+ // assemble configuration file in a string
+ $cfg = "<?php\n".
+ "if (!defined('GNUSOCIAL')) { exit(1); }\n\n".
+
+ // site name
+ "\$config['site']['name'] = {$vals['sitename']};\n\n".
+
+ // site location
+ "\$config['site']['server'] = {$vals['server']};\n".
+ "\$config['site']['path'] = {$vals['path']}; \n\n".
+ "\$config['site']['ssl'] = {$vals['ssl']}; \n\n".
+
+ // checks if fancy URLs are enabled
+ ($this->fancy ? "\$config['site']['fancy'] = true;\n\n":'').
+
+ // database
+ "\$config['db']['database'] = {$vals['db_database']};\n\n".
+ ($this->db['type'] == 'pgsql' ? "\$config['db']['quote_identifiers'] = true;\n\n":'').
+ "\$config['db']['type'] = {$vals['db_type']};\n\n";
+
+ // Normalize line endings for Windows servers
+ $cfg = str_replace("\n", PHP_EOL, $cfg);
+
+ // write configuration file out to install directory
+ $res = file_put_contents(INSTALLDIR.'/config.php', $cfg);
+
+ return $res;
+ }
+
+ /**
+ * Write the site profile. We do this after creating the initial user
+ * in case the site profile is set to single user. This gets around the
+ * 'chicken-and-egg' problem of the system requiring a valid user for
+ * single user mode, before the intial user is actually created. Yeah,
+ * we should probably do this in smarter way.
+ *
+ * @return int res number of bytes written
+ */
+ function writeSiteProfile()
+ {
+ $vals = $this->phpVals(array(
+ 'site_profile' => $this->siteProfile,
+ 'nickname' => $this->adminNick
+ ));
+
+ $cfg =
+ // site profile
+ "\$config['site']['profile'] = {$vals['site_profile']};\n";
+
+ if ($this->siteProfile == "singleuser") {
+ $cfg .= "\$config['singleuser']['nickname'] = {$vals['nickname']};\n\n";
+ } else {
+ $cfg .= "\n";
+ }
+
+ // Normalize line endings for Windows servers
+ $cfg = str_replace("\n", PHP_EOL, $cfg);
+
+ // write configuration file out to install directory
+ $res = file_put_contents(INSTALLDIR.'/config.php', $cfg, FILE_APPEND);
+
+ return $res;
+ }
+
+ /**
+ * Install schema into the database
+ *
+ * @param string $filename location of database schema file
+ * @param DB_common $conn connection to database
+ *
+ * @return boolean - indicating success or failure
+ */
+ function runDbScript($filename, DB_common $conn)
+ {
+ $sql = trim(file_get_contents(INSTALLDIR . '/db/' . $filename));
+ $stmts = explode(';', $sql);
+ foreach ($stmts as $stmt) {
+ $stmt = trim($stmt);
+ if (!mb_strlen($stmt)) {
+ continue;
+ }
+ try {
+ $res = $conn->simpleQuery($stmt);
+ } catch (Exception $e) {
+ $error = $e->getMessage();
+ $this->updateStatus("ERROR ($error) for SQL '$stmt'");
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Create the initial admin user account.
+ * Side effect: may load portions of GNU social framework.
+ * Side effect: outputs program info
+ */
+ function registerInitialUser()
+ {
+ require_once INSTALLDIR . '/lib/common.php';
+
+ $data = array('nickname' => $this->adminNick,
+ 'password' => $this->adminPass,
+ 'fullname' => $this->adminNick);
+ if ($this->adminEmail) {
+ $data['email'] = $this->adminEmail;
+ }
+ $user = User::register($data);
+
+ if (empty($user)) {
+ return false;
+ }
+
+ // give initial user carte blanche
+
+ $user->grantRole('owner');
+ $user->grantRole('moderator');
+ $user->grantRole('administrator');
+
+ // Attempt to do a remote subscribe to update@status.net
+ // Will fail if instance is on a private network.
+
+ if ($this->adminUpdates && class_exists('Ostatus_profile')) {
+ try {
+ $oprofile = Ostatus_profile::ensureProfileURL('http://update.status.net/');
+ Subscription::start($user->getProfile(), $oprofile->localProfile());
+ $this->updateStatus("Set up subscription to <a href='http://update.status.net/'>update@status.net</a>.");
+ } catch (Exception $e) {
+ $this->updateStatus("Could not set up subscription to <a href='http://update.status.net/'>update@status.net</a>.", true);
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * The beef of the installer!
+ * Create database, config file, and admin user.
+ *
+ * Prerequisites: validation of input data.
+ *
+ * @return boolean success
+ */
+ function doInstall()
+ {
+ global $config;
+
+ $this->updateStatus("Initializing...");
+ ini_set('display_errors', 1);
+ error_reporting(E_ALL);
+ if (!defined('GNUSOCIAL')) {
+ define('GNUSOCIAL', true);
+ }
+ if (!defined('STATUSNET')) {
+ define('STATUSNET', true);
+ }
+
+ require_once INSTALLDIR . '/lib/framework.php';
+ StatusNet::initDefaults($this->server, $this->path);
+
+ if ($this->siteProfile == "singleuser") {
+ // Until we use ['site']['profile']==='singleuser' everywhere
+ $config['singleuser']['enabled'] = true;
+ }
+
+ try {
+ $this->db = $this->setupDatabase();
+ if (!$this->db) {
+ // database connection failed, do not move on to create config file.
+ return false;
+ }
+ } catch (Exception $e) {
+ // Lower-level DB error!
+ $this->updateStatus("Database error: " . $e->getMessage(), true);
+ return false;
+ }
+
+ // Make sure we can write to the file twice
+ $oldUmask = umask(000);
+
+ if (!$this->skipConfig) {
+ $this->updateStatus("Writing config file...");
+ $res = $this->writeConf();
+
+ if (!$res) {
+ $this->updateStatus("Can't write config file.", true);
+ return false;
+ }
+ }
+
+ if (!empty($this->adminNick)) {
+ // Okay, cross fingers and try to register an initial user
+ if ($this->registerInitialUser()) {
+ $this->updateStatus(
+ "An initial user with the administrator role has been created."
+ );
+ } else {
+ $this->updateStatus(
+ "Could not create initial user account.",
+ true
+ );
+ return false;
+ }
+ }
+
+ if (!$this->skipConfig) {
+ $this->updateStatus("Setting site profile...");
+ $res = $this->writeSiteProfile();
+
+ if (!$res) {
+ $this->updateStatus("Can't write to config file.", true);
+ return false;
+ }
+ }
+
+ // Restore original umask
+ umask($oldUmask);
+ // Set permissions back to something decent
+ chmod(INSTALLDIR.'/config.php', 0644);
+
+ $scheme = $this->ssl === 'always' ? 'https' : 'http';
+ $link = "{$scheme}://{$this->server}/{$this->path}";
+
+ $this->updateStatus("GNU social has been installed at $link");
+ $this->updateStatus(
+ '<strong>DONE!</strong> You can visit your <a href="'.htmlspecialchars($link).'">new GNU social site</a> (log in as "'.htmlspecialchars($this->adminNick).'"). If this is your first GNU social install, make your experience the best possible by visiting our resource site to join the mailing list and <a href="http://gnu.io/resources/">good documentation</a>.'
+ );
+
+ return true;
+ }
+
+ /**
+ * Output a pre-install-time warning message
+ * @param string $message HTML ok, but should be plaintext-able
+ * @param string $submessage HTML ok, but should be plaintext-able
+ */
+ abstract function warning($message, $submessage='');
+
+ /**
+ * Output an install-time progress message
+ * @param string $message HTML ok, but should be plaintext-able
+ * @param boolean $error true if this should be marked as an error condition
+ */
+ abstract function updateStatus($status, $error=false);
+
+}
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return false;
}
return false;
}
- static function getFeedAuthor($feedEl)
+ static function getFeedAuthor(DOMElement $feedEl)
{
// Try old and deprecated activity:subject
return null;
}
- static function compareTypes($type, $objects) // this does verbs too!
+ static function compareTypes($type, array $objects) // this does verbs too!
{
$type = self::resolveUri($type);
- foreach ((array)$objects as $object) {
+ foreach ($objects as $object) {
if ($type === self::resolveUri($object)) {
return true;
}
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$this->checkSessionToken();
{
}
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return false;
}
*
* @return boolean false
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return false;
}
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
return true;
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
self::cleanRequest();
$scripts[] = $script;
}
foreach ($scripts as $script) {
- common_log(LOG_DEBUG, $script->textContent);
+ common_debug($script->textContent);
$script->parentNode->removeChild($script);
}
// XXX: Should these error actions even be invokable via URI?
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
return true;
}
- public function isReadOnly($args) {
+ public function isReadOnly(array $args=array()) {
return !$this->isPost();
}
return $options;
}
+
+ function getGroup()
+ {
+ return $this->group;
+ }
}
class GroupAdminSection extends ProfileSection
return true;
}
- function onStartEnqueueNotice($notice, &$transports)
+ function onStartEnqueueNotice(Notice $notice, array &$transports)
{
$profile = Profile::getKV($notice->profile_id);
return empty($this->title) ? '' : $this->title;
}
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
if ($timeout > 0 && empty($sockets)) {
// If we had no listeners, sleep until the pollers' next requested wakeup.
- common_log(LOG_DEBUG, "Sleeping $timeout seconds until next poll cycle...");
+ common_debug("Sleeping $timeout seconds until next poll cycle...");
$this->logState('sleep');
sleep($timeout);
}
}
} else if (common_config('queue', 'debug_memory')) {
$fmt = number_format($usage);
- common_log(LOG_DEBUG, "Memory usage $fmt");
+ common_debug("Memory usage $fmt");
}
}
}
{
var $page = null;
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
*
* @return boolean
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @param Action $action current action, used for output
*/
- function __construct($action=null)
+ function __construct(Action $action=null)
{
parent::__construct($action);
$this->out->elementStart('ul', $attrs);
foreach ($items as $item) {
+ assert(is_array($item));
+ assert(count($item) == 5);
+
list($actionName, $args, $label, $description, $id) = $item;
+
$this->item($actionName, $args, $label, $description, $id);
}
-
+
$this->out->elementEnd('ul');
-
+
Event::handle('EndNav', array($this, $tag, $items));
}
}
-
+
function item($actionName, $args, $label, $description, $id=null, $cls=null)
{
if (empty($id)) {
{
if ($actionName != $this->actionName) {
return false;
+ } elseif (!is_array($args)) {
+ /*
+ * No array, then the below loop doesn't need to run and
+ * 'return false' will never be reached.
+ */
+ return true;
}
foreach ($this->actionArgs as $k => $v) {
*
* @param Action $action current action, used for output
*/
- function __construct($action=null)
+ function __construct(Action $action=null)
{
parent::__construct($action);
$this->action = $action;
. ' (' . get_class($this) . ' v' . $this->version() . ')';
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$name = $this->name();
return true;
}
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
/**
* 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...
* @return boolean success
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
// Parent handling, including cache check
parent::handle($args);
foreach ($this->tables as $table => $def) {
$checksum = $this->checksum($def);
if (empty($checksums[$table])) {
- common_log(LOG_DEBUG, "No previous schema_version for $table: updating to $checksum");
+ common_debug("No previous schema_version for $table: updating to $checksum");
} else if ($checksums[$table] == $checksum) {
- common_log(LOG_DEBUG, "Last schema_version for $table up to date: $checksum");
+ common_debug("Last schema_version for $table up to date: $checksum");
continue;
} else {
- common_log(LOG_DEBUG, "Last schema_version for $table is {$checksums[$table]}: updating to $checksum");
+ common_debug("Last schema_version for $table is {$checksums[$table]}: updating to $checksum");
}
//$this->conn->query('BEGIN');
$this->schema->ensureTable($table, $def);
return $checksums;
} catch (Exception $e) {
// no dice!
- common_log(LOG_DEBUG, "Possibly schema_version table doesn't exist yet.");
+ common_debug("Possibly schema_version table doesn't exist yet.");
}
PEAR::popErrorHandling();
}
} catch (Exception $e) {
// no dice!
- common_log(LOG_DEBUG, "Possibly schema_version table doesn't exist yet.");
+ common_debug("Possibly schema_version table doesn't exist yet.");
}
PEAR::popErrorHandling();
$this->checksums[$table] = $checksum;
*
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
$this->showPage();
*
* @param Action $action current action, used for output
*/
- function __construct($action=null, $q = null)
+ function __construct(Action $action=null, $q = null)
{
parent::__construct($action);
$this->q = $q;
// XXX: Should these error actions even be invokable via URI?
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
if (!common_logged_in()) {
* Construction
*
* @param Action $action current action, used for output
+ * @param User $user Current user or NULL if "guest"
*/
- function __construct($action=null, $user=null)
+ function __construct(Action $action=null, User $user=null)
{
parent::__construct($action);
$this->user = $user;
*
* 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.
*
--- /dev/null
+<?php
+error_reporting(E_ALL );
+/**
+ * StatusNet, the distributed open-source microblogging tool
+ *
+ * Superclass(Version2) for plugins that do URL shortening
+ *
+ * PHP version >= 5.2
+ *
+ * LICENCE: 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 Plugin
+ * @package StatusNet
+ * @author Craig Andrews <candrews@integralblue.com>
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
+ * @link http://gnu.io
+ */
+define("STATUSNET", 1);
+if (!defined('STATUSNET') && !defined('LACONICA')) {
+ exit(1);
+}
+
+
+/**
+ * Class to handle Plugin exceptions
+ *
+ * @category Exception
+ * @package StatusNet
+ * @author Craig Andrews <candrews@integralblue.com>
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
+ * @link http://gnu.io
+ */
+class PluginErrorException extends Exception {
+ protected $severity=0;
+ /**
+ * Setup costumizable Exceptions
+ * @var array $HTML Codes for Exceptionlists(see PluginErrorException::getFull())
+ */
+ protected $HTML=array(
+ 'code'=>array("start"=>'<code>', "end"=>'</code'),
+ 'ulist'=>array("start"=>'<ul>', "end"=>'</ul>' ),
+ 'list'=>array("start"=>"<li>", "end"=>"</li>"));
+ /**
+ * Create specific extension for PluginExceptions
+ * @
+ */
+ public function __construct($message, $code, $severity, $filename, $lineno, $HTML='') {
+ $this->message = $message;
+ $this->code = $code;
+ $this->severity = $severity;
+ $this->file = $filename;
+ $this->line = $lineno;
+ }
+
+ public function getSeverity() {
+ return $this->severity;
+ }
+ public function printFull() {
+ echo "Catched Exception: <ul><br />";
+ echo "<li>Message: <code>".$this->getMessage()."</code></li> ";
+ echo "<li>Code: <code>".$this->getCode()."</code></li> ";
+ echo "<li>Line: <code>".$this->getLine()."</code></li> ";
+ echo "<li>File: <code>".$this->getFile()."</code></li> ";
+ echo "<li>Severity: <code>".$this->getSeverity()."</code></li>";
+ echo "</ul><p>Code: 0 means an uncatched Exception, triggered ";
+ echo "by PHP's parsing. This is probally an Syntax-Error.</p> ";
+ }
+}
+/* Do done some exceptionrelated things done, befor
+ * we can start coding the real.
+ */
+function exception_error_handler($errno, $errstr, $errfile, $errline ) {
+ throw new PluginErrorException($errstr, 0, $errno, $errfile, $errline);
+}
+
+/* the Exceptionhandler for Syntax-Errors, throwed by PHP itself */
+/**
+ * Superclass for plugins that perform a url shortening
+ *
+ * @category Plugin
+ * @package StatusNet
+ * @author Craig Andrews <candrews@integralblue.com>
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
+ * @link http://darksider3.de/sn/urlshortenerplugin2.html
+ */
+
+abstract class UrlShortenerPlugin2
+{
+ public $shortenerName;
+ public $freeService = true;
+ /**
+ * Make an URL shorter.
+ *
+ * @param string $url URL to shorten
+ *
+ * @return string shortened version of the url/Null/Error
+ * @todo dont support old "shorten", name it to "shortUrl" to get well-named code.
+ */
+ protected abstract function shorten($url);
+
+
+ /**
+ * Utility to get the data at an URL
+ *
+ * @param string $url URL to fetch
+ * @exception PluginErrorExcpetion $e If HTTPClient throws an exception, print out.
+ * @return string response body
+ * @todo throw an exception in HTTPClient and make the PluginErrorException more generally
+ * so that we can use it more then ones, in every libfile.
+ */
+ protected function httpGet($url)
+ {
+ try
+ {
+ $request = HTTPClient::start();
+ $response = $request->get($url);
+ } catch(PluginErrorException $e)
+ {
+ $e->printFull();
+ return false;
+ }
+ return $response->getBody();
+ }
+ /**
+ * Utility to post a request and get a response URL
+ *
+ * @param string $url URL to fetch
+ * @param array $data post parameters
+ *
+ * @return string response body
+ *
+ */
+ protected function httpPost($url, $data)
+ {
+
+ $request = HTTPClient::start();
+ $response = $request->post($url, null, $data);
+ return $response->getBody();
+ }
+ // Hook handlers
+
+ /**
+ * Called when all plugins have been initialized
+ *
+ * @return boolean hook value
+ */
+
+ function onInitializePlugin()
+ {
+ if (!isset($this->shortenerName))
+ {
+ throw new Exception("@Admin must specifiy $this->shortenerName");
+ }
+ return true;
+ }
+ /**
+ * Called when a showing the URL shortener drop-down box
+ *
+ * Properties of the shortening service currently only
+ * include whether it's a free service.
+ *
+ * @param array &$shorteners array mapping shortener name to properties
+ *
+ * @return boolean hook value
+ */
+ function onGetUrlShorteners(&$shorteners)
+ {
+ $shorteners[$this->shortenerName] =array('freeService' => $this->freeService);
+ return true;
+ }
+
+ /**
+ * Called to shorten an URL
+ *
+ * @param string $url URL to shorten
+ * @param string $shortenerName Shortening service. Don't handle if it's
+ * not you!
+ * @param string &$shortenedUrl URL after shortening; out param.
+ *
+ * @return boolean hook value
+ */
+
+ function onStartShortenUrl($url, $shortenerName, &$shortenedUrl)
+ {
+ if ($shortenerName == $this->shortenerName)
+ {
+ $result = $this->shorten($url);
+ if (isset($result) && $result != null && $result !== false)
+ {
+ $shortenedUrl = $result;
+ //dont create an exception, so we can do that without.
+ common_log(LOG_INFO,
+ __CLASS__ . ": $this->shortenerName ".
+ "shortened $url to $shortenedUrl");
+ return false;
+ }
+ }
+ return true;
+ }
+}
+?>
$_perfCounters[$key] = array($val);
}
if (common_config('site', 'logperf_detail')) {
- common_log(LOG_DEBUG, "PERF COUNTER HIT: $key $val");
+ common_debug("PERF COUNTER HIT: $key $val");
}
}
}
if (isset($_startTime)) {
$endTime = microtime(true);
$diff = round(($endTime - $_startTime) * 1000);
- common_log(LOG_DEBUG, "PERF runtime: ${diff}ms");
+ common_debug("PERF runtime: ${diff}ms");
}
$counters = $_perfCounters;
ksort($counters);
foreach ($counters as $key => $values) {
$count = count($values);
$unique = count(array_unique($values));
- common_log(LOG_DEBUG, "PERF COUNTER: $key $count ($unique unique)");
+ common_debug("PERF COUNTER: $key $count ($unique unique)");
}
}
}
return false;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'APC',
'version' => GNUSOCIAL_VERSION,
/**
* 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',
}
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'AccountManager',
'version' => GNUSOCIAL_VERSION,
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
return true;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'Activity',
'version' => self::VERSION,
/**
* 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'));
return true;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'ActivitySpam',
'version' => GNUSOCIAL_VERSION,
* MAY override
*
* @param array $args other arguments
- *
* @return boolean is read only action?
*/
-
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
$action->script($this->adScript);
}
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect('panel/adsense',
array('action' => 'adsenseadminpanel'));
return true;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'BlankAdPlugin',
'version' => GNUSOCIAL_VERSION,
return true;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'AIM',
'version' => GNUSOCIAL_VERSION,
*/
public function handleInput($socket)
{
- common_log(LOG_DEBUG, "Servicing the AIM queue.");
+ common_debug("Servicing the AIM queue.");
$this->stats('aim_process');
$this->conn->receive();
}
*
* @return boolean hook value
*/
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$url = 'http://status.net/wiki/Plugin:AnonymousFave';
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
return true;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'ApiLogger',
'version' => GNUSOCIAL_VERSION,
return true;
}
- public function onPluginVersion(&$versions)
+ public function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'AuthCrypt',
'version' => GNUSOCIAL_VERSION,
}
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'AutoSandbox',
'version' => GNUSOCIAL_VERSION,
}
}
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect('main/autocomplete/suggest', array('action'=>'autocomplete'));
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'Autocomplete',
'version' => GNUSOCIAL_VERSION,
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
{
const VERSION = '0.0.42';
- public function onPluginVersion(&$versions)
+ public function onPluginVersion(array &$versions)
{
$versions[] = array(
'name' => 'Awesomeness',
return null;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => sprintf('BitlyUrl (%s)', $this->shortenerName),
'version' => GNUSOCIAL_VERSION,
/**
* 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;
*
* @return boolean hook value
*/
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'Blacklist',
'version' => self::VERSION,
'');
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'BlankAd',
'version' => GNUSOCIAL_VERSION,
/**
* 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'));
return true;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'Blog',
'version' => GNUSOCIAL_VERSION,
return BLOGSPAMNETPLUGIN_VERSION;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'BlogspamNet',
'version' => BLOGSPAMNETPLUGIN_VERSION,
/**
* 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();
*
* @return value
*/
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'Bookmark',
'version' => self::VERSION,
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
$this->showTimeline();
*
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean true
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
* Handler method
*
* @param array $args is ignored since it's now passed in in prepare()
- *
* @return void
*/
-
- function handle($args=null)
+ function handle(array $args=array())
{
$this->startHTML('text/xml;charset=utf-8');
$this->elementStart('head');
* MAY override
*
* @param array $args other arguments
- *
* @return boolean is read only action?
*/
-
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return false;
}
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
$nickname = $this->returnToArgs();
$nickname = $nickname[1]['nickname'];
}
-
+
$this->user = User::getKV('nickname', $nickname);
if (!$this->user) {
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
$this->showPage();
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean success
*/
- function prepare($args)
- {
+ function prepare(array $args=array())
+ {
parent::prepare($args);
$nickname = $this->trimmed('nickname');
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return !$this->isPost();
}
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
$_SERVER['REQUEST_METHOD'] == 'HEAD') {
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
return true;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'CacheLog',
'version' => GNUSOCIAL_VERSION,
$casSettings['takeOverLogin']=$this->takeOverLogin;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'CAS Authentication',
'version' => GNUSOCIAL_VERSION,
class CasloginAction extends Action
{
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
if (common_is_real_login()) {
}
}
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
if (common_logged_in()) {
$m->connect('plugins/ClientSideShorten/shorten', array('action'=>'shorten'));
}
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'Shorten',
'version' => GNUSOCIAL_VERSION,
{
private $text;
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
$this->groups=array();
return true;
}
- function handle($args=null)
+ function handle(array $args=array())
{
parent::handle($args);
header('Content-Type: text/plain');
return '/' . implode('/', $path);
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'Comet',
'version' => GNUSOCIAL_VERSION,
return true;
}
- public function onPluginVersion(&$versions)
+ public function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'Cronish',
'version' => GNUSOCIAL_VERSION,
/**
* plugin details
*/
- function onPluginVersion(&$versions){
+ function onPluginVersion(array &$versions){
$url = 'http://status.net/wiki/Plugin:DirectionDetector';
$versions[] = array(
/**
* 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(
/*
* Version info
*/
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array(
'name' => 'Directory',
*
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
$this->showPage();
*
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
$this->showPage();
return false;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'DiskCache',
'version' => GNUSOCIAL_VERSION,
return true;
}
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
if (common_config('globalapi', 'enabled')) {
foreach (array('register', 'login', 'recover') as $method) {
return null;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'DomainStatusNetwork',
'version' => GNUSOCIAL_VERSION,
* @return boolean continuation flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
StatusNet::setApi(true); // reduce exception reports to aid in debugging
return true;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'DomainWhitelist',
'version' => GNUSOCIAL_VERSION,
return true;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'Email Authentication',
'version' => GNUSOCIAL_VERSION,
return true;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'EmailRegistration',
'version' => GNUSOCIAL_VERSION,
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return false;
}
* @param type $versions
* @return type
*/
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array(
'name' => 'EmailReminder',
*
* @return boolean hook value; true means continue processing, false means stop.
*/
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'EmailSummary',
'version' => GNUSOCIAL_VERSION,
/**
* 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'));
return true;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'Event',
'version' => GNUSOCIAL_VERSION,
{
switch ($notice->object_type) {
case Happening::OBJECT_TYPE:
- common_log(LOG_DEBUG, "Deleting event from notice...");
+ common_debug("Deleting event from notice...");
$happening = Happening::fromNotice($notice);
$happening->delete();
break;
case RSVP::POSITIVE:
case RSVP::NEGATIVE:
case RSVP::POSSIBLE:
- common_log(LOG_DEBUG, "Deleting rsvp from notice...");
+ common_debug("Deleting rsvp from notice...");
$rsvp = RSVP::fromNotice($notice);
- common_log(LOG_DEBUG, "to delete: $rsvp->id");
+ common_debug("to delete: $rsvp->id");
$rsvp->delete();
break;
default:
- common_log(LOG_DEBUG, "Not deleting related, wtf...");
+ common_debug("Not deleting related, wtf...");
}
}
$notice = $this->rsvp->getNotice();
// NB: this will delete the rsvp, too
if (!empty($notice)) {
- common_log(LOG_DEBUG, "Deleting notice...");
+ common_debug("Deleting notice...");
$notice->delete();
} else {
- common_log(LOG_DEBUG, "Deleting RSVP alone...");
+ common_debug("Deleting RSVP alone...");
$this->rsvp->delete();
}
} catch (ClientException $ce) {
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
$_SERVER['REQUEST_METHOD'] == 'HEAD') {
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
$_SERVER['REQUEST_METHOD'] == 'HEAD') {
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
$_SERVER['REQUEST_METHOD'] == 'HEAD') {
*
* @return boolean true
*/
- function prepare($args) {
+ function prepare(array $args=array()) {
parent::prepare($args);
$this->start = $this->arg('start');
$this->duration = $this->boolean('duration', false);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
*/
class ExtendedProfilePlugin extends Plugin
{
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array(
'name' => 'ExtendedProfile',
*
* Hook for RouterInitialized event.
*
- * @param Net_URL_Mapper $m URL mapper
+ * @param URLMapper $m URL mapper
*
* @return boolean hook return
*/
class ProfileDetailAction extends ShowstreamAction
{
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean true if nothing goes wrong
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
$this->query = $this->trimmed('term');
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
$this->showResults();
*
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
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)
{
// Always add the admin panel route
$m->connect('panel/facebook', array('action' => 'facebookadminpanel'));
*
* @return boolean hook return
*/
- function onStartEnqueueNotice($notice, &$transports)
+ function onStartEnqueueNotice(Notice $notice, array &$transports)
{
if (self::hasApplication() && $notice->isLocal() && $notice->inScope(null)) {
array_push($transports, 'facebook');
*
* @param array &$versions plugin version descriptions
*/
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array(
'name' => 'Facebook Bridge',
*
* @return boolean true
*/
- function prepare($args)
+ function prepare(array $args=array())
{
$this->facebook = Facebookclient::getFacebook();
*
* @param array $args is ignored since it's now passed in in prepare()
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
private $fbuser = null; // Facebook user object (JSON)
private $accessToken = null; // Access token provided by Facebook JS API
- function prepare($args) {
+ function prepare(array $args=array()) {
parent::prepare($args);
// Check cookie for a valid access_token
return true;
}
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
class FacebookloginAction extends Action
{
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
*
* @return boolean true
*/
- function prepare($args) {
+ function prepare(array $args=array()) {
parent::prepare($args);
$this->facebook = new Facebook(
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
$this->user = $this->auth_user;
$this->notice = Notice::getKV($this->arg('id'));
if ($this->notice->repeat_of != '' ) {
- common_log(LOG_DEBUG, 'Trying to Fave '.$this->notice->id.', repeat of '.$this->notice->repeat_of);
- common_log(LOG_DEBUG, 'Will Fave '.$this->notice->repeat_of.' instead');
+ common_debug('Trying to Fave '.$this->notice->id.', repeat of '.$this->notice->repeat_of);
+ common_debug('Will Fave '.$this->notice->repeat_of.' instead');
$real_notice_id = $this->notice->repeat_of;
$this->notice = Notice::getKV($real_notice_id);
}
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
$this->user = $this->auth_user;
$this->notice = Notice::getKV($this->arg('id'));
if ($this->notice->repeat_of != '' ) {
- common_log(LOG_DEBUG, 'Trying to unFave '.$this->notice->id);
- common_log(LOG_DEBUG, 'Will unFave '.$this->notice->repeat_of.' instead');
+ common_debug('Trying to unFave '.$this->notice->id);
+ common_debug('Will unFave '.$this->notice->repeat_of.' instead');
$real_notice_id = $this->notice->repeat_of;
$this->notice = Notice::getKV($real_notice_id);
}
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
$profile = Profile::getKV('id', $id);
$ids_with_profile_data[$i]['user_id'] = $id;
$ids_with_profile_data[$i]['nickname'] = $profile->nickname;
- $ids_with_profile_data[$i]['fullname'] = $profile->fullname;
- $ids_with_profile_data[$i]['profileurl'] = $profile->profileurl;
+ $ids_with_profile_data[$i]['fullname'] = $profile->fullname;
+ $ids_with_profile_data[$i]['profileurl'] = $profile->profileurl;
$profile = new Profile();
$profile->id = $id;
$avatarurl = $profile->avatarUrl(24);
- $ids_with_profile_data[$i]['avatarurl'] = $avatarurl;
+ $ids_with_profile_data[$i]['avatarurl'] = $avatarurl;
$i++;
}
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
$_SERVER['REQUEST_METHOD'] == 'HEAD') {
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
$_SERVER['REQUEST_METHOD'] == 'HEAD') {
*
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @todo move queries from showContent() to here
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
$this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
*
* @return boolean success
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return boolean true
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
$this->showPage();
$this->firephp->fb($msg, $fp_priority);
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'FirePHP',
'version' => GNUSOCIAL_VERSION,
* @return boolean hook value
*
*/
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'FollowEveryone',
'version' => GNUSOCIAL_VERSION,
*
* @return boolean hook value
*/
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$url = 'http://status.net/wiki/Plugin:ForceGroup';
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'));
{
var $user = null;
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
$this->user = common_current_user();
return true;
}
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
$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'));
{
var $user = null;
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
$args = $this->returnToArgs();
return true;
}
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
if($_SERVER['REQUEST_METHOD'] == 'POST') {
{
var $user = null;
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
return true;
}
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
$this->showPage();
$this->element('option', array('value' => '120'), _("Medium"));
$this->element('option', array('value' => '400'), _("Normal"));
$this->elementEnd('select');
- }
+ }
function showAlbums()
{
{
var $user = null;
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
$this->user = common_current_user();
return true;
}
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
if($_SERVER['REQUEST_METHOD'] == 'POST') {
$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'));
{
var $user = null;
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
}
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
$this->showPage();
return true;
}
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect('main/postvideo', array('action' => 'postvideo'));
$m->connect('showvideo/:id', array('action' => 'showvideo'));
var $user = null;
var $url = null;
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
$this->user = common_current_user();
return true;
}
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
protected $id = null;
protected $vid = null;
- function prepare($args)
+ function prepare(array $args=array())
{
OwnerDesignAction::prepare($args);
$this->id = $this->trimmed('id');
return true;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'GeoURL',
'version' => GNUSOCIAL_VERSION,
return $document->geoname;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'Geonames',
'version' => GNUSOCIAL_VERSION,
$action->inlineScript($js);
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'GoogleAnalytics',
'version' => self::VERSION,
class GravatarPlugin extends Plugin
{
- function onEndProfileGetAvatar($profile, $size, &$avatar)
+ function onEndProfileGetAvatar(Profile $profile, $size, &$avatar)
{
if (empty($avatar)) {
try {
function gravatar_url($email, $size)
{
- $url = "https://secure.gravatar.com/avatar.php?gravatar_id=".
- md5(strtolower($email)).
- "&default=".urlencode(Avatar::defaultImage($size)).
- "&size=".$size;
+ $url = 'https://secure.gravatar.com/avatar.php?gravatar_id=' .
+ md5(strtolower($email)) .
+ '&default=' . urlencode(Avatar::defaultImage($size)) .
+ '&size=' . $size;
return $url;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'Gravatar',
'version' => GNUSOCIAL_VERSION,
/**
* 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('group/:nickname/favorited',
array('action' => 'groupfavorited'),
return true;
}
- function onEndGroupGroupNav(GroupNav $nav)
+ function onEndGroupGroupNav(Menu $nav)
{
$action_name = $nav->action->trimmed('action');
$nickname = $nav->group->nickname;
*
* @return boolean hook value
*/
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$url = 'http://status.net/wiki/Plugin:GroupFavorited';
/**
* Map URLs to actions
*
- * @param Net_URL_Mapper $m path-to-action mapper
+ * @param URLMapper $m path-to-action mapper
*
* @return boolean hook value
*/
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect('group/:nickname/inbox',
array('action' => 'groupinbox'),
*
* @see Action
*/
- function onEndGroupGroupNav($groupnav)
+ function onEndGroupGroupNav(Menu $groupnav)
{
$action = $groupnav->action;
$group = $groupnav->group;
*
* @result boolean hook value
*/
- function onEndGroupSave($group)
+ function onEndGroupSave(User_group $group)
{
$gps = new Group_privacy_settings();
*
* @param GroupEditForm $form form being shown
*/
- function onEndGroupEditFormData($form)
+ function onEndGroupEditFormData(GroupEditForm $form)
{
$gps = null;
return true;
}
- function onEndGroupSaveForm($action)
+ function onEndGroupSaveForm(Action $action)
{
+ // The Action class must contain this method
+ assert(is_callable(array($action, 'getGroup')));
+
$gps = null;
+ $group = $action->getGroup();
- if (!empty($action->group)) {
- $gps = Group_privacy_settings::getKV('group_id', $action->group->id);
+ if ($group instanceof User_group) {
+ $gps = Group_privacy_settings::getKV('group_id', $group->id);
}
$orig = null;
if (empty($gps)) {
$gps = new Group_privacy_settings();
- $gps->group_id = $action->group->id;
+ $gps->group_id = $action->getGroup()->id;
} else {
$orig = clone($gps);
}
*
* @return boolean hook value
*/
- function onStartInterpretCommand($cmd, $arg, $user, &$result)
+ function onStartInterpretCommand($cmd, $arg, User $user, &$result)
{
if ($cmd == 'd' || $cmd == 'dm') {
*
* @return boolean hook value
*/
- function onEndGroupActionsList($widget, $group)
+ function onEndGroupActionsList(Widget $widget, User_group $group)
{
$cur = common_current_user();
$action = $widget->out;
*
* @param
*/
- function onStartNoticeSave(&$notice) {
+ function onStartNoticeSave(Notice &$notice) {
// Look for group tags
// FIXME: won't work for remote groups
// @fixme if Notice::saveNew is refactored so we can just pull its list
foreach (array_unique($match[1]) as $nickname) {
$group = User_group::getForNickname($nickname, $profile);
- if (empty($group)) {
+ if (!$group instanceof User_group) {
continue;
}
*
* @return boolean hook value
*/
- function onEndGroupProfileElements($action, $group)
+ function onEndGroupProfileElements(Action $action, User_group $group)
{
$gps = Group_privacy_settings::forGroup($group);
return true;
}
- function onStartShowExportData($action)
+ function onStartShowExportData(Action $action)
{
if ($action instanceof ShowgroupAction) {
- $gps = Group_privacy_settings::forGroup($action->group);
+ $gps = Group_privacy_settings::forGroup($action->getGroup());
if ($gps->allow_privacy == Group_privacy_settings::ALWAYS) {
return false;
return true;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'GroupPrivateMessage',
'version' => GNUSOCIAL_VERSION,
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
$classes[] = new ImapManager($this);
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'IMAP',
'version' => GNUSOCIAL_VERSION,
*
* @return boolean true
*/
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$url = 'http://status.net/wiki/Plugin:InProcessCache';
$action->script($this->path('infinitescroll.js'));
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'InfiniteScroll',
'version' => GNUSOCIAL_VERSION,
* @param array $versions Array to insert information into
* @return void
*/
- public function onPluginVersion(&$versions) {
+ public function onPluginVersion(array &$versions) {
$versions[] = array('name' => 'IRC',
'version' => GNUSOCIAL_VERSION,
'author' => 'Luke Fitzgerald',
* @return void
*/
public function handleInput($socket) {
- common_log(LOG_DEBUG, 'Servicing the IRC queue.');
+ common_debug('Servicing the IRC queue.');
$this->stats('irc_process');
try {
$disco->registerMethod('LRDDMethod_LinkHTML');
}
- public function onPluginVersion(&$versions)
+ public function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'LRDD',
'version' => GNUSOCIAL_VERSION,
return common_nicknamize($nickname);
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'LDAP Authentication',
'version' => GNUSOCIAL_VERSION,
return false;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'LDAP Authorization',
'version' => GNUSOCIAL_VERSION,
}
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => sprintf('LilUrl (%s)', $this->shortenerName),
'version' => GNUSOCIAL_VERSION,
*/
class LinkPreviewPlugin extends Plugin
{
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'LinkPreview',
'version' => GNUSOCIAL_VERSION,
/**
* Hook for RouterInitialized event.
*
- * @param Net_URL_Mapper $m URL mapper
+ * @param URLMapper $m URL mapper
*
* @return boolean hook return
*/
*/
class OembedproxyAction extends OembedAction
{
- function handle($args)
+ function handle(array $args=array())
{
// Trigger short error responses; not a human-readable web page.
StatusNet::setApi(true);
return LINKBACKPLUGIN_VERSION;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'Linkback',
'version' => LINKBACKPLUGIN_VERSION,
public $priority = array(); // override by priority: array(LOG_ERR => true, LOG_DEBUG => false)
public $regex = array(); // override by regex match of message: array('/twitter/i' => false)
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'LogFilter',
'version' => GNUSOCIAL_VERSION,
*
* @return boolean event handler return
*/
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect(':nickname/all/map',
array('action' => 'allmap'),
$action->elementEnd('div');
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'Mapstraction',
'version' => self::VERSION,
*/
class AllmapAction extends MapAction
{
- function prepare($args)
+ function prepare(array $args=array())
{
if (parent::prepare($args)) {
$stream = new InboxNoticeStream($this->user->getProfile(), $this->scoped);
var $page = null;
var $notices = null;
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
return true;
}
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
$this->showPage();
*/
class UsermapAction extends MapAction
{
- function prepare($args)
+ function prepare(array $args=array())
{
if(parent::prepare($args)) {
$this->notice = empty($this->tag)
return $out;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'Memcache',
'version' => GNUSOCIAL_VERSION,
return $flag;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'Memcached',
'version' => GNUSOCIAL_VERSION,
return implode('-', $path);
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'Meteor',
'version' => GNUSOCIAL_VERSION,
return Minify_CSS::minify($code,$options);
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'Minify',
'version' => GNUSOCIAL_VERSION,
var $file;
var $v;
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
$this->v = $args['v'];
return filemtime($this->file);
}
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
return $proto.'://'.$serverpart.'/'.$pathpart.$relative;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'MobileProfile',
'version' => GNUSOCIAL_VERSION,
{
static $rights = array(Right::SILENCEUSER, Right::TRAINSPAM, Right::REVIEWSPAM);
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'ModHelper',
'version' => GNUSOCIAL_VERSION,
}
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'ModLog',
'version' => GNUSOCIAL_VERSION,
*/
class ModPlusPlugin extends Plugin
{
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'ModPlus',
'version' => GNUSOCIAL_VERSION,
*
* Hook for RouterInitialized event.
*
- * @param Net_URL_Mapper $m URL mapper
+ * @param URLMapper $m URL mapper
*
* @return boolean hook return
*/
*
* @return boolean hook value
*/
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$url = 'http://status.net/wiki/Plugin:NoticeTitle';
/**
* 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',
/**
* Put saved notices into the queue for pubsub distribution.
*/
- function onStartEnqueueNotice($notice, &$transports)
+ function onStartEnqueueNotice(Notice $notice, array &$transports)
{
if ($notice->inScope(null)) {
// put our transport first, in case there's any conflict (like OMB)
if ($oprofile instanceof Ostatus_profile) {
$oprofile->processFeed($feed, 'push');
} else {
- common_log(LOG_DEBUG, "No ostatus profile for incoming feed $feedsub->uri");
+ common_debug("No ostatus profile for incoming feed $feedsub->uri");
}
}
$oprofile->query(sprintf($sql, $profile->id, $profile->id));
if ($oprofile->N == 0) {
- common_log(LOG_DEBUG, "No OStatus remote subscribees for $profile->nickname");
+ common_debug("No OStatus remote subscribees for $profile->nickname");
return true;
}
return true;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'OStatus',
'version' => GNUSOCIAL_VERSION,
var $profile;
var $err;
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
{
var $peopletag = null;
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
return true;
}
}
- common_log(LOG_DEBUG, "Not a user, group or people tag feed? $feed $userFeed $groupFeed $listFeed");
+ common_debug("Not a user, group or people tag feed? $feed $userFeed $groupFeed $listFeed");
}
- common_log(LOG_DEBUG, "LOST $feed");
+ common_debug("LOST $feed");
return false;
}
* send immediately but won't get the return value.
*
* @param mixed $entry XML string, Notice, or Activity
+ * @param Profile $actor Acting profile
* @return boolean success
*/
- public function notifyDeferred($entry, $actor)
+ public function notifyDeferred($entry, Profile $actor)
{
if ($this->salmonuri) {
$data = array('salmonuri' => $this->salmonuri,
*
* @return Notice Notice representing the new (or existing) activity
*/
- public function processEntry($entry, $feed, $source)
+ public function processEntry(DOMElement $entry, DOMElement $feed, $source)
{
$activity = new Activity($entry, $feed);
return $this->processActivity($activity, $source);
}
// TODO: Make this throw an exception
- public function processActivity($activity, $source)
+ public function processActivity(Activity $activity, $source)
{
$notice = null;
return $notice;
}
- public function processShare($activity, $method)
+ public function processShare(Activity $activity, $method)
{
$notice = null;
* @return mixed saved Notice or false
* @todo FIXME: Break up this function, it's getting nasty long
*/
- public function processPost($activity, $method)
+ public function processPost(Activity $activity, $method)
{
$notice = null;
*/
static public function filterAttention(Profile $sender, array $attention)
{
- common_log(LOG_DEBUG, "Original reply recipients: " . implode(', ', array_keys($attention)));
+ common_debug("Original reply recipients: " . implode(', ', array_keys($attention)));
$groups = array();
$replies = array();
foreach ($attention as $recipient=>$type) {
if ($sender->isMember($group)) {
$groups[] = $group->id;
} else {
- common_log(LOG_DEBUG, sprintf('Skipping reply to local group %s as sender %d is not a member', $group->getNickname(), $sender->id));
+ common_debug(sprintf('Skipping reply to local group %s as sender %d is not a member', $group->getNickname(), $sender->id));
}
continue;
} else {
- common_log(LOG_DEBUG, "Skipping reply to bogus group $recipient");
+ common_debug("Skipping reply to bogus group $recipient");
}
}
continue;
} catch (Exception $e) {
// Neither a recognizable local nor remote user!
- common_log(LOG_DEBUG, "Skipping reply to unrecognized profile $recipient: " . $e->getMessage());
+ common_debug("Skipping reply to unrecognized profile $recipient: " . $e->getMessage());
}
}
- common_log(LOG_DEBUG, "Local reply recipients: " . implode(', ', $replies));
- common_log(LOG_DEBUG, "Local group recipients: " . implode(', ', $groups));
+ common_debug("Local reply recipients: " . implode(', ', $replies));
+ common_debug("Local group recipients: " . implode(', ', $groups));
return array($groups, $replies);
}
* @throws Exception on various error conditions
* @throws OStatusShadowException if this reference would obscure a local user/group
*/
- public static function ensureProfileURL($profile_url, $hints=array())
+ public static function ensureProfileURL($profile_url, array $hints=array())
{
$oprofile = self::getFromProfileURL($profile_url);
* @return Ostatus_profile
* @throws Exception
*/
- public static function ensureAtomFeed($feedEl, $hints)
+ public static function ensureAtomFeed(DOMElement $feedEl, array $hints)
{
$author = ActivityUtils::getFeedAuthor($feedEl);
* @param array $hints
* @return mixed URL string or false
*/
- public static function getActivityObjectAvatar($object, $hints=array())
+ public static function getActivityObjectAvatar(ActivityObject $object, array $hints=array())
{
if ($object->avatarLinks) {
$best = false;
* @param DOMElement $feed
* @return string
*/
- protected static function getAvatar($actor, $feed)
+ protected static function getAvatar(ActivityObject $actor, DOMElement $feed)
{
$url = '';
$icon = '';
* @return Ostatus_profile
* @throws Exception
*/
- public static function ensureActorProfile($activity, $hints=array())
+ public static function ensureActorProfile(Activity $activity, array $hints=array())
{
return self::ensureActivityObjectProfile($activity->actor, $hints);
}
* @return Ostatus_profile
* @throws Exception
*/
- public static function ensureActivityObjectProfile($object, $hints=array())
+ public static function ensureActivityObjectProfile(ActivityObject $object, array $hints=array())
{
$profile = self::getActivityObjectProfile($object);
if ($profile instanceof Ostatus_profile) {
* @return mixed matching Ostatus_profile or false if none known
* @throws ServerException if feed info invalid
*/
- public static function getActorProfile($activity)
+ public static function getActorProfile(Activity $activity)
{
return self::getActivityObjectProfile($activity->actor);
}
* @return mixed matching Ostatus_profile or false if none known
* @throws ServerException if feed info invalid
*/
- protected static function getActivityObjectProfile($object)
+ protected static function getActivityObjectProfile(ActivityObject $object)
{
$uri = self::getActivityObjectProfileURI($object);
return Ostatus_profile::getKV('uri', $uri);
* @return string
* @throws ServerException if feed info invalid
*/
- protected static function getActivityObjectProfileURI($object)
+ protected static function getActivityObjectProfileURI(ActivityObject $object)
{
if ($object->id) {
if (ActivityUtils::validateUri($object->id)) {
*
* @return Ostatus_profile
*/
- protected static function createActivityObjectProfile($object, $hints=array())
+ protected static function createActivityObjectProfile(ActivityObject $object, array $hints=array())
{
$homeuri = $object->id;
$discover = false;
if (!$homeuri) {
- common_log(LOG_DEBUG, __METHOD__ . " empty actor profile URI: " . var_export($activity, true));
+ common_debug(__METHOD__ . " empty actor profile URI: " . var_export($activity, true));
// TRANS: Exception.
throw new Exception(_m('No profile URI.'));
}
* @param ActivityObject $object
* @param array $hints
*/
- public function updateFromActivityObject($object, $hints=array())
+ public function updateFromActivityObject(ActivityObject $object, array $hints=array())
{
if ($this->isGroup()) {
$group = $this->localGroup();
}
}
- public static function updateProfile($profile, $object, $hints=array())
+ public static function updateProfile(Profile $profile, ActivityObject $object, array $hints=array())
{
$orig = clone($profile);
// @todo tags from categories
if ($profile->id) {
- common_log(LOG_DEBUG, "Updating OStatus profile $profile->id from remote info $object->id: " . var_export($object, true) . var_export($hints, true));
+ common_debug("Updating OStatus profile $profile->id from remote info $object->id: " . var_export($object, true) . var_export($hints, true));
$profile->update($orig);
}
}
- protected static function updateGroup(User_group $group, $object, $hints=array())
+ protected static function updateGroup(User_group $group, ActivityObject $object, array $hints=array())
{
$orig = clone($group);
$group->homepage = self::getActivityObjectHomepage($object, $hints);
if ($group->id) { // If no id, we haven't called insert() yet, so don't run update()
- common_log(LOG_DEBUG, "Updating OStatus group $group->id from remote info $object->id: " . var_export($object, true) . var_export($hints, true));
+ common_debug("Updating OStatus group $group->id from remote info $object->id: " . var_export($object, true) . var_export($hints, true));
$group->update($orig);
}
}
- protected static function updatePeopletag($tag, $object, $hints=array()) {
+ protected static function updatePeopletag(Peopletag $tag, ActivityObject $object, array $hints=array()) {
$orig = clone($tag);
$tag->tag = $object->title;
$tag->tagger = $tagger->profile_id;
if ($tag->id) {
- common_log(LOG_DEBUG, "Updating OStatus peopletag $tag->id from remote info $object->id: " . var_export($object, true) . var_export($hints, true));
+ common_debug("Updating OStatus peopletag $tag->id from remote info $object->id: " . var_export($object, true) . var_export($hints, true));
$tag->update($orig);
}
}
} else {
$actor = $activity->actor;
- if (empty($actor)) {
+ if (!$actor instanceof Profile) {
// OK here! assume the default
} else if ($actor->id == $this->getUri() || $actor->link == $this->getUri()) {
$this->updateFromActivityObject($actor);
public function verify(Profile $profile)
{
if ($this->alg != 'RSA-SHA256') {
- common_log(LOG_DEBUG, "Salmon error: bad algorithm");
+ common_debug("Salmon error: bad algorithm");
return false;
}
if ($this->encoding != self::ENCODING) {
- common_log(LOG_DEBUG, "Salmon error: bad encoding");
+ common_debug("Salmon error: bad encoding");
return false;
}
try {
$magicsig = $this->getKeyPair($profile, true); // Do discovery too if necessary
} catch (Exception $e) {
- common_log(LOG_DEBUG, "Salmon error: ".$e->getMessage());
+ common_debug("Salmon error: ".$e->getMessage());
return false;
}
$this->pushFeed($feed, array($this, 'peopletagFeedForNotice'), $ptag);
}
- function pingReply($oprofile)
+ function pingReply(OStatus_profile $oprofile)
{
if ($this->user) {
// For local posts, send a Salmon ping to the mentioned
// remote user or group.
// @fixme as an optimization we can skip this if the
// remote profile is subscribed to the author.
- $oprofile->notifyDeferred($this->notice, $this->user);
+ $oprofile->notifyDeferred($this->notice, $this->user->getProfile());
}
}
// Cryptographic verification test
if (!$magic_env->verify($profile)) {
- common_log(LOG_DEBUG, "Salmon signature verification failed.");
+ common_debug("Salmon signature verification failed.");
// TRANS: Client error.
$this->clientError(_m('Salmon signature verification failed.'));
}
{
parent::handle();
- common_log(LOG_DEBUG, "Got a " . $this->activity->verb);
+ common_debug("Got a " . $this->activity->verb);
try {
if (Event::handle('StartHandleSalmonTarget', array($this->activity, $this->target)) &&
Event::handle('StartHandleSalmon', array($this->activity))) {
* @throws Exception on various error conditions
* @throws OStatusShadowException if this reference would obscure a local user/group
*/
- public static function updateProfileURL($profile_url, $hints=array())
+ public static function updateProfileURL($profile_url, array $hints=array())
{
$oprofile = null;
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return true;
}
class OfflineBackupPlugin extends Plugin
{
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect('main/backupaccount',
array('action' => 'offlinebackup'));
return true;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'OfflineBackup',
'version' => GNUSOCIAL_VERSION,
return true;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'OpenExternalLinkTarget',
'version' => GNUSOCIAL_VERSION,
*
* Hook for RouterInitialized event.
*
- * @param Net_URL_Mapper $m URL mapper
+ * @param URLMapper $m URL mapper
*
* @return boolean hook return
*/
*
* @return boolean hook value
*/
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'OpenID',
'version' => GNUSOCIAL_VERSION,
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
if (!common_logged_in()) {
var $username = null;
var $message = null;
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
if (common_is_real_login()) {
class OpenidloginAction extends Action
{
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
if (common_is_real_login()) {
{
var $oserver;
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
$this->oserver = oid_server();
return true;
}
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
$request = $this->oserver->decodeRequest();
*
* @return boolean false
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return false;
}
return _m('OpenID Identity Verification');
}
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
common_ensure_session();
return true;
}
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
if($_SERVER['REQUEST_METHOD'] == 'POST'){
$match = in_array($requiredTeam, $teams);
$is = $match ? 'is' : 'is not';
- common_log(LOG_DEBUG, "Remote user $is in required team $requiredTeam: [" . implode(', ', $teams) . "]");
+ common_debug("Remote user $is in required team $requiredTeam: [" . implode(', ', $teams) . "]");
return $match;
}
var $form_html = null;
var $form_id = null;
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
$this->showPage();
return true;
}
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect('panel/openx',
array('action' => 'openxadminpanel'));
*
* @return boolean hook value
*/
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'OpenX',
'version' => GNUSOCIAL_VERSION,
<?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'));
}
return true;
}
- public function onPluginVersion(&$versions)
+ public function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'OpportunisticQM',
'version' => GNUSOCIAL_VERSION,
*
* @return boolean hook value
*/
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'Orbited',
'version' => GNUSOCIAL_VERSION,
return true;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'PiwikAnalytics',
'version' => GNUSOCIAL_VERSION,
/**
* 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'));
*
* @return value
*/
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'Poll',
'version' => self::VERSION,
function saveNoticeFromActivity(Activity $activity, Profile $profile, array $options=array())
{
// @fixme
- common_log(LOG_DEBUG, "XXX activity: " . var_export($activity, true));
- common_log(LOG_DEBUG, "XXX profile: " . var_export($profile, true));
- common_log(LOG_DEBUG, "XXX options: " . var_export($options, true));
+ common_debug("XXX activity: " . var_export($activity, true));
+ common_debug("XXX profile: " . var_export($profile, true));
+ common_debug("XXX options: " . var_export($options, true));
// Ok for now, we can grab stuff from the XML entry directly.
// This won't work when reading from JSON source
}
try {
$notice = Poll::saveNew($profile, $question, $opts, $options);
- common_log(LOG_DEBUG, "Saved Poll from ActivityStream data ok: notice id " . $notice->id);
+ common_debug("Saved Poll from ActivityStream data ok: notice id " . $notice->id);
return $notice;
} catch (Exception $e) {
- common_log(LOG_DEBUG, "Poll save from ActivityStream data failed: " . $e->getMessage());
+ common_debug("Poll save from ActivityStream data failed: " . $e->getMessage());
}
} else if ($responseElements->length) {
$data = $responseElements->item(0);
}
try {
$notice = Poll_response::saveNew($profile, $poll, $selection, $options);
- common_log(LOG_DEBUG, "Saved Poll_response ok, notice id: " . $notice->id);
+ common_debug("Saved Poll_response ok, notice id: " . $notice->id);
return $notice;
} catch (Exception $e) {
- common_log(LOG_DEBUG, "Poll response save fail: " . $e->getMessage());
+ common_debug("Poll response save fail: " . $e->getMessage());
}
} else {
- common_log(LOG_DEBUG, "YYY no poll data");
+ common_debug("YYY no poll data");
}
}
}
*/
public function activityObjectOutputJson(ActivityObject $obj, array &$out)
{
- common_log(LOG_DEBUG, 'QQQ: ' . var_export($obj, true));
+ common_debug('QQQ: ' . var_export($obj, true));
if (isset($obj->pollQuestion)) {
/**
* "poll": {
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
$_SERVER['REQUEST_METHOD'] == 'HEAD') {
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
$_SERVER['REQUEST_METHOD'] == 'HEAD') {
array('id' => $p->id));
}
- common_log(LOG_DEBUG, "Saving poll: $p->id $p->uri");
+ common_debug("Saving poll: $p->id $p->uri");
$p->insert();
// TRANS: Notice content creating a poll.
array('id' => $pr->id));
}
- common_log(LOG_DEBUG, "Saving poll response: $pr->id $pr->uri");
+ common_debug("Saving poll response: $pr->id $pr->uri");
$pr->insert();
// TRANS: Notice content voting for a poll.
}
}
- public function onPluginVersion(&$versions)
+ public function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'PostDebug',
'version' => GNUSOCIAL_VERSION,
$file = $this->dir . DIRECTORY_SEPARATOR . $this->logFileName();
file_put_contents($file, $output);
} else {
- common_log(LOG_DEBUG, "PostDebug: $output");
+ common_debug("PostDebug: $output");
}
}
@$dom->loadHTML($response);
$y = @simplexml_import_dom($dom);
if (!isset($y->body)) return;
+ // @TODO Super-ugly style???
$xml = $y->body->center->table->tr->td->pre->a->attributes();
if (isset($xml['href'])) {
return strval($xml['href']);
}
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => sprintf('PtitUrl (%s)', $this->shortenerName),
'version' => GNUSOCIAL_VERSION,
/**
* 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 true;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array(
'name' => 'QnA',
{
switch ($notice->object_type) {
case QnA_Question::OBJECT_TYPE:
- common_log(LOG_DEBUG, "Deleting question from notice...");
+ common_debug("Deleting question from notice...");
$question = QnA_Question::fromNotice($notice);
$question->delete();
break;
case QnA_Answer::OBJECT_TYPE:
- common_log(LOG_DEBUG, "Deleting answer from notice...");
+ common_debug("Deleting answer from notice...");
$answer = QnA_Answer::fromNotice($notice);
- common_log(LOG_DEBUG, "to delete: $answer->id");
+ common_debug("to delete: $answer->id");
$answer->delete();
break;
default:
- common_log(LOG_DEBUG, "Not deleting related, wtf...");
+ common_debug("Not deleting related, wtf...");
}
}
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
$_SERVER['REQUEST_METHOD'] == 'HEAD') {
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
$_SERVER['REQUEST_METHOD'] == 'HEAD') {
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
$_SERVER['REQUEST_METHOD'] == 'HEAD') {
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
$_SERVER['REQUEST_METHOD'] == 'HEAD') {
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
$_SERVER['REQUEST_METHOD'] == 'HEAD') {
array('id' => $answer->id)
);
- common_log(LOG_DEBUG, "Saving answer: $answer->id, $answer->uri");
+ common_debug("Saving answer: $answer->id, $answer->uri");
$answer->insert();
$content = sprintf(
);
}
- common_log(LOG_DEBUG, "Saving question: $q->id $q->uri");
+ common_debug("Saving question: $q->id $q->uri");
$q->insert();
if (Notice::contentTooLong($q->title . ' ' . $q->uri)) {
$v->vote = $vote;
$v->created = common_sql_now();
- common_log(LOG_DEBUG, "Saving vote: $v->id $v->vote");
+ common_debug("Saving vote: $v->id $v->vote");
$v->insert();
}
*
* @return boolean hook return
*/
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect('/main/rsscloud/request_notify',
array('action' => 'RSSCloudRequestNotify'));
* @return boolean hook return
*/
- function onStartEnqueueNotice($notice, &$transports)
+ function onStartEnqueueNotice(Notice $notice, array &$transports)
{
if ($notice->isLocal()) {
array_push($transports, 'rsscloud');
return true;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'RSSCloud',
'version' => RSSCLOUDPLUGIN_VERSION,
*
* @return boolean false if user doesn't exist
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
*
* @return boolean false if user doesn't exist
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
/**
* 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'),
* MAY override
*
* @param array $args other arguments
- *
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return false;
}
* MAY override
*
* @param array $args other arguments
- *
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return false;
}
}
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'Recaptcha',
'version' => GNUSOCIAL_VERSION,
*
* @return boolean hook value
*/
- public function onPluginVersion(&$versions)
+ public function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'RegisterThrottle',
'version' => GNUSOCIAL_VERSION,
*/
public $disallowLogin = false;
- function onRouterInitialized($m)
+ function onRouterInitialized(URLMapper $m)
{
$m->connect('main/confirmfirst/:code',
array('action' => 'confirmfirstemail'));
*
* @return boolean hook value
*/
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] =
array('name' => 'Require Validated Email',
return User::register($registration_data);
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'Reverse Username Authentication',
'version' => GNUSOCIAL_VERSION,
{
private $recursionGuard = false;
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'SQLProfile',
'version' => GNUSOCIAL_VERSION,
(strpos($extra, 'Using temporary') !== false);
if ($evil) {
$xquery = $xobj->sanitizeQuery($query);
- common_log(LOG_DEBUG, "$extra | $xquery");
+ common_debug("$extra | $xquery");
}
}
}
protected $queryTimes = array();
protected $queries = array();
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'SQLStats',
'version' => GNUSOCIAL_VERSION,
* 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'));
return true;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'Sample',
'version' => GNUSOCIAL_VERSION,
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return false;
}
/**
* 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'),
*
* @return value
*/
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'SearchSub',
'version' => self::VERSION,
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
if ($this->boolean('ajax')) {
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
// Throws exception on error
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
// Throws exception on error
*
* @return boolean hook value
*/
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$url = 'http://status.net/wiki/Plugin:ShareNotice';
return $this->http_get(sprintf($this->serviceUrl,urlencode($url)));
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => sprintf('SimpleUrl (%s)', $this->shortenerName),
'version' => GNUSOCIAL_VERSION,
/**
* 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'));
*
* @return boolean hook value
*/
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$url = 'http://status.net/wiki/Plugin:Sitemap';
var $notices = null;
var $j = 0;
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
header('Content-Type: text/xml; charset=UTF-8');
$this->startXML();
var $users = null;
var $j = 0;
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
/**
* 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'),
*
* @return boolean hook value
*/
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$url = 'http://status.net/wiki/Plugin:SlicedFavorites';
*
* @todo move queries from showContent() to here
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return boolean hook value
*/
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$url = 'http://status.net/wiki/Plugin:SphinxSearch';
return true;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'Spotify',
'version' => SPOTIFYPLUGIN_VERSION,
}
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'StrictTransportSecurity',
'version' => GNUSOCIAL_VERSION,
/**
* 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'));
}
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'SubMirror',
'version' => GNUSOCIAL_VERSION,
return true;
}
- function onStartEnqueueNotice($notice, &$transports)
+ function onStartEnqueueNotice(Notice $notice, array &$transports)
{
$transports[] = 'mirror';
}
*
* @todo move the ajax display handling to common code
*/
- function handle($args)
+ function handle(array $args=array())
{
if ($this->boolean('ajax')) {
$this->startHTML('text/xml;charset=utf-8');
*
* @return boolean hook value
*/
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'SubscriptionThrottle',
'version' => GNUSOCIAL_VERSION,
$action->script($this->path('tabfocus.js'));
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'TabFocus',
'version' => GNUSOCIAL_VERSION,
/**
* 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'),
*
* @return value
*/
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'TagSub',
'version' => self::VERSION,
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
if ($this->boolean('ajax')) {
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
// Throws exception on error
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
// Throws exception on error
}
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => sprintf('TightUrl (%s)', $this->shortenerName),
'version' => GNUSOCIAL_VERSION,
return true;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'TinyMCE',
'version' => GNUSOCIAL_VERSION,
*
* 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'));
*
* @return boolean hook return
*/
- function onStartEnqueueNotice($notice, &$transports)
+ function onStartEnqueueNotice(Notice $notice, array &$transports)
{
if (self::hasKeys() && $notice->isLocal() && $notice->inScope(null)) {
// Avoid a possible loop
*
* @return boolean hook return
*/
- function onGetValidDaemons(&$daemons)
+ function onGetValidDaemons(array &$daemons)
{
if (self::hasKeys()) {
array_push(
*
* @return boolean hook value
*/
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array(
'name' => 'TwitterBridge',
*
* @return boolean true
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return nothing
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
*/
class TwitterloginAction extends Action
{
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
return;
}
- common_log(LOG_DEBUG, $this->name() . ' - Trying to get ' . $timelineUri .
+ common_debug($this->name() . ' - Trying to get ' . $timelineUri .
' timeline for Twitter user ' . $flink->foreign_id);
$client = null;
if (TwitterOAuthClient::isPackedToken($flink->credentials)) {
$token = TwitterOAuthClient::unpackToken($flink->credentials);
$client = new TwitterOAuthClient($token->key, $token->secret);
- common_log(LOG_DEBUG, $this->name() . ' - Grabbing ' . $timelineUri . ' timeline with OAuth.');
+ common_debug($this->name() . ' - Grabbing ' . $timelineUri . ' timeline with OAuth.');
} else {
common_log(LOG_ERR, "Skipping " . $timelineUri . " timeline for " .
$flink->foreign_id . " since not OAuth.");
$lastId = Twitter_synch_status::getLastId($flink->foreign_id, $timelineUri);
- common_log(LOG_DEBUG, "Got lastId value '" . $lastId . "' for foreign id '" .
+ common_debug("Got lastId value '" . $lastId . "' for foreign id '" .
$flink->foreign_id . "' and timeline '" . $timelineUri. "'");
try {
*/
public function connect($url)
{
- common_log(LOG_DEBUG, "$this->id opening connection to $url");
+ common_debug("$this->id opening connection to $url");
$scheme = parse_url($url, PHP_URL_SCHEME);
if ($scheme == 'http') {
public function close()
{
if ($this->isConnected()) {
- common_log(LOG_DEBUG, "$this->id closing connection.");
+ common_debug("$this->id closing connection.");
fclose($this->socket);
$this->socket = null;
}
// TRANS: %1$s is the response code, %2$s is the line.
throw new Exception(sprintf(_m('Bad HTTP response code %1$s: %2$s.'),$status,$line));
}
- common_log(LOG_DEBUG, "$this->id $line");
+ common_debug("$this->id $line");
$this->state = 'headers';
}
{
if ($line == '') {
$this->state = 'active';
- common_log(LOG_DEBUG, "$this->id connection is active!");
+ common_debug("$this->id connection is active!");
} else {
- common_log(LOG_DEBUG, "$this->id read HTTP header: $line");
+ common_debug("$this->id read HTTP header: $line");
$this->responseHeaders[] = $line;
}
}
if ($notice instanceof Notice) {
$flink = Foreign_link::getByForeignID($receiver, TWITTER_SERVICE);
if ($flink instanceof Foreign_link) {
- common_log(LOG_DEBUG, "TweetInQueueHandler - Got flink so add notice ".
+ common_debug("TweetInQueueHandler - Got flink so add notice ".
$notice->id." to attentions for user ".$flink->user_id);
try {
Attention::saveNew($notice, $flink->getProfile());
$e->getMessage());
}
} else {
- common_log(LOG_DEBUG, "TweetInQueueHandler - No flink found for foreign user ".$receiver);
+ common_debug("TweetInQueueHandler - No flink found for foreign user ".$receiver);
}
}
/**
* 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'));
*
* @return boolean hook value
*/
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$url = 'http://status.net/wiki/Plugin:UserFlag';
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
parent::handle($args);
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
if (!parent::prepare($args)) {
return false;
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$this->handlePost();
*
* @return boolean success flag
*/
- function prepare($args)
+ function prepare(array $args=array())
{
if (!parent::prepare($args)) {
return false;
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$this->handlePost();
}
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'UserLimit',
'version' => GNUSOCIAL_VERSION,
return false;
}
- public function onPluginVersion(&$versions)
+ public function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'Video Thumbnails',
'version' => GNUSOCIAL_VERSION,
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',
}
}
- public function onPluginVersion(&$versions)
+ public function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'WebFinger',
'version' => GNUSOCIAL_VERSION,
protected $xrd = null;
- public function isReadOnly($args)
+ public function isReadOnly(array $args=array())
{
return true;
}
return true;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'WikiHashtags',
'version' => self::VERSION,
*/
class WikiHowProfilePlugin extends Plugin
{
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'WikiHow avatar fetcher',
'version' => GNUSOCIAL_VERSION,
$absolute = $base->resolve($src);
$avatarUrl = strval($absolute);
- common_log(LOG_DEBUG, "WikiHow avatar found for $profileUrl - $avatarUrl");
+ common_debug("WikiHow avatar found for $profileUrl - $avatarUrl");
$data['avatar'] = $avatarUrl;
}
return false;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'XCache',
'version' => GNUSOCIAL_VERSION,
*
* @return boolean hook return
*/
- function onGetValidDaemons(&$daemons)
+ function onGetValidDaemons(array &$daemons)
{
if( isset($this->server) &&
isset($this->port) &&
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'XMPP',
'version' => GNUSOCIAL_VERSION,
{
// Process the queue for as long as needed
try {
- common_log(LOG_DEBUG, "Servicing the XMPP queue.");
+ common_debug("Servicing the XMPP queue.");
$this->stats('xmpp_process');
$this->conn->processTime(0);
} catch (XMPPHP_Exception $e) {
$this->pingid++;
}
- common_log(LOG_DEBUG, "Sending ping #{$this->pingid}");
+ common_debug("Sending ping #{$this->pingid}");
$this->conn->send("<iq from='{" . $this->plugin->daemonScreenname() . "}' to='{$this->plugin->server}' id='ping_{$this->pingid}' type='get'><ping xmlns='urn:xmpp:ping'/></iq>");
$this->lastping = $now;
return true;
/**
* 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'));
'imports done by verified administrators on the Yammer side.');
}
- function prepare($args)
+ function prepare(array $args=array())
{
$ok = parent::prepare($args);
return $ok;
}
- function handle($args)
+ function handle(array $args=array())
{
// @fixme move this to saveSettings and friends?
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
*
* @return void
*/
- function prepare($args)
+ function prepare(array $args=array())
{
parent::prepare($args);
*
* @return void
*/
- function handle($args)
+ function handle(array $args=array())
{
if ($this->verify_token) {
$runner->saveAuthToken($this->verify_token);