summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/common.php18
-rw-r--r--lib/deleteaction.php4
-rw-r--r--lib/facebookaction.php6
-rw-r--r--lib/oauthstore.php16
-rw-r--r--lib/omb.php14
-rw-r--r--lib/openid.php12
-rw-r--r--lib/personal.php2
-rw-r--r--lib/profilelist.php8
-rw-r--r--lib/queuehandler.php8
-rw-r--r--lib/rssaction.php32
-rw-r--r--lib/searchaction.php10
-rw-r--r--lib/settingsaction.php6
-rw-r--r--lib/twitter.php4
-rw-r--r--lib/twitterapi.php74
-rw-r--r--lib/xmppqueuehandler.php6
15 files changed, 110 insertions, 110 deletions
diff --git a/lib/common.php b/lib/common.php
index 95ba64d0f..3e162f781 100644
--- a/lib/common.php
+++ b/lib/common.php
@@ -58,16 +58,16 @@ $config =
'server' => 'localhost',
'theme' => 'default',
'path' => '/',
- 'logfile' => NULL,
+ 'logfile' => null,
'fancy' => false,
'locale_path' => INSTALLDIR.'/locale',
'language' => 'en_US',
'languages' => get_all_languages(),
'email' =>
- array_key_exists('SERVER_ADMIN', $_SERVER) ? $_SERVER['SERVER_ADMIN'] : NULL,
- 'broughtby' => NULL,
+ array_key_exists('SERVER_ADMIN', $_SERVER) ? $_SERVER['SERVER_ADMIN'] : null,
+ 'broughtby' => null,
'timezone' => 'UTC',
- 'broughtbyurl' => NULL,
+ 'broughtbyurl' => null,
'closed' => false,
'inviteonly' => false,
'private' => false),
@@ -82,19 +82,19 @@ $config =
'image' => 'http://i.creativecommons.org/l/by/3.0/88x31.png'),
'mail' =>
array('backend' => 'mail',
- 'params' => NULL),
+ 'params' => null),
'nickname' =>
array('blacklist' => array(),
'featured' => array()),
'profile' =>
array('banned' => array()),
'avatar' =>
- array('server' => NULL),
+ array('server' => null),
'public' =>
array('localonly' => true,
'blacklist' => array()),
'theme' =>
- array('server' => NULL),
+ array('server' => null),
'throttle' =>
array('enabled' => false, // whether to throttle edits; false by default
'count' => 20, // number of allowed messages in timespan
@@ -107,7 +107,7 @@ $config =
'encryption' => true,
'resource' => 'uniquename',
'password' => 'blahblahblah',
- 'host' => NULL, # only set if != server
+ 'host' => null, # only set if != server
'debug' => false, # print extra debug info
'public' => array()), # JIDs of users who want to receive the public stream
'sphinx' =>
@@ -140,7 +140,7 @@ $config['db'] =
'class_location' => INSTALLDIR . '/classes',
'require_prefix' => 'classes/',
'class_prefix' => '',
- 'mirror' => NULL,
+ 'mirror' => null,
'db_driver' => 'DB', # XXX: JanRain libs only work with DB
'quote_identifiers' => false,
'type' => 'mysql' );
diff --git a/lib/deleteaction.php b/lib/deleteaction.php
index 335070cc4..a7de6b8fb 100644
--- a/lib/deleteaction.php
+++ b/lib/deleteaction.php
@@ -43,7 +43,7 @@ class DeleteAction extends Action {
}
}
- function show_top($arr=NULL) {
+ function show_top($arr=null) {
$instr = $this->get_instructions();
$output = common_markup_to_html($instr);
common_element_start('div', 'instructions');
@@ -52,7 +52,7 @@ class DeleteAction extends Action {
}
function get_title() {
- return NULL;
+ return null;
}
function show_header() {
diff --git a/lib/facebookaction.php b/lib/facebookaction.php
index 67595861f..731460f12 100644
--- a/lib/facebookaction.php
+++ b/lib/facebookaction.php
@@ -81,7 +81,7 @@ class FacebookAction extends Action {
$fbml_main = "<fb:narrow>$content $html</fb:narrow>";
- $facebook->api_client->profile_setFBML(NULL, $fbuid, $fbml, NULL, NULL, $fbml_main);
+ $facebook->api_client->profile_setFBML(null, $fbuid, $fbml, null, null, $fbml_main);
}
# Display methods
@@ -235,7 +235,7 @@ class FacebookAction extends Action {
return $html;
}
- function pagination($have_before, $have_after, $page, $fbaction, $args=NULL) {
+ function pagination($have_before, $have_after, $page, $fbaction, $args=null) {
$html = '';
@@ -266,7 +266,7 @@ class FacebookAction extends Action {
}
}
- function pagination_url($fbaction, $args=NULL) {
+ function pagination_url($fbaction, $args=null) {
global $config;
$extra = '';
diff --git a/lib/oauthstore.php b/lib/oauthstore.php
index aa705be30..421b618b7 100644
--- a/lib/oauthstore.php
+++ b/lib/oauthstore.php
@@ -33,7 +33,7 @@ class LaconicaOAuthDataStore extends OAuthDataStore {
$con->seed = common_good_rand(16);
$con->created = DB_DataObject_Cast::dateTime();
if (!$con->insert()) {
- return NULL;
+ return null;
}
}
return new OAuthConsumer($con->consumer_key, '');
@@ -47,7 +47,7 @@ class LaconicaOAuthDataStore extends OAuthDataStore {
if ($t->find(true)) {
return new OAuthToken($t->tok, $t->secret);
} else {
- return NULL;
+ return null;
}
}
@@ -75,7 +75,7 @@ class LaconicaOAuthDataStore extends OAuthDataStore {
$t->state = 0; # unauthorized
$t->created = DB_DataObject_Cast::dateTime();
if (!$t->insert()) {
- return NULL;
+ return null;
} else {
return new OAuthToken($t->tok, $t->secret);
}
@@ -104,35 +104,35 @@ class LaconicaOAuthDataStore extends OAuthDataStore {
if (!$at->insert()) {
$e = $at->_lastError;
common_debug('access token "'.$at->tok.'" not inserted: "'.$e->message.'"', __FILE__);
- return NULL;
+ return null;
} else {
common_debug('access token "'.$at->tok.'" inserted', __FILE__);
# burn the old one
$orig_rt = clone($rt);
$rt->state = 2; # used
if (!$rt->update($orig_rt)) {
- return NULL;
+ return null;
}
common_debug('request token "'.$rt->tok.'" updated', __FILE__);
# Update subscription
# XXX: mixing levels here
$sub = Subscription::staticGet('token', $rt->tok);
if (!$sub) {
- return NULL;
+ return null;
}
common_debug('subscription for request token found', __FILE__);
$orig_sub = clone($sub);
$sub->token = $at->tok;
$sub->secret = $at->secret;
if (!$sub->update($orig_sub)) {
- return NULL;
+ return null;
} else {
common_debug('subscription updated to use access token', __FILE__);
return new OAuthToken($at->tok, $at->secret);
}
}
} else {
- return NULL;
+ return null;
}
}
diff --git a/lib/omb.php b/lib/omb.php
index 94ccc2ecd..8199b0679 100644
--- a/lib/omb.php
+++ b/lib/omb.php
@@ -44,7 +44,7 @@ define('OAUTH_POST_BODY', OAUTH_NAMESPACE.'parameters/post-body');
define('OAUTH_HMAC_SHA1', OAUTH_NAMESPACE.'signature/HMAC-SHA1');
function omb_oauth_consumer() {
- static $con = NULL;
+ static $con = null;
if (!$con) {
$con = new OAuthConsumer(common_root_url(), '');
}
@@ -61,7 +61,7 @@ function omb_oauth_server() {
}
function omb_oauth_datastore() {
- static $store = NULL;
+ static $store = null;
if (!$store) {
$store = new LaconicaOAuthDataStore();
}
@@ -69,7 +69,7 @@ function omb_oauth_datastore() {
}
function omb_hmac_sha1() {
- static $hmac_method = NULL;
+ static $hmac_method = null;
if (!$hmac_method) {
$hmac_method = new OAuthSignatureMethod_HMAC_SHA1();
}
@@ -91,22 +91,22 @@ function omb_match_service($service, $type) {
function omb_service_uri($service) {
if (!$service) {
- return NULL;
+ return null;
}
$uris = $service->getURIs();
if (!$uris) {
- return NULL;
+ return null;
}
return $uris[0];
}
function omb_local_id($service) {
if (!$service) {
- return NULL;
+ return null;
}
$els = $service->getElements('xrd:LocalID');
if (!$els) {
- return NULL;
+ return null;
}
$el = $els[0];
return $service->parser->content($el);
diff --git a/lib/openid.php b/lib/openid.php
index ebc5ed168..3ca359fa1 100644
--- a/lib/openid.php
+++ b/lib/openid.php
@@ -32,7 +32,7 @@ define('OPENID_COOKIE_EXPIRY', round(365.25 * 24 * 60 * 60));
define('OPENID_COOKIE_KEY', 'lastusedopenid');
function oid_store() {
- static $store = NULL;
+ static $store = null;
if (!$store) {
# Can't be called statically
$user = new User();
@@ -63,7 +63,7 @@ function oid_get_last() {
if ($openid_url && strlen($openid_url) > 0) {
return $openid_url;
} else {
- return NULL;
+ return null;
}
}
@@ -85,7 +85,7 @@ function oid_link_user($id, $canonical, $display) {
}
function oid_get_user($openid_url) {
- $user = NULL;
+ $user = null;
$oid = User_openid::staticGet('canonical', $openid_url);
if ($oid) {
$user = User::staticGet('id', $oid->user_id);
@@ -93,7 +93,7 @@ function oid_get_user($openid_url) {
return $user;
}
-function oid_check_immediate($openid_url, $backto=NULL) {
+function oid_check_immediate($openid_url, $backto=null) {
if (!$backto) {
$action = $_REQUEST['action'];
$args = common_copy_args($_GET);
@@ -177,9 +177,9 @@ function oid_authenticate($openid_url, $returnto, $immediate=false) {
if (Auth_OpenID::isFailure($form_html)) {
$this->show_form(sprintf(_('Could not create OpenID form: %s'), $form_html->message));
} else {
- common_show_header(_('OpenID Auto-Submit'), NULL, NULL, '_oid_print_instructions');
+ common_show_header(_('OpenID Auto-Submit'), null, null, '_oid_print_instructions');
common_raw($form_html);
- common_element('script', NULL,
+ common_element('script', null,
'$(document).ready(function() { ' .
' $("#'. $form_id .'").submit(); '.
'});');
diff --git a/lib/personal.php b/lib/personal.php
index 1928349a3..7ff9305f1 100644
--- a/lib/personal.php
+++ b/lib/personal.php
@@ -32,7 +32,7 @@ class PersonalAction extends Action {
function views_menu() {
- $user = NULL;
+ $user = null;
$action = $this->trimmed('action');
$nickname = $this->trimmed('nickname');
diff --git a/lib/profilelist.php b/lib/profilelist.php
index e32c5c254..9929c8647 100644
--- a/lib/profilelist.php
+++ b/lib/profilelist.php
@@ -24,11 +24,11 @@ define('PROFILES_PER_PAGE', 20);
class ProfileList {
- var $profile = NULL;
- var $owner = NULL;
- var $action = NULL;
+ var $profile = null;
+ var $owner = null;
+ var $action = null;
- function __construct($profile, $owner=NULL, $action=NULL) {
+ function __construct($profile, $owner=null, $action=null) {
$this->profile = $profile;
$this->owner = $owner;
$this->action = $action;
diff --git a/lib/queuehandler.php b/lib/queuehandler.php
index 5e3905f59..ecf58f69f 100644
--- a/lib/queuehandler.php
+++ b/lib/queuehandler.php
@@ -29,7 +29,7 @@ class QueueHandler extends Daemon {
var $_id = 'generic';
- function QueueHandler($id=NULL) {
+ function QueueHandler($id=null) {
if ($id) {
$this->set_id($id);
}
@@ -52,7 +52,7 @@ class QueueHandler extends Daemon {
}
function transport() {
- return NULL;
+ return null;
}
function start() {
@@ -83,7 +83,7 @@ class QueueHandler extends Daemon {
if (!$result) {
$this->log(LOG_WARNING, 'Failed broadcast for notice ID = ' . $notice->id);
$orig = $qi;
- $qi->claimed = NULL;
+ $qi->claimed = null;
$qi->update($orig);
$this->log(LOG_WARNING, 'Abandoned claim for notice ID = ' . $notice->id);
continue;
@@ -91,7 +91,7 @@ class QueueHandler extends Daemon {
$this->log(LOG_INFO, 'finished broadcasting notice ID = ' . $notice->id);
$notice->free();
unset($notice);
- $notice = NULL;
+ $notice = null;
} else {
$this->log(LOG_WARNING, 'queue item for notice that does not exist');
}
diff --git a/lib/rssaction.php b/lib/rssaction.php
index b64796888..a21ce3a97 100644
--- a/lib/rssaction.php
+++ b/lib/rssaction.php
@@ -55,7 +55,7 @@ class Rss10Action extends Action {
}
function get_image() {
- return NULL;
+ return null;
}
function show_rss($limit=0) {
@@ -84,9 +84,9 @@ class Rss10Action extends Action {
$image = $this->get_image();
common_element_start('channel', array('rdf:about' => $channel['url']));
- common_element('title', NULL, $channel['title']);
- common_element('link', NULL, $channel['link']);
- common_element('description', NULL, $channel['description']);
+ common_element('title', null, $channel['title']);
+ common_element('link', null, $channel['link']);
+ common_element('description', null, $channel['description']);
common_element('cc:licence', array('rdf:resource' => common_config('license','url')));
if ($image) {
@@ -111,9 +111,9 @@ class Rss10Action extends Action {
if ($image) {
$channel = $this->get_channel();
common_element_start('image', array('rdf:about' => $image));
- common_element('title', NULL, $channel['title']);
- common_element('link', NULL, $channel['link']);
- common_element('url', NULL, $image);
+ common_element('title', null, $channel['title']);
+ common_element('link', null, $channel['link']);
+ common_element('url', null, $image);
common_element_end('image');
}
}
@@ -124,11 +124,11 @@ class Rss10Action extends Action {
$creator_uri = common_profile_uri($profile);
common_element_start('item', array('rdf:about' => $notice->uri));
$title = $profile->nickname . ': ' . common_xml_safe_str(trim($notice->content));
- common_element('title', NULL, $title);
- common_element('link', NULL, $nurl);
- common_element('description', NULL, $profile->nickname."'s status on ".common_exact_date($notice->created));
- common_element('dc:date', NULL, common_date_w3dtf($notice->created));
- common_element('dc:creator', NULL, ($profile->fullname) ? $profile->fullname : $profile->nickname);
+ common_element('title', null, $title);
+ common_element('link', null, $nurl);
+ common_element('description', null, $profile->nickname."'s status on ".common_exact_date($notice->created));
+ common_element('dc:date', null, common_date_w3dtf($notice->created));
+ common_element('dc:creator', null, ($profile->fullname) ? $profile->fullname : $profile->nickname);
common_element('sioc:has_creator', array('rdf:resource' => $creator_uri));
common_element('laconica:postIcon', array('rdf:resource' => common_profile_avatar_url($profile)));
common_element('cc:licence', array('rdf:resource' => common_config('license', 'url')));
@@ -141,11 +141,11 @@ class Rss10Action extends Action {
$id = $profile->id;
$nickname = $profile->nickname;
common_element_start('sioc:User', array('rdf:about' => $uri));
- common_element('foaf:nick', NULL, $nickname);
+ common_element('foaf:nick', null, $nickname);
if ($profile->fullname) {
- common_element('foaf:name', NULL, $profile->fullname);
+ common_element('foaf:name', null, $profile->fullname);
}
- common_element('sioc:id', NULL, $id);
+ common_element('sioc:id', null, $id);
$avatar = common_profile_avatar_url($profile);
common_element('sioc:avatar', array('rdf:resource' => $avatar));
common_element_end('sioc:User');
@@ -175,7 +175,7 @@ class Rss10Action extends Action {
'http://laconi.ca/ont/',
'xmlns' => 'http://purl.org/rss/1.0/'));
common_element_start('sioc:Site', array('rdf:about' => common_root_url()));
- common_element('sioc:name', NULL, common_config('site', 'name'));
+ common_element('sioc:name', null, common_config('site', 'name'));
common_element_start('sioc:container_of');
common_element('sioc:Container', array('rdf:about' =>
$channel['url']));
diff --git a/lib/searchaction.php b/lib/searchaction.php
index 8634bd99c..3eec91832 100644
--- a/lib/searchaction.php
+++ b/lib/searchaction.php
@@ -30,7 +30,7 @@ class SearchAction extends Action {
$this->show_form();
}
- function show_top($arr=NULL) {
+ function show_top($arr=null) {
if ($arr) {
$error = $arr[1];
}
@@ -47,14 +47,14 @@ class SearchAction extends Action {
}
function get_title() {
- return NULL;
+ return null;
}
function show_header($arr) {
return;
}
- function show_form($error=NULL) {
+ function show_form($error=null) {
global $config;
$q = $this->trimmed('q');
@@ -99,11 +99,11 @@ class SearchAction extends Action {
array(
_('People'),
_('Find people on this site'),
- ($action != 'peoplesearch' && $this->trimmed('q')) ? array('q' => $this->trimmed('q')) : NULL),
+ ($action != 'peoplesearch' && $this->trimmed('q')) ? array('q' => $this->trimmed('q')) : null),
'noticesearch' =>
array( _('Text'),
_('Find content of notices'),
- ($action != 'noticesearch' && $this->trimmed('q')) ? array('q' => $this->trimmed('q')) : NULL)
+ ($action != 'noticesearch' && $this->trimmed('q')) ? array('q' => $this->trimmed('q')) : null)
);
$this->nav_menu($menu);
}
diff --git a/lib/settingsaction.php b/lib/settingsaction.php
index 3021eb192..208d2a1b6 100644
--- a/lib/settingsaction.php
+++ b/lib/settingsaction.php
@@ -44,7 +44,7 @@ class SettingsAction extends Action {
return false;
}
- function show_form($msg=NULL, $success=false) {
+ function show_form($msg=null, $success=false) {
return false;
}
@@ -55,9 +55,9 @@ class SettingsAction extends Action {
}
}
- function form_header($title, $msg=NULL, $success=false) {
+ function form_header($title, $msg=null, $success=false) {
common_show_header($title,
- NULL,
+ null,
array($msg, $success),
array($this, 'show_top'));
}
diff --git a/lib/twitter.php b/lib/twitter.php
index c1d2de0ea..1212875ea 100644
--- a/lib/twitter.php
+++ b/lib/twitter.php
@@ -148,13 +148,13 @@ function retreive_twitter_friends($twitter_id, $screen_name, $password) {
$data = get_twitter_data($uri . $i, $screen_name, $password);
if (!$data) {
- return NULL;
+ return null;
}
$more_friends = json_decode($data);
if (!$more_friends) {
- return NULL;
+ return null;
}
$friends = array_merge($friends, $more_friends);
diff --git a/lib/twitterapi.php b/lib/twitterapi.php
index 3122caf12..ed86c77c4 100644
--- a/lib/twitterapi.php
+++ b/lib/twitterapi.php
@@ -34,15 +34,15 @@ class TwitterapiAction extends Action {
$twitter_user['name'] = $profile->getBestName();
$twitter_user['followers_count'] = $this->count_subscriptions($profile);
$twitter_user['screen_name'] = $profile->nickname;
- $twitter_user['description'] = ($profile->bio) ? $profile->bio : NULL;
- $twitter_user['location'] = ($profile->location) ? $profile->location : NULL;
+ $twitter_user['description'] = ($profile->bio) ? $profile->bio : null;
+ $twitter_user['location'] = ($profile->location) ? $profile->location : null;
$twitter_user['id'] = intval($profile->id);
$avatar = $profile->getAvatar(AVATAR_STREAM_SIZE);
$twitter_user['profile_image_url'] = ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_STREAM_SIZE);
$twitter_user['protected'] = 'false'; # not supported by Laconica yet
- $twitter_user['url'] = ($profile->homepage) ? $profile->homepage : NULL;
+ $twitter_user['url'] = ($profile->homepage) ? $profile->homepage : null;
if ($get_notice) {
$notice = $profile->getCurrentNotice();
@@ -63,10 +63,10 @@ class TwitterapiAction extends Action {
$twitter_status['text'] = $notice->content;
$twitter_status['truncated'] = 'false'; # Not possible on Laconica
$twitter_status['created_at'] = $this->date_twitter($notice->created);
- $twitter_status['in_reply_to_status_id'] = ($notice->reply_to) ? intval($notice->reply_to) : NULL;
+ $twitter_status['in_reply_to_status_id'] = ($notice->reply_to) ? intval($notice->reply_to) : null;
$twitter_status['source'] = $this->source_link($notice->source);
$twitter_status['id'] = intval($notice->id);
- $twitter_status['in_reply_to_user_id'] = ($notice->reply_to) ? $this->replier_by_reply(intval($notice->reply_to)) : NULL;
+ $twitter_status['in_reply_to_user_id'] = ($notice->reply_to) ? $this->replier_by_reply(intval($notice->reply_to)) : null;
if (isset($this->auth_user)) {
$twitter_status['favorited'] = ($this->auth_user->hasFave($notice)) ? 'true' : 'false';
@@ -157,10 +157,10 @@ class TwitterapiAction extends Action {
$this->show_twitter_xml_user($twitter_status['user']);
break;
case 'text':
- common_element($element, NULL, common_xml_safe_str($value));
+ common_element($element, null, common_xml_safe_str($value));
break;
default:
- common_element($element, NULL, $value);
+ common_element($element, null, $value);
}
}
common_element_end('status');
@@ -172,7 +172,7 @@ class TwitterapiAction extends Action {
if ($element == 'status') {
$this->show_twitter_xml_status($twitter_user['status']);
} else {
- common_element($element, NULL, $value);
+ common_element($element, null, $value);
}
}
common_element_end($role);
@@ -180,22 +180,22 @@ class TwitterapiAction extends Action {
function show_twitter_rss_item($entry) {
common_element_start('item');
- common_element('title', NULL, $entry['title']);
- common_element('description', NULL, $entry['description']);
- common_element('pubDate', NULL, $entry['pubDate']);
- common_element('guid', NULL, $entry['guid']);
- common_element('link', NULL, $entry['link']);
+ common_element('title', null, $entry['title']);
+ common_element('description', null, $entry['description']);
+ common_element('pubDate', null, $entry['pubDate']);
+ common_element('guid', null, $entry['guid']);
+ common_element('link', null, $entry['link']);
common_element_end('item');
}
function show_twitter_atom_entry($entry) {
common_element_start('entry');
- common_element('title', NULL, $entry['title']);
+ common_element('title', null, $entry['title']);
common_element('content', array('type' => 'html'), $entry['content']);
- common_element('id', NULL, $entry['id']);
- common_element('published', NULL, $entry['published']);
- common_element('updated', NULL, $entry['updated']);
- common_element('link', array('href' => $entry['link'], 'rel' => 'alternate', 'type' => 'text/html'), NULL);
+ common_element('id', null, $entry['id']);
+ common_element('published', null, $entry['published']);
+ common_element('updated', null, $entry['updated']);
+ common_element('link', array('href' => $entry['link'], 'rel' => 'alternate', 'type' => 'text/html'), null);
common_element_end('entry');
}
@@ -240,10 +240,10 @@ class TwitterapiAction extends Action {
$this->show_twitter_xml_user($value, $element);
break;
case 'text':
- common_element($element, NULL, common_xml_safe_str($value));
+ common_element($element, null, common_xml_safe_str($value));
break;
default:
- common_element($element, NULL, $value);
+ common_element($element, null, $value);
}
}
common_element_end('direct_message');
@@ -270,13 +270,13 @@ class TwitterapiAction extends Action {
$this->end_document('xml');
}
- function show_rss_timeline($notice, $title, $link, $subtitle, $suplink=NULL) {
+ function show_rss_timeline($notice, $title, $link, $subtitle, $suplink=null) {
$this->init_document('rss');
common_element_start('channel');
- common_element('title', NULL, $title);
- common_element('link', NULL, $link);
+ common_element('title', null, $title);
+ common_element('link', null, $link);
if (!is_null($suplink)) {
# For FriendFeed's SUP protocol
common_element('link', array('xmlns' => 'http://www.w3.org/2005/Atom',
@@ -284,9 +284,9 @@ class TwitterapiAction extends Action {
'href' => $suplink,
'type' => 'application/json'));
}
- common_element('description', NULL, $subtitle);
- common_element('language', NULL, 'en-us');
- common_element('ttl', NULL, '40');
+ common_element('description', null, $subtitle);
+ common_element('language', null, 'en-us');
+ common_element('ttl', null, '40');
if (is_array($notice)) {
foreach ($notice as $n) {
@@ -304,20 +304,20 @@ class TwitterapiAction extends Action {
$this->end_twitter_rss();
}
- function show_atom_timeline($notice, $title, $id, $link, $subtitle=NULL, $suplink=NULL) {
+ function show_atom_timeline($notice, $title, $id, $link, $subtitle=null, $suplink=null) {
$this->init_document('atom');
- common_element('title', NULL, $title);
- common_element('id', NULL, $id);
- common_element('link', array('href' => $link, 'rel' => 'alternate', 'type' => 'text/html'), NULL);
+ common_element('title', null, $title);
+ common_element('id', null, $id);
+ common_element('link', array('href' => $link, 'rel' => 'alternate', 'type' => 'text/html'), null);
if (!is_null($suplink)) {
# For FriendFeed's SUP protocol
common_element('link', array('rel' => 'http://api.friendfeed.com/2008/03#sup',
'href' => $suplink,
'type' => 'application/json'));
}
- common_element('subtitle', NULL, $subtitle);
+ common_element('subtitle', null, $subtitle);
if (is_array($notice)) {
foreach ($notice as $n) {
@@ -377,7 +377,7 @@ class TwitterapiAction extends Action {
} else {
common_debug("Can't get notice: $reply_id", __FILE__);
}
- return NULL;
+ return null;
}
// XXX: Candidate for a general utility method somewhere?
@@ -488,8 +488,8 @@ class TwitterapiAction extends Action {
if ($content_type == 'xml') {
$this->init_document('xml');
common_element_start('hash');
- common_element('error', NULL, $msg);
- common_element('request', NULL, $_SERVER['REQUEST_URI']);
+ common_element('error', null, $msg);
+ common_element('request', null, $_SERVER['REQUEST_URI']);
common_element_end('hash');
$this->end_document('xml');
} else {
@@ -521,7 +521,7 @@ class TwitterapiAction extends Action {
common_element_end('feed');
}
- function show_profile($profile, $content_type='xml', $notice=NULL) {
+ function show_profile($profile, $content_type='xml', $notice=null) {
$profile_array = $this->twitter_user_array($profile, true);
switch ($content_type) {
case 'xml':
@@ -537,7 +537,7 @@ class TwitterapiAction extends Action {
return;
}
- function get_user($id, $apidata=NULL) {
+ function get_user($id, $apidata=null) {
if (!$id) {
return $apidata['user'];
} else if (is_numeric($id)) {
@@ -556,7 +556,7 @@ class TwitterapiAction extends Action {
if ($user) {
return $user->getProfile();
} else {
- return NULL;
+ return null;
}
}
}
diff --git a/lib/xmppqueuehandler.php b/lib/xmppqueuehandler.php
index 33b987291..10c754a5b 100644
--- a/lib/xmppqueuehandler.php
+++ b/lib/xmppqueuehandler.php
@@ -38,14 +38,14 @@ class XmppQueueHandler extends QueueHandler {
$this->conn->addEventHandler('message', 'forward_message', $this);
$this->conn->addEventHandler('reconnect', 'handle_reconnect', $this);
$this->conn->setReconnectTimeout(600);
- jabber_send_presence("Send me a message to post a notice", 'available', NULL, 'available', -1);
+ jabber_send_presence("Send me a message to post a notice", 'available', null, 'available', -1);
}
return !is_null($this->conn);
}
function handle_reconnect(&$pl) {
$this->conn->processUntil('session_start');
- $this->conn->presence(NULL, 'available', NULL, 'available', -1);
+ $this->conn->presence(null, 'available', null, 'available', -1);
}
function idle($timeout=0) {
@@ -71,7 +71,7 @@ class XmppQueueHandler extends QueueHandler {
return;
}
$this->log(LOG_INFO, 'Forwarding message from ' . $pl['from'] . ' to ' . $listener);
- $this->conn->message($this->listener(), $pl['body'], 'chat', NULL, $this->ofrom($pl['from']));
+ $this->conn->message($this->listener(), $pl['body'], 'chat', null, $this->ofrom($pl['from']));
}
function ofrom($from) {