replace NULL with null

Another global search-and-replace update. Here, I've replaced the PHP
keyword 'NULL' with its lowercase version. This is another PEAR code
standards change.

darcs-hash:20081223192129-84dde-4a0182e0ec16a01ad88745ad3e08f7cb501aee0b.gz
This commit is contained in:
Evan Prodromou 2008-12-23 14:21:29 -05:00
parent edbc0c665c
commit eb2f9c98ac
219 changed files with 2170 additions and 28881 deletions

View File

@ -59,4 +59,12 @@ Evan Prodromou <evan@prodromou.name>**20081223191907
getting us towards phpcs-compliance. And that means better code
readability, and that means more participation.
]
[replace NULL with null
Evan Prodromou <evan@prodromou.name>**20081223192129
Another global search-and-replace update. Here, I've replaced the PHP
keyword 'NULL' with its lowercase version. This is another PEAR code
standards change.
]

View File

@ -25,7 +25,7 @@ require_once(INSTALLDIR.'/lib/rssaction.php');
class AllrssAction extends Rss10Action {
var $user = NULL;
var $user = null;
function init() {
$nickname = $this->trimmed('nickname');
@ -69,9 +69,9 @@ class AllrssAction extends Rss10Action {
$user = $this->user;
$profile = $user->getProfile();
if (!$profile) {
return NULL;
return null;
}
$avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
return ($avatar) ? $avatar->url : NULL;
return ($avatar) ? $avatar->url : null;
}
}

View File

@ -152,8 +152,8 @@ class ApiAction extends Action {
header('Content-Type: application/xml; charset=utf-8');
common_start_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');
common_end_xml();
} else if ($this->content_type == 'json') {

View File

@ -21,7 +21,7 @@ if (!defined('LACONICA')) { exit(1); }
class BlockAction extends Action {
var $profile = NULL;
var $profile = null;
function prepare($args) {
@ -77,7 +77,7 @@ class BlockAction extends Action {
common_show_header(_('Block user'));
common_element('p', NULL,
common_element('p', null,
_('Are you sure you want to block this user? '.
'Afterwards, they will be unsubscribed from you, '.
'unable to subscribe to you in the future, and '.

View File

@ -88,7 +88,7 @@ class ConfirmaddressAction extends Action {
$cur->query('COMMIT');
common_show_header(_('Confirm Address'));
common_element('p', NULL,
common_element('p', null,
sprintf(_('The address "%s" has been confirmed for your account.'), $cur->$type));
common_show_footer();
}

View File

@ -41,7 +41,7 @@ class DeletenoticeAction extends DeleteAction {
return _('Delete notice');
}
function show_form($error=NULL) {
function show_form($error=null) {
$user = common_current_user();
common_show_header($this->get_title(), array($this, 'show_header'), $error,
@ -91,7 +91,7 @@ class DeletenoticeAction extends DeleteAction {
$notice->delete();
} else {
if ($url) {
common_set_returnto(NULL);
common_set_returnto(null);
} else {
$url = common_local_url('public');
}

View File

@ -36,9 +36,9 @@ class DeleteprofileAction extends Action {
return _('Export and delete your user information.');
}
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'));
}
@ -84,9 +84,9 @@ class DeleteprofileAction extends Action {
common_element_end('li');
}
function show_form($msg=NULL, $success=false) {
function show_form($msg=null, $success=false) {
$this->form_header(_('Delete my account'), $msg, $success);
common_element('h2', NULL, _('Delete my account confirmation'));
common_element('h2', null, _('Delete my account confirmation'));
$this->show_confirm_delete_form();
common_show_footer();
}
@ -213,7 +213,7 @@ class DeleteprofileAction extends Action {
$n_users_deleted = $user->delete();
// logout and redirect to public
common_set_user(NULL);
common_set_user(null);
common_real_login(false); # not logged in
common_forgetme(); # don't log back in!
common_redirect(common_local_url('public'));

View File

@ -27,7 +27,7 @@ class EmailsettingsAction extends SettingsAction {
return _('Manage how you get email from %%site.name%%.');
}
function show_form($msg=NULL, $success=false) {
function show_form($msg=null, $success=false) {
$user = common_current_user();
$this->form_header(_('Email Settings'), $msg, $success);
common_element_start('form', array('method' => 'post',
@ -36,7 +36,7 @@ class EmailsettingsAction extends SettingsAction {
common_local_url('emailsettings')));
common_hidden('token', common_session_token());
common_element('h2', NULL, _('Address'));
common_element('h2', null, _('Address'));
if ($user->email) {
common_element_start('p');
@ -58,14 +58,14 @@ class EmailsettingsAction extends SettingsAction {
common_submit('cancel', _('Cancel'));
} else {
common_input('email', _('Email Address'),
($this->arg('email')) ? $this->arg('email') : NULL,
($this->arg('email')) ? $this->arg('email') : null,
_('Email address, like "UserName@example.org"'));
common_submit('add', _('Add'));
}
}
if ($user->email) {
common_element('h2', NULL, _('Incoming email'));
common_element('h2', null, _('Incoming email'));
if ($user->incomingemail) {
common_element_start('p');
@ -83,7 +83,7 @@ class EmailsettingsAction extends SettingsAction {
common_submit('newincoming', _('New'));
}
common_element('h2', NULL, _('Preferences'));
common_element('h2', null, _('Preferences'));
common_checkbox('emailnotifysub',
_('Send me notices of new subscriptions through email.'),
@ -118,7 +118,7 @@ class EmailsettingsAction extends SettingsAction {
if ($confirm->find(TRUE)) {
return $confirm;
} else {
return NULL;
return null;
}
}
@ -273,7 +273,7 @@ class EmailsettingsAction extends SettingsAction {
$user->query('BEGIN');
$original = clone($user);
$user->email = NULL;
$user->email = null;
$result = $user->updateKeys($original);
if (!$result) {
common_log_db_error($user, 'UPDATE', __FILE__);
@ -294,7 +294,7 @@ class EmailsettingsAction extends SettingsAction {
}
$orig = clone($user);
$user->incomingemail = NULL;
$user->incomingemail = null;
if (!$user->updateKeys($orig)) {
common_log_db_error($user, 'UPDATE', __FILE__);

View File

@ -29,7 +29,7 @@ class FavoritedAction extends StreamAction {
$page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
common_show_header(_('Popular notices'),
array($this, 'show_header'), NULL,
array($this, 'show_header'), null,
array($this, 'show_top'));
$this->show_notices($page);

View File

@ -25,7 +25,7 @@ require_once(INSTALLDIR.'/lib/rssaction.php');
class FavoritesrssAction extends Rss10Action {
var $user = NULL;
var $user = null;
function init() {
$nickname = $this->trimmed('nickname');
@ -68,6 +68,6 @@ class FavoritesrssAction extends Rss10Action {
}
function get_image() {
return NULL;
return null;
}
}

View File

@ -30,7 +30,7 @@ class FeaturedAction extends StreamAction {
$page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
common_show_header(_('Featured users'),
array($this, 'show_header'), NULL,
array($this, 'show_header'), null,
array($this, 'show_top'));
$this->show_notices($page);

View File

@ -97,7 +97,7 @@ class FinishaddopenidAction extends Action {
function message($msg) {
common_show_header(_('OpenID Login'));
common_element('p', NULL, $msg);
common_element('p', null, $msg);
common_show_footer();
}
}

View File

@ -52,7 +52,7 @@ class FinishopenidloginAction extends Action {
}
}
function show_top($error=NULL) {
function show_top($error=null) {
if ($error) {
common_element('div', array('class' => 'error'), $error);
} else {
@ -62,17 +62,17 @@ class FinishopenidloginAction extends Action {
}
}
function show_form($error=NULL, $username=NULL) {
common_show_header(_('OpenID Account Setup'), NULL, $error,
function show_form($error=null, $username=null) {
common_show_header(_('OpenID Account Setup'), null, $error,
array($this, 'show_top'));
common_element_start('form', array('method' => 'post',
'id' => 'account_connect',
'action' => common_local_url('finishopenidlogin')));
common_hidden('token', common_session_token());
common_element('h2', NULL,
common_element('h2', null,
_('Create new account'));
common_element('p', NULL,
common_element('p', null,
_('Create a new user with this nickname.'));
common_input('newname', _('New nickname'),
($username) ? $username : '',
@ -88,9 +88,9 @@ class FinishopenidloginAction extends Action {
common_text(_(' except this private data: password, email address, IM address, phone number.'));
common_element_end('p');
common_submit('create', _('Create'));
common_element('h2', NULL,
common_element('h2', null,
_('Connect existing account'));
common_element('p', NULL,
common_element('p', null,
_('If you already have an account, login with your username and password to connect it to your OpenID.'));
common_input('nickname', _('Existing nickname'));
common_password('password', _('Password'));
@ -141,14 +141,14 @@ class FinishopenidloginAction extends Action {
$this->go_home($user->nickname);
} else {
$this->save_values($display, $canonical, $sreg);
$this->show_form(NULL, $this->best_new_nickname($display, $sreg));
$this->show_form(null, $this->best_new_nickname($display, $sreg));
}
}
}
function message($msg) {
common_show_header(_('OpenID Login'));
common_element('p', NULL, $msg);
common_element('p', null, $msg);
common_show_footer();
}
@ -290,7 +290,7 @@ class FinishopenidloginAction extends Action {
$url = common_get_returnto();
if ($url) {
# We don't have to return to it again
common_set_returnto(NULL);
common_set_returnto(null);
} else {
$url = common_local_url('all',
array('nickname' =>
@ -329,7 +329,7 @@ class FinishopenidloginAction extends Action {
# XXX: others?
return NULL;
return null;
}
function is_new_nickname($str) {
@ -369,7 +369,7 @@ class FinishopenidloginAction extends Action {
foreach ($bad as $badpart) {
if (array_key_exists($badpart, $parts)) {
return NULL;
return null;
}
}
@ -403,14 +403,14 @@ class FinishopenidloginAction extends Action {
}
}
return NULL;
return null;
}
function xri_to_nickname($xri) {
$base = $this->xri_base($xri);
if (!$base) {
return NULL;
return null;
} else {
# =evan.prodromou
# or @gratis*evan.prodromou

View File

@ -278,7 +278,7 @@ class FinishremotesubscribeAction extends Action {
common_debug('got result: "'.print_r($result,TRUE).'"', __FILE__);
if ($result->status != 200) {
return NULL;
return null;
}
parse_str($result->body, $return);

View File

@ -66,21 +66,21 @@ class FoafAction extends Action {
# XXX: might not be a person
common_element_start('Person', array('rdf:about' =>
$user->uri));
common_element('mbox_sha1sum', NULL, sha1('mailto:' . $user->email));
common_element('mbox_sha1sum', null, sha1('mailto:' . $user->email));
if ($profile->fullname) {
common_element('name', NULL, $profile->fullname);
common_element('name', null, $profile->fullname);
}
if ($profile->homepage) {
common_element('homepage', array('rdf:resource' => $profile->homepage));
}
if ($profile->bio) {
common_element('rdfs:comment', NULL, $profile->bio);
common_element('rdfs:comment', null, $profile->bio);
}
# XXX: more structured location data
if ($profile->location) {
common_element_start('based_near');
common_element_start('geo:SpatialThing');
common_element('name', NULL, $profile->location);
common_element('name', null, $profile->location);
common_element_end('geo:SpatialThing');
common_element_end('based_near');
}
@ -156,7 +156,7 @@ class FoafAction extends Action {
common_element_end('Person');
foreach ($person as $uri => $p) {
$foaf_url = NULL;
$foaf_url = null;
if ($p[1] instanceof User) {
$foaf_url = common_local_url('foaf', array('nickname' => $p[1]->nickname));
}
@ -166,7 +166,7 @@ class FoafAction extends Action {
common_element('knows', array('rdf:resource' => $user->uri));
}
$this->show_microblogging_account($profile, ($p[1] instanceof User) ?
common_root_url() : NULL);
common_root_url() : null);
if ($foaf_url) {
common_element('rdfs:seeAlso', array('rdf:resource' => $foaf_url));
}
@ -186,7 +186,7 @@ class FoafAction extends Action {
common_element_end('PersonalProfileDocument');
}
function show_microblogging_account($profile, $service=NULL) {
function show_microblogging_account($profile, $service=null) {
# Their account
common_element_start('holdsAccount');
common_element_start('OnlineAccount');
@ -194,7 +194,7 @@ class FoafAction extends Action {
common_element('accountServiceHomepage', array('rdf:resource' =>
$service));
}
common_element('accountName', NULL, $profile->nickname);
common_element('accountName', null, $profile->nickname);
common_element('homepage', array('rdf:resource' => $profile->profileurl));
common_element_end('OnlineAccount');
common_element_end('holdsAccount');

View File

@ -28,7 +28,7 @@ class ImsettingsAction extends SettingsAction {
return _('You can send and receive notices through Jabber/GTalk [instant messages](%%doc.im%%). Configure your address and settings below.');
}
function show_form($msg=NULL, $success=false) {
function show_form($msg=null, $success=false) {
$user = common_current_user();
$this->form_header(_('IM Settings'), $msg, $success);
common_element_start('form', array('method' => 'post',
@ -37,7 +37,7 @@ class ImsettingsAction extends SettingsAction {
common_local_url('imsettings')));
common_hidden('token', common_session_token());
common_element('h2', NULL, _('Address'));
common_element('h2', null, _('Address'));
if ($user->jabber) {
common_element_start('p');
@ -59,13 +59,13 @@ class ImsettingsAction extends SettingsAction {
common_submit('cancel', _('Cancel'));
} else {
common_input('jabber', _('IM Address'),
($this->arg('jabber')) ? $this->arg('jabber') : NULL,
($this->arg('jabber')) ? $this->arg('jabber') : null,
sprintf(_('Jabber or GTalk address, like "UserName@example.org". First, make sure to add %s to your buddy list in your IM client or on GTalk.'), jabber_daemon_address()));
common_submit('add', _('Add'));
}
}
common_element('h2', NULL, _('Preferences'));
common_element('h2', null, _('Preferences'));
common_checkbox('jabbernotify',
_('Send me notices through Jabber/GTalk.'),
@ -93,7 +93,7 @@ class ImsettingsAction extends SettingsAction {
if ($confirm->find(TRUE)) {
return $confirm;
} else {
return NULL;
return null;
}
}
@ -244,7 +244,7 @@ class ImsettingsAction extends SettingsAction {
$user->query('BEGIN');
$original = clone($user);
$user->jabber = NULL;
$user->jabber = null;
$result = $user->updateKeys($original);
if (!$result) {
common_log_db_error($user, 'UPDATE', __FILE__);

View File

@ -85,49 +85,49 @@ class InviteAction extends Action {
common_show_header(_('Invitation(s) sent'));
if ($already) {
common_element('p', NULL, _('You are already subscribed to these users:'));
common_element('p', null, _('You are already subscribed to these users:'));
common_element_start('ul');
foreach ($already as $other) {
common_element('li', NULL, sprintf(_('%s (%s)'), $other->nickname, $other->email));
common_element('li', null, sprintf(_('%s (%s)'), $other->nickname, $other->email));
}
common_element_end('ul');
}
if ($subbed) {
common_element('p', NULL, _('These people are already users and you were automatically subscribed to them:'));
common_element('p', null, _('These people are already users and you were automatically subscribed to them:'));
common_element_start('ul');
foreach ($subbed as $other) {
common_element('li', NULL, sprintf(_('%s (%s)'), $other->nickname, $other->email));
common_element('li', null, sprintf(_('%s (%s)'), $other->nickname, $other->email));
}
common_element_end('ul');
}
if ($sent) {
common_element('p', NULL, _('Invitation(s) sent to the following people:'));
common_element('p', null, _('Invitation(s) sent to the following people:'));
common_element_start('ul');
foreach ($sent as $other) {
common_element('li', NULL, $other);
common_element('li', null, $other);
}
common_element_end('ul');
common_element('p', NULL, _('You will be notified when your invitees accept the invitation and register on the site. Thanks for growing the community!'));
common_element('p', null, _('You will be notified when your invitees accept the invitation and register on the site. Thanks for growing the community!'));
}
common_show_footer();
}
function show_top($error=NULL) {
function show_top($error=null) {
if ($error) {
common_element('p', 'error', $error);
} else {
common_element_start('div', 'instructions');
common_element('p', NULL,
common_element('p', null,
_('Use this form to invite your friends and colleagues to use this service.'));
common_element_end('div');
}
}
function show_form($error=NULL) {
function show_form($error=null) {
global $config;
common_show_header(_('Invite new users'), NULL, $error, array($this, 'show_top'));
common_show_header(_('Invite new users'), null, $error, array($this, 'show_top'));
common_element_start('form', array('method' => 'post',
'id' => 'invite',

View File

@ -63,7 +63,7 @@ class LoginAction extends Action {
$url = common_get_returnto();
if ($url) {
# We don't have to return to it again
common_set_returnto(NULL);
common_set_returnto(null);
} else {
$url = common_local_url('all',
array('nickname' =>
@ -91,7 +91,7 @@ class LoginAction extends Action {
$url = common_get_returnto();
if ($url) {
# We don't have to return to it again
common_set_returnto(NULL);
common_set_returnto(null);
} else {
$url = common_local_url('all',
array('nickname' =>
@ -100,8 +100,8 @@ class LoginAction extends Action {
common_redirect($url);
}
function show_form($error=NULL) {
common_show_header(_('Login'), NULL, $error, array($this, 'show_top'));
function show_form($error=null) {
common_show_header(_('Login'), null, $error, array($this, 'show_top'));
common_element_start('form', array('method' => 'post',
'id' => 'login',
'action' => common_local_url('login')));
@ -138,7 +138,7 @@ class LoginAction extends Action {
}
}
function show_top($error=NULL) {
function show_top($error=null) {
if ($error) {
common_element('p', 'error', $error);
} else {

View File

@ -32,7 +32,7 @@ class LogoutAction extends Action {
if (!common_logged_in()) {
common_user_error(_('Not logged in.'));
} else {
common_set_user(NULL);
common_set_user(null);
common_real_login(false); # not logged in
common_forgetme(); # don't log back in!
common_redirect(common_local_url('public'));

View File

@ -98,7 +98,7 @@ class NewmessageAction extends Action {
common_message_form($content, $user, $to);
}
function show_form($msg=NULL) {
function show_form($msg=null) {
$content = $this->trimmed('content');
$user = common_current_user();
@ -117,7 +117,7 @@ class NewmessageAction extends Action {
return;
}
common_show_header(_('New message'), NULL,
common_show_header(_('New message'), null,
array($content, $user, $other),
array($this, 'show_top'));

View File

@ -78,7 +78,7 @@ class NewnoticeAction extends Action {
$replyto = $this->trimmed('inreplyto');
$notice = Notice::saveNew($user->id, $content, 'web', 1, ($replyto == 'false') ? NULL : $replyto);
$notice = Notice::saveNew($user->id, $content, 'web', 1, ($replyto == 'false') ? null : $replyto);
if (is_string($notice)) {
$this->show_form($notice);
@ -121,11 +121,11 @@ class NewnoticeAction extends Action {
common_element_end('html');
}
function show_top($content=NULL) {
common_notice_form(NULL, $content);
function show_top($content=null) {
common_notice_form(null, $content);
}
function show_form($msg=NULL) {
function show_form($msg=null) {
if ($msg && $this->boolean('ajax')) {
$this->ajax_error_msg($msg);
return;
@ -138,7 +138,7 @@ class NewnoticeAction extends Action {
$content = '@' . $profile->nickname . ' ';
}
}
common_show_header(_('New notice'), NULL, $content,
common_show_header(_('New notice'), null, $content,
array($this, 'show_top'));
if ($msg) {
common_element('p', array('id' => 'error'), $msg);

View File

@ -65,6 +65,6 @@ class NoticesearchrssAction extends Rss10Action {
}
function get_image() {
return NULL;
return null;
}
}

View File

@ -52,7 +52,7 @@ class OpenidloginAction extends Action {
}
} else {
$openid_url = oid_get_last();
$this->show_form(NULL, $openid_url);
$this->show_form(null, $openid_url);
}
}
@ -60,7 +60,7 @@ class OpenidloginAction extends Action {
return _('Login with an [OpenID](%%doc.openid%%) account.');
}
function show_top($error=NULL) {
function show_top($error=null) {
if ($error) {
common_element('div', array('class' => 'error'), $error);
} else {
@ -72,8 +72,8 @@ class OpenidloginAction extends Action {
}
}
function show_form($error=NULL, $openid_url) {
common_show_header(_('OpenID Login'), NULL, $error, array($this, 'show_top'));
function show_form($error=null, $openid_url) {
common_show_header(_('OpenID Login'), null, $error, array($this, 'show_top'));
$formaction = common_local_url('openidlogin');
common_element_start('form', array('method' => 'post',
'id' => 'openidlogin',

View File

@ -30,7 +30,7 @@ class OpenidsettingsAction extends SettingsAction {
' Manage your associated OpenIDs from here.');
}
function show_form($msg=NULL, $success=false) {
function show_form($msg=null, $success=false) {
$user = common_current_user();
@ -41,8 +41,8 @@ class OpenidsettingsAction extends SettingsAction {
'action' =>
common_local_url('openidsettings')));
common_hidden('token', common_session_token());
common_element('h2', NULL, _('Add OpenID'));
common_element('p', NULL,
common_element('h2', null, _('Add OpenID'));
common_element('p', null,
_('If you want to add an OpenID to your account, ' .
'enter it in the box below and click "Add".'));
common_element_start('p');
@ -66,11 +66,11 @@ class OpenidsettingsAction extends SettingsAction {
if ($cnt > 0) {
common_element('h2', NULL, _('Remove OpenID'));
common_element('h2', null, _('Remove OpenID'));
if ($cnt == 1 && !$user->password) {
common_element('p', NULL,
common_element('p', null,
_('Removing your only OpenID would make it impossible to log in! ' .
'If you need to remove it, add another OpenID first.'));
@ -83,7 +83,7 @@ class OpenidsettingsAction extends SettingsAction {
} else {
common_element('p', NULL,
common_element('p', null,
_('You can remove an OpenID from your account '.
'by clicking the button marked "Remove".'));
$idx = 0;

View File

@ -42,16 +42,16 @@ class OpensearchAction extends Action {
common_element_start('OpenSearchDescription', array('xmlns' => 'http://a9.com/-/spec/opensearch/1.1/'));
$short_name = common_config('site', 'name').' '.$short_name;
common_element('ShortName', NULL, $short_name);
common_element('Contact', NULL, common_config('site', 'email'));
common_element('ShortName', null, $short_name);
common_element('Contact', null, common_config('site', 'email'));
common_element('Url', array('type' => 'text/html', 'method' => 'get',
'template' => str_replace('---', '{searchTerms}', common_local_url($type, array('q' => '---')))));
common_element('Image', array('height' => 16, 'width' => 16, 'type' => 'image/vnd.microsoft.icon'), common_path('favicon.ico'));
common_element('Image', array('height' => 50, 'width' => 50, 'type' => 'image/png'), theme_path('logo.png'));
common_element('AdultContent', NULL, 'false');
common_element('Language', NULL, common_language());
common_element('OutputEncoding', NULL, 'UTF-8');
common_element('InputEncoding', NULL, 'UTF-8');
common_element('AdultContent', null, 'false');
common_element('Language', null, common_language());
common_element('OutputEncoding', null, 'UTF-8');
common_element('InputEncoding', null, 'UTF-8');
common_element_end('OpenSearchDescription');
common_end_xml();

View File

@ -27,12 +27,12 @@ class OthersettingsAction extends SettingsAction {
return _('Manage various other options.');
}
function show_form($msg=NULL, $success=false) {
function show_form($msg=null, $success=false) {
$user = common_current_user();
$this->form_header(_('Other Settings'), $msg, $success);
common_element('h2', NULL, _('URL Auto-shortening'));
common_element('h2', null, _('URL Auto-shortening'));
common_element_start('form', array('method' => 'post',
'id' => 'othersettings',
'action' =>
@ -57,7 +57,7 @@ class OthersettingsAction extends SettingsAction {
common_element_end('form');
// common_element('h2', NULL, _('Delete my account'));
// common_element('h2', null, _('Delete my account'));
// $this->show_delete_form();
common_show_footer();

View File

@ -68,8 +68,8 @@ class PeoplesearchAction extends SearchAction {
class PeopleSearchResults extends ProfileList {
var $terms = NULL;
var $pattern = NULL;
var $terms = null;
var $pattern = null;
function __construct($profile, $terms) {
parent::__construct($profile);

View File

@ -43,7 +43,7 @@ class PeopletagAction extends Action {
# Looks like we're good; show the header
common_show_header(sprintf(_('Users self-tagged with %s - page %d'), $tag, $page),
NULL, $tag, array($this, 'show_top'));
null, $tag, array($this, 'show_top'));
$this->show_people($tag, $page);
@ -94,7 +94,7 @@ class PeopletagAction extends Action {
}
function get_title() {
return NULL;
return null;
}
function show_header($arr) {

View File

@ -28,14 +28,14 @@ class ProfilesettingsAction extends SettingsAction {
'so people know more about you.');
}
function show_form($msg=NULL, $success=false) {
function show_form($msg=null, $success=false) {
$this->form_header(_('Profile settings'), $msg, $success);
$this->show_settings_form();
common_element('h2', NULL, _('Avatar'));
common_element('h2', null, _('Avatar'));
$this->show_avatar_form();
common_element('h2', NULL, _('Change password'));
common_element('h2', null, _('Change password'));
$this->show_password_form();
// common_element('h2', NULL, _('Delete my account'));
// common_element('h2', null, _('Delete my account'));
// $this->show_delete_form();
common_show_footer();
}

View File

@ -31,7 +31,7 @@ class PublicAction extends StreamAction {
header('X-XRDS-Location: '. common_local_url('publicxrds'));
common_show_header(_('Public timeline'),
array($this, 'show_header'), NULL,
array($this, 'show_header'), null,
array($this, 'show_top'));
# XXX: Public sidebar here?

View File

@ -52,6 +52,6 @@ class PublicrssAction extends Rss10Action {
}
function get_image() {
return NULL;
return null;
}
}

View File

@ -42,7 +42,7 @@ class PublicxrdsAction extends Action {
'xmlns:simple' => 'http://xrds-simple.net/core/1.0',
'version' => '2.0'));
common_element('Type', NULL, 'xri://$xrds*simple');
common_element('Type', null, 'xri://$xrds*simple');
foreach (array('finishopenidlogin', 'finishaddopenid', 'finishimmediate') as $finish) {
$this->show_service(Auth_OpenID_RP_RETURN_TO_URL_TYPE,
@ -55,24 +55,24 @@ class PublicxrdsAction extends Action {
common_end_xml();
}
function show_service($type, $uri, $params=NULL, $sigs=NULL, $localId=NULL) {
function show_service($type, $uri, $params=null, $sigs=null, $localId=null) {
common_element_start('Service');
if ($uri) {
common_element('URI', NULL, $uri);
common_element('URI', null, $uri);
}
common_element('Type', NULL, $type);
common_element('Type', null, $type);
if ($params) {
foreach ($params as $param) {
common_element('Type', NULL, $param);
common_element('Type', null, $param);
}
}
if ($sigs) {
foreach ($sigs as $sig) {
common_element('Type', NULL, $sig);
common_element('Type', null, $sig);
}
}
if ($localId) {
common_element('LocalID', NULL, $localId);
common_element('LocalID', null, $localId);
}
common_element_end('Service');
}

View File

@ -132,12 +132,12 @@ class RecoverpasswordAction extends Action {
unset($_SESSION['tempuser']);
}
function show_top($msg=NULL) {
function show_top($msg=null) {
if ($msg) {
common_element('div', 'error', $msg);
} else {
common_element_start('div', 'instructions');
common_element('p', NULL,
common_element('p', null,
_('If you\'ve forgotten or lost your' .
' password, you can get a new one sent to' .
' the email address you have stored ' .
@ -146,7 +146,7 @@ class RecoverpasswordAction extends Action {
}
}
function show_password_top($msg=NULL) {
function show_password_top($msg=null) {
if ($msg) {
common_element('div', 'error', $msg);
} else {
@ -156,9 +156,9 @@ class RecoverpasswordAction extends Action {
}
}
function show_form($msg=NULL) {
function show_form($msg=null) {
common_show_header(_('Recover password'), NULL,
common_show_header(_('Recover password'), null,
$msg, array($this, 'show_top'));
common_element_start('form', array('method' => 'post',
@ -173,9 +173,9 @@ class RecoverpasswordAction extends Action {
common_show_footer();
}
function show_password_form($msg=NULL) {
function show_password_form($msg=null) {
common_show_header(_('Reset password'), NULL,
common_show_header(_('Reset password'), null,
$msg, array($this, 'show_password_top'));
common_element_start('form', array('method' => 'post',
@ -224,7 +224,7 @@ class RecoverpasswordAction extends Action {
$confirm_email = Confirm_address::staticGet('user_id', $user->id);
if ($confirm_email && $confirm_email->address_type != 'email') {
# Skip non-email confirmations
$confirm_email = NULL;
$confirm_email = null;
}
}
@ -267,7 +267,7 @@ class RecoverpasswordAction extends Action {
mail_to_user($user, _('Password recovery requested'), $body, $confirm->address);
common_show_header(_('Password recovery requested'));
common_element('p', NULL,
common_element('p', null,
_('Instructions for recovering your password ' .
'have been sent to the email address registered to your ' .
'account.'));
@ -324,7 +324,7 @@ class RecoverpasswordAction extends Action {
common_real_login(true);
common_show_header(_('Password saved.'));
common_element('p', NULL, _('New password successfully saved. ' .
common_element('p', null, _('New password successfully saved. ' .
'You are now logged in.'));
common_show_footer();
}

View File

@ -149,7 +149,7 @@ class RegisterAction extends Action {
return ($user !== false);
}
function show_top($error=NULL) {
function show_top($error=null) {
if ($error) {
common_element('p', 'error', $error);
} else {
@ -164,7 +164,7 @@ class RegisterAction extends Action {
}
}
function show_form($error=NULL) {
function show_form($error=null) {
global $config;
$code = $this->trimmed('code');
@ -178,7 +178,7 @@ class RegisterAction extends Action {
return;
}
common_show_header(_('Register'), NULL, $error, array($this, 'show_top'));
common_show_header(_('Register'), null, $error, array($this, 'show_top'));
common_element_start('form', array('method' => 'post',
'id' => 'login',
'action' => common_local_url('register')));

View File

@ -55,7 +55,7 @@ class RemotesubscribeAction extends Action {
' enter your profile URL below.');
}
function show_top($err=NULL) {
function show_top($err=null) {
if ($err) {
common_element('div', 'error', $err);
} else {
@ -67,10 +67,10 @@ class RemotesubscribeAction extends Action {
}
}
function show_form($err=NULL) {
function show_form($err=null) {
$nickname = $this->trimmed('nickname');
$profile = $this->trimmed('profile_url');
common_show_header(_('Remote subscribe'), NULL, $err,
common_show_header(_('Remote subscribe'), null, $err,
array($this, 'show_top'));
# id = remotesubscribe conflicts with the
# button on profile page
@ -153,7 +153,7 @@ class RemotesubscribeAction extends Action {
}
function get_user() {
$user = NULL;
$user = null;
$nickname = $this->trimmed('nickname');
if ($nickname) {
$user = User::staticGet('nickname', $nickname);
@ -173,7 +173,7 @@ class RemotesubscribeAction extends Action {
$oauth_services = omb_get_services($xrds, OAUTH_DISCOVERY);
if (!$oauth_services) {
return NULL;
return null;
}
$oauth_service = $oauth_services[0];
@ -181,17 +181,17 @@ class RemotesubscribeAction extends Action {
$oauth_xrd = $this->getXRD($oauth_service, $xrds);
if (!$oauth_xrd) {
return NULL;
return null;
}
if (!$this->addServices($oauth_xrd, $oauth_endpoints, $omb)) {
return NULL;
return null;
}
$omb_services = omb_get_services($xrds, OMB_NAMESPACE);
if (!$omb_services) {
return NULL;
return null;
}
$omb_service = $omb_services[0];
@ -199,23 +199,23 @@ class RemotesubscribeAction extends Action {
$omb_xrd = $this->getXRD($omb_service, $xrds);
if (!$omb_xrd) {
return NULL;
return null;
}
if (!$this->addServices($omb_xrd, $omb_endpoints, $omb)) {
return NULL;
return null;
}
# XXX: check that we got all the services we needed
foreach (array_merge($omb_endpoints, $oauth_endpoints) as $type) {
if (!array_key_exists($type, $omb) || !$omb[$type]) {
return NULL;
return null;
}
}
if (!omb_local_id($omb[OAUTH_ENDPOINT_REQUEST])) {
return NULL;
return null;
}
return $omb;
@ -225,7 +225,7 @@ class RemotesubscribeAction extends Action {
$uri = omb_service_uri($main_service);
if (strpos($uri, "#") !== 0) {
# FIXME: more rigorous handling of external service definitions
return NULL;
return null;
}
$id = substr($uri, 1);
$nodes = $main_xrds->allXrdNodes;
@ -239,7 +239,7 @@ class RemotesubscribeAction extends Action {
return new Auth_Yadis_XRDS($parser, $bogus_nodes);
}
}
return NULL;
return null;
}
function addServices($xrd, $types, &$omb) {
@ -267,12 +267,12 @@ class RemotesubscribeAction extends Action {
$params = array();
parse_str($parsed['query'], $params);
$req = OAuthRequest::from_consumer_and_token($con, NULL, "POST", $url, $params);
$req = OAuthRequest::from_consumer_and_token($con, null, "POST", $url, $params);
$listener = omb_local_id($omb[OAUTH_ENDPOINT_REQUEST]);
if (!$listener) {
return NULL;
return null;
}
$req->set_parameter('omb_listener', $listener);
@ -280,7 +280,7 @@ class RemotesubscribeAction extends Action {
# XXX: test to see if endpoint accepts this signature method
$req->sign_request(omb_hmac_sha1(), $con, NULL);
$req->sign_request(omb_hmac_sha1(), $con, null);
# We re-use this tool's fetcher, since it's pretty good
@ -291,7 +291,7 @@ class RemotesubscribeAction extends Action {
array('User-Agent' => 'Laconica/' . LACONICA_VERSION));
if ($result->status != 200) {
return NULL;
return null;
}
parse_str($result->body, $return);

View File

@ -25,7 +25,7 @@ require_once(INSTALLDIR.'/lib/rssaction.php');
class RepliesrssAction extends Rss10Action {
var $user = NULL;
var $user = null;
function init() {
$nickname = $this->trimmed('nickname');
@ -71,9 +71,9 @@ class RepliesrssAction extends Rss10Action {
$user = $this->user;
$profile = $user->getProfile();
if (!$profile) {
return NULL;
return null;
}
$avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
return ($avatar) ? $avatar->url : NULL;
return ($avatar) ? $avatar->url : null;
}
}

View File

@ -53,7 +53,7 @@ class ShowmessageAction extends MailboxAction {
function get_title($user, $page) {
$message = $this->get_message();
if (!$message) {
return NULL;
return null;
}
if ($user->id == $message->from_profile) {
@ -85,7 +85,7 @@ class ShowmessageAction extends MailboxAction {
return $message->getFrom();
} else {
# This shouldn't happen
return NULL;
return null;
}
}

View File

@ -23,9 +23,9 @@ require_once(INSTALLDIR.'/lib/stream.php');
class ShownoticeAction extends StreamAction {
var $notice = NULL;
var $profile = NULL;
var $avatar = NULL;
var $notice = null;
var $profile = null;
var $avatar = null;
function prepare($args) {
@ -73,7 +73,7 @@ class ShownoticeAction extends StreamAction {
common_show_header(sprintf(_('%1$s\'s status on %2$s'),
$this->profile->nickname,
common_exact_date($this->notice->created)),
array($this, 'show_header'), NULL,
array($this, 'show_header'), null,
array($this, 'show_top'));
common_element_start('ul', array('id' => 'notices'));

View File

@ -285,7 +285,7 @@ class ShowstreamAction extends StreamAction {
common_element_start('div', array('id' => 'subscriptions'));
common_element('h2', NULL, _('Subscriptions'));
common_element('h2', null, _('Subscriptions'));
if ($subs_count > 0) {
@ -415,7 +415,7 @@ class ShowstreamAction extends StreamAction {
function show_last_notice($profile) {
common_element('h2', NULL, _('Currently'));
common_element('h2', null, _('Currently'));
$notice = $profile->getCurrentNotice();

View File

@ -28,7 +28,7 @@ class SmssettingsAction extends EmailsettingsAction {
return _('You can receive SMS messages through email from %%site.name%%.');
}
function show_form($msg=NULL, $success=false) {
function show_form($msg=null, $success=false) {
$user = common_current_user();
$this->form_header(_('SMS Settings'), $msg, $success);
common_element_start('form', array('method' => 'post',
@ -36,7 +36,7 @@ class SmssettingsAction extends EmailsettingsAction {
'action' =>
common_local_url('smssettings')));
common_hidden('token', common_session_token());
common_element('h2', NULL, _('Address'));
common_element('h2', null, _('Address'));
if ($user->sms) {
common_element_start('p');
@ -60,12 +60,12 @@ class SmssettingsAction extends EmailsettingsAction {
common_hidden('carrier', $confirm->address_extra);
common_element_end('p');
common_submit('cancel', _('Cancel'));
common_input('code', _('Confirmation code'), NULL,
common_input('code', _('Confirmation code'), null,
_('Enter the code you received on your phone.'));
common_submit('confirm', _('Confirm'));
} else {
common_input('sms', _('SMS Phone number'),
($this->arg('sms')) ? $this->arg('sms') : NULL,
($this->arg('sms')) ? $this->arg('sms') : null,
_('Phone number, no punctuation or spaces, with area code'));
$this->carrier_select();
common_submit('add', _('Add'));
@ -73,7 +73,7 @@ class SmssettingsAction extends EmailsettingsAction {
}
if ($user->sms) {
common_element('h2', NULL, _('Incoming email'));
common_element('h2', null, _('Incoming email'));
if ($user->incomingemail) {
common_element_start('p');
@ -91,7 +91,7 @@ class SmssettingsAction extends EmailsettingsAction {
common_submit('newincoming', _('New'));
}
common_element('h2', NULL, _('Preferences'));
common_element('h2', null, _('Preferences'));
common_checkbox('smsnotify',
_('Send me notices through SMS; I understand I may incur exorbitant charges from my carrier.'),
@ -111,7 +111,7 @@ class SmssettingsAction extends EmailsettingsAction {
if ($confirm->find(TRUE)) {
return $confirm;
} else {
return NULL;
return null;
}
}
@ -268,9 +268,9 @@ class SmssettingsAction extends EmailsettingsAction {
$user->query('BEGIN');
$original = clone($user);
$user->sms = NULL;
$user->carrier = NULL;
$user->smsemail = NULL;
$user->sms = null;
$user->carrier = null;
$user->smsemail = null;
$result = $user->updateKeys($original);
if (!$result) {
common_log_db_error($user, 'UPDATE', __FILE__);

View File

@ -21,7 +21,7 @@ if (!defined('LACONICA')) { exit(1); }
class SubeditAction extends Action {
var $profile = NULL;
var $profile = null;
function prepare($args) {

View File

@ -49,12 +49,12 @@ class TagotherAction extends Action {
}
}
function show_form($profile, $error=NULL) {
function show_form($profile, $error=null) {
$user = common_current_user();
common_show_header(_('Tag a person'),
NULL, array($profile, $error), array($this, 'show_top'));
null, array($profile, $error), array($this, 'show_top'));
$avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
@ -178,13 +178,13 @@ class TagotherAction extends Action {
}
}
function show_top($arr = NULL) {
function show_top($arr = null) {
list($profile, $error) = $arr;
if ($error) {
common_element('p', 'error', $error);
} else {
common_element_start('div', 'instructions');
common_element('p', NULL,
common_element('p', null,
_('Use this form to add tags to your subscribers or subscriptions.'));
common_element_end('div');
}

View File

@ -41,7 +41,7 @@ class TagrssAction extends Rss10Action {
$tag = $this->tag;
if (is_null($tag)) {
return NULL;
return null;
}
$notice = Notice_tag::getStream($tag->tag, 0, ($limit == 0) ? NOTICES_PER_PAGE : $limit);

View File

@ -228,12 +228,12 @@ class Twitapidirect_messagesAction extends TwitterapiAction {
$this->init_document('rss');
common_element_start('channel');
common_element('title', NULL, $title);
common_element('title', null, $title);
common_element('link', NULL, $link);
common_element('description', NULL, $subtitle);
common_element('language', NULL, 'en-us');
common_element('ttl', NULL, '40');
common_element('link', null, $link);
common_element('description', null, $subtitle);
common_element('language', null, 'en-us');
common_element('ttl', null, '40');
if (is_array($message)) {
foreach ($message as $m) {
@ -256,12 +256,12 @@ class Twitapidirect_messagesAction extends TwitterapiAction {
$this->init_document('atom');
common_element('title', NULL, $title);
common_element('title', null, $title);
$siteserver = common_config('site', 'server');
common_element('id', NULL, "tag:$siteserver,2008:DirectMessage");
common_element('link', array('href' => $link, 'rel' => 'alternate', 'type' => 'text/html'), NULL);
common_element('updated', NULL, common_date_iso8601(strftime('%c')));
common_element('subtitle', NULL, $subtitle);
common_element('id', null, "tag:$siteserver,2008:DirectMessage");
common_element('link', array('href' => $link, 'rel' => 'alternate', 'type' => 'text/html'), null);
common_element('updated', null, common_date_iso8601(strftime('%c')));
common_element('subtitle', null, $subtitle);
if (is_array($message)) {
foreach ($message as $m) {

View File

@ -138,7 +138,7 @@ class TwitapifriendshipsAction extends TwitterapiAction {
switch ($apidata['content-type']) {
case 'xml':
$this->init_document('xml');
common_element('friends', NULL, $result);
common_element('friends', null, $result);
$this->end_document('xml');
break;
case 'json':

View File

@ -32,7 +32,7 @@ class TwitapihelpAction extends TwitterapiAction {
if ($apidata['content-type'] == 'xml') {
$this->init_document('xml');
common_element('ok', NULL, 'true');
common_element('ok', null, 'true');
$this->end_document('xml');
} elseif ($apidata['content-type'] == 'json') {
$this->init_document('json');

View File

@ -112,7 +112,7 @@ class TwitapistatusesAction extends TwitterapiAction {
$since = strtotime($this->arg('since'));
$user = $this->get_user(NULL, $apidata);
$user = $this->get_user(null, $apidata);
$this->auth_user = $user;
$profile = $user->getProfile();
@ -200,7 +200,7 @@ class TwitapistatusesAction extends TwitterapiAction {
# FriendFeed's SUP protocol
# Also added RSS and Atom feeds
$suplink = common_local_url('sup', NULL, $user->id);
$suplink = common_local_url('sup', null, $user->id);
header('X-SUP-ID: '.$suplink);
# XXX: since
@ -291,7 +291,7 @@ class TwitapistatusesAction extends TwitterapiAction {
$apidata['api_arg'] = $n->id;
} else {
$reply_to = NULL;
$reply_to = null;
if ($in_reply_to_status_id) {

View File

@ -30,10 +30,10 @@ class TwittersettingsAction extends SettingsAction {
'and subscribe to Twitter friends already here.');
}
function show_form($msg=NULL, $success=false) {
function show_form($msg=null, $success=false) {
$user = common_current_user();
$profile = $user->getProfile();
$fuser = NULL;
$fuser = null;
$flink = Foreign_link::getByUserID($user->id, 1); // 1 == Twitter
if ($flink) {
@ -47,7 +47,7 @@ class TwittersettingsAction extends SettingsAction {
common_local_url('twittersettings')));
common_hidden('token', common_session_token());
common_element('h2', NULL, _('Twitter Account'));
common_element('h2', null, _('Twitter Account'));
if ($fuser) {
common_element_start('p');
@ -67,7 +67,7 @@ class TwittersettingsAction extends SettingsAction {
common_password('twitter_password', _('Twitter password'));
}
common_element('h2', NULL, _('Preferences'));
common_element('h2', null, _('Preferences'));
common_checkbox('noticesync', _('Automatically send my notices to Twitter.'),
($flink) ? ($flink->noticesync & FOREIGN_NOTICE_SEND) : true);
@ -126,7 +126,7 @@ class TwittersettingsAction extends SettingsAction {
if ($friends_count > 0) {
common_element('h3', NULL, _('Twitter Friends'));
common_element('h3', null, _('Twitter Friends'));
common_element_start('div', array('id' => 'subscriptions'));
common_element_start('ul', array('id' => 'subscriptions_avatars'));

View File

@ -21,7 +21,7 @@ if (!defined('LACONICA')) { exit(1); }
class UnblockAction extends Action {
var $profile = NULL;
var $profile = null;
function prepare($args) {

View File

@ -81,7 +81,7 @@ class UserauthorizationAction extends Action {
$avatar = $req->get_parameter('omb_listenee_avatar');
common_show_header(_('Authorize subscription'));
common_element('p', NULL, _('Please check these details to make sure '.
common_element('p', null, _('Please check these details to make sure '.
'that you want to subscribe to this user\'s notices. '.
'If you didn\'t just ask to subscribe to someone\'s notices, '.
'click "Cancel".'));
@ -320,7 +320,7 @@ class UserauthorizationAction extends Action {
function show_accept_message($tok) {
common_show_header(_('Subscription authorized'));
common_element('p', NULL,
common_element('p', null,
_('The subscription has been authorized, but no '.
'callback URL was passed. Check with the site\'s instructions for '.
'details on how to authorize the subscription. Your subscription token is:'));
@ -330,7 +330,7 @@ class UserauthorizationAction extends Action {
function show_reject_message($tok) {
common_show_header(_('Subscription rejected'));
common_element('p', NULL,
common_element('p', null,
_('The subscription has been rejected, but no '.
'callback URL was passed. Check with the site\'s instructions for '.
'details on how to fully reject the subscription.'));

View File

@ -38,7 +38,7 @@ class UserbyidAction extends Action {
// support redirecting to FOAF rdf/xml if the agent prefers it
$page_prefs = 'application/rdf+xml,text/html,application/xhtml+xml,application/xml;q=0.3,text/xml;q=0.2';
$httpaccept = isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : NULL;
$httpaccept = isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : null;
$type = common_negotiate_type(common_accept_to_prefs($httpaccept),
common_accept_to_prefs($page_prefs));
$page = $type == 'application/rdf+xml' ? 'foaf' : 'showstream';

View File

@ -25,7 +25,7 @@ require_once(INSTALLDIR.'/lib/rssaction.php');
class UserrssAction extends Rss10Action {
var $user = NULL;
var $user = null;
function init() {
$nickname = $this->trimmed('nickname');
@ -44,7 +44,7 @@ class UserrssAction extends Rss10Action {
$user = $this->user;
if (is_null($user)) {
return NULL;
return null;
}
$notice = $user->getNotices(0, ($limit == 0) ? NOTICES_PER_PAGE : $limit);
@ -74,16 +74,16 @@ class UserrssAction extends Rss10Action {
if (!$profile) {
common_log_db_error($user, 'SELECT', __FILE__);
$this->server_error(_('User without matching profile'));
return NULL;
return null;
}
$avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
return ($avatar) ? $avatar->url : NULL;
return ($avatar) ? $avatar->url : null;
}
# override parent to add X-SUP-ID URL
function init_rss($limit=0) {
$url = common_local_url('sup', NULL, $this->user->id);
$url = common_local_url('sup', null, $this->user->id);
header('X-SUP-ID: '.$url);
parent::init_rss($limit);
}

View File

@ -50,7 +50,7 @@ class XrdsAction extends Action {
'xmlns:simple' => 'http://xrds-simple.net/core/1.0',
'version' => '2.0'));
common_element('Type', NULL, 'xri://$xrds*simple');
common_element('Type', null, 'xri://$xrds*simple');
$this->show_service(OAUTH_ENDPOINT_REQUEST,
common_local_url('requesttoken'),
@ -69,7 +69,7 @@ class XrdsAction extends Action {
array(OAUTH_HMAC_SHA1));
$this->show_service(OAUTH_ENDPOINT_RESOURCE,
NULL,
null,
array(OAUTH_AUTH_HEADER, OAUTH_POST_BODY),
array(OAUTH_HMAC_SHA1));
@ -82,7 +82,7 @@ class XrdsAction extends Action {
'xmlns:simple' => 'http://xrds-simple.net/core/1.0',
'version' => '2.0'));
common_element('Type', NULL, 'xri://$xrds*simple');
common_element('Type', null, 'xri://$xrds*simple');
$this->show_service(OMB_ENDPOINT_POSTNOTICE,
common_local_url('postnotice'));
@ -95,7 +95,7 @@ class XrdsAction extends Action {
common_element_start('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)',
'version' => '2.0'));
common_element('Type', NULL, 'xri://$xrds*simple');
common_element('Type', null, 'xri://$xrds*simple');
$this->show_service(OAUTH_DISCOVERY,
'#oauth');
@ -108,24 +108,24 @@ class XrdsAction extends Action {
common_end_xml();
}
function show_service($type, $uri, $params=NULL, $sigs=NULL, $localId=NULL) {
function show_service($type, $uri, $params=null, $sigs=null, $localId=null) {
common_element_start('Service');
if ($uri) {
common_element('URI', NULL, $uri);
common_element('URI', null, $uri);
}
common_element('Type', NULL, $type);
common_element('Type', null, $type);
if ($params) {
foreach ($params as $param) {
common_element('Type', NULL, $param);
common_element('Type', null, $param);
}
}
if ($sigs) {
foreach ($sigs as $sig) {
common_element('Type', NULL, $sig);
common_element('Type', null, $sig);
}
}
if ($localId) {
common_element('LocalID', NULL, $localId);
common_element('LocalID', null, $localId);
}
common_element_end('Service');
}

View File

@ -21,7 +21,7 @@ class Avatar extends Memcached_DataObject
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
/* Static get */
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Avatar',$k,$v); }
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Avatar',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
@ -72,7 +72,7 @@ class Avatar extends Memcached_DataObject
if ($scaled->insert()) {
return $scaled;
} else {
return NULL;
return null;
}
}
@ -85,7 +85,7 @@ class Avatar extends Memcached_DataObject
} else if ($this->mediatype == 'image/png') {
return imagecreatefrompng($filepath);
} else {
return NULL;
return null;
}
}

View File

@ -38,13 +38,13 @@ class Channel {
}
function source() {
return NULL;
return null;
}
}
class XMPPChannel extends Channel {
var $conn = NULL;
var $conn = null;
function source() {
return 'xmpp';
@ -111,7 +111,7 @@ class WebChannel extends Channel {
# XXX: even better, redirect to appropriate page
# depending on what command was run
common_show_header(_('Command results'));
common_element('p', NULL, $text);
common_element('p', null, $text);
common_show_footer();
}
@ -149,13 +149,13 @@ class AjaxWebChannel extends WebChannel {
class MailChannel extends Channel {
var $addr = NULL;
var $addr = null;
function source() {
return 'mail';
}
function __construct($addr=NULL) {
function __construct($addr=null) {
$this->addr = $addr;
}

View File

@ -23,9 +23,9 @@ require_once(INSTALLDIR.'/classes/Channel.php');
class Command {
var $user = NULL;
var $user = null;
function __construct($user=NULL) {
function __construct($user=null) {
$this->user = $user;
}
@ -47,7 +47,7 @@ class TrackOffCommand extends UnimplementedCommand {
}
class TrackCommand extends UnimplementedCommand {
var $word = NULL;
var $word = null;
function __construct($user, $word) {
parent::__construct($user);
$this->word = $word;
@ -55,7 +55,7 @@ class TrackCommand extends UnimplementedCommand {
}
class UntrackCommand extends UnimplementedCommand {
var $word = NULL;
var $word = null;
function __construct($user, $word) {
parent::__construct($user);
$this->word = $word;
@ -63,7 +63,7 @@ class UntrackCommand extends UnimplementedCommand {
}
class NudgeCommand extends UnimplementedCommand {
var $other = NULL;
var $other = null;
function __construct($user, $other) {
parent::__construct($user);
$this->other = $other;
@ -71,7 +71,7 @@ class NudgeCommand extends UnimplementedCommand {
}
class InviteCommand extends UnimplementedCommand {
var $other = NULL;
var $other = null;
function __construct($user, $other) {
parent::__construct($user);
$this->other = $other;
@ -104,7 +104,7 @@ class StatsCommand extends Command {
class FavCommand extends Command {
var $other = NULL;
var $other = null;
function __construct($user, $other) {
parent::__construct($user);
@ -148,7 +148,7 @@ class FavCommand extends Command {
}
class WhoisCommand extends Command {
var $other = NULL;
var $other = null;
function __construct($user, $other) {
parent::__construct($user);
$this->other = $other;
@ -182,8 +182,8 @@ class WhoisCommand extends Command {
}
class MessageCommand extends Command {
var $other = NULL;
var $text = NULL;
var $other = null;
var $text = null;
function __construct($user, $other, $text) {
parent::__construct($user);
$this->other = $other;
@ -225,7 +225,7 @@ class MessageCommand extends Command {
class GetCommand extends Command {
var $other = NULL;
var $other = null;
function __construct($user, $other) {
parent::__construct($user);
@ -255,7 +255,7 @@ class GetCommand extends Command {
class SubCommand extends Command {
var $other = NULL;
var $other = null;
function __construct($user, $other) {
parent::__construct($user);
@ -281,7 +281,7 @@ class SubCommand extends Command {
class UnsubCommand extends Command {
var $other = NULL;
var $other = null;
function __construct($user, $other) {
parent::__construct($user);
@ -305,8 +305,8 @@ class UnsubCommand extends Command {
}
class OffCommand extends Command {
var $other = NULL;
function __construct($user, $other=NULL) {
var $other = null;
function __construct($user, $other=null) {
parent::__construct($user);
$this->other = $other;
}
@ -324,8 +324,8 @@ class OffCommand extends Command {
}
class OnCommand extends Command {
var $other = NULL;
function __construct($user, $other=NULL) {
var $other = null;
function __construct($user, $other=null) {
parent::__construct($user);
$this->other = $other;
}

View File

@ -37,14 +37,14 @@ class CommandInterpreter {
switch(strtolower($cmd)) {
case 'help':
if ($arg) {
return NULL;
return null;
}
return new HelpCommand($user);
case 'on':
if ($arg) {
list($other, $extra) = explode(' ', $arg, 2);
if ($extra) {
return NULL;
return null;
} else {
return new OnCommand($user, $other);
}
@ -55,7 +55,7 @@ class CommandInterpreter {
if ($arg) {
list($other, $extra) = explode(' ', $arg, 2);
if ($extra) {
return NULL;
return null;
} else {
return new OffCommand($user, $other);
}
@ -65,105 +65,105 @@ class CommandInterpreter {
case 'stop':
case 'quit':
if ($arg) {
return NULL;
return null;
} else {
return new OffCommand($user);
}
case 'follow':
case 'sub':
if (!$arg) {
return NULL;
return null;
}
list($other, $extra) = explode(' ', $arg, 2);
if ($extra) {
return NULL;
return null;
} else {
return new SubCommand($user, $other);
}
case 'leave':
case 'unsub':
if (!$arg) {
return NULL;
return null;
}
list($other, $extra) = explode(' ', $arg, 2);
if ($extra) {
return NULL;
return null;
} else {
return new UnsubCommand($user, $other);
}
case 'get':
case 'last':
if (!$arg) {
return NULL;
return null;
}
list($other, $extra) = explode(' ', $arg, 2);
if ($extra) {
return NULL;
return null;
} else {
return new GetCommand($user, $other);
}
case 'd':
if (!$arg) {
return NULL;
return null;
}
list($other, $extra) = explode(' ', $arg, 2);
if (!$extra) {
return NULL;
return null;
} else {
return new MessageCommand($user, $other, $extra);
}
case 'whois':
if (!$arg) {
return NULL;
return null;
}
list($other, $extra) = explode(' ', $arg, 2);
if ($extra) {
return NULL;
return null;
} else {
return new WhoisCommand($user, $other);
}
case 'fav':
if (!$arg) {
return NULL;
return null;
}
list($other, $extra) = explode(' ', $arg, 2);
if ($extra) {
return NULL;
return null;
} else {
return new FavCommand($user, $other);
}
case 'nudge':
if (!$arg) {
return NULL;
return null;
}
list($other, $extra) = explode(' ', $arg, 2);
if ($extra) {
return NULL;
return null;
} else {
return new NudgeCommand($user, $other);
}
case 'stats':
if ($arg) {
return NULL;
return null;
}
return new StatsCommand($user);
case 'invite':
if (!$arg) {
return NULL;
return null;
}
list($other, $extra) = explode(' ', $arg, 2);
if ($extra) {
return NULL;
return null;
} else {
return new InviteCommand($user, $other);
}
case 'track':
if (!$arg) {
return NULL;
return null;
}
list($word, $extra) = explode(' ', $arg, 2);
if ($extra) {
return NULL;
return null;
} else if ($word == 'off') {
return new TrackOffCommand($user);
} else {
@ -171,11 +171,11 @@ class CommandInterpreter {
}
case 'untrack':
if (!$arg) {
return NULL;
return null;
}
list($word, $extra) = explode(' ', $arg, 2);
if ($extra) {
return NULL;
return null;
} else if ($word == 'all') {
return new TrackOffCommand($user);
} else {
@ -184,7 +184,7 @@ class CommandInterpreter {
case 'tracks':
case 'tracking':
if ($arg) {
return NULL;
return null;
}
return new TrackingCommand($user);
default:

View File

@ -20,7 +20,7 @@ class Confirm_address extends Memcached_DataObject
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
/* Static get */
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Confirm_address',$k,$v); }
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Confirm_address',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE

View File

@ -16,7 +16,7 @@ class Consumer extends Memcached_DataObject
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
/* Static get */
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Consumer',$k,$v); }
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Consumer',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE

View File

@ -15,7 +15,7 @@ class Fave extends Memcached_DataObject
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
/* Static get */
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Fave',$k,$v); }
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Fave',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE

View File

@ -21,7 +21,7 @@ class Foreign_link extends Memcached_DataObject
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
/* Static get */
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Foreign_link',$k,$v); }
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Foreign_link',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
@ -38,7 +38,7 @@ class Foreign_link extends Memcached_DataObject
return $flink;
}
return NULL;
return null;
}
static function getByForeignID($foreign_id, $service) {
@ -51,7 +51,7 @@ class Foreign_link extends Memcached_DataObject
return $flink;
}
return NULL;
return null;
}
# Convenience methods
@ -66,7 +66,7 @@ class Foreign_link extends Memcached_DataObject
return $fuser;
}
return NULL;
return null;
}
function getUser() {

View File

@ -17,7 +17,7 @@ class Foreign_service extends Memcached_DataObject
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
/* Static get */
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Foreign_service',$k,$v); }
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Foreign_service',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE

View File

@ -16,7 +16,7 @@ class Foreign_subscription extends Memcached_DataObject
public $created; // datetime() not_null
/* Static get */
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Foreign_subscription',$k,$v); }
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Foreign_subscription',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE

View File

@ -18,7 +18,7 @@ class Foreign_user extends Memcached_DataObject
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
/* Static get */
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Foreign_user',$k,$v); }
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Foreign_user',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
@ -36,7 +36,7 @@ class Foreign_user extends Memcached_DataObject
return $fuser;
}
return NULL;
return null;
}
function updateKeys(&$orig) {

View File

@ -17,7 +17,7 @@ class Invitation extends Memcached_DataObject
public $created; // datetime() not_null
/* Static get */
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Invitation',$k,$v); }
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Invitation',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE

View File

@ -23,7 +23,7 @@ require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
class Memcached_DataObject extends DB_DataObject
{
function &staticGet($cls, $k, $v=NULL) {
function &staticGet($cls, $k, $v=null) {
if (is_null($v)) {
$v = $k;
# XXX: HACK!
@ -56,7 +56,7 @@ class Memcached_DataObject extends DB_DataObject
if ($i->find(true)) {
$i->encache();
} else {
$i = NULL;
$i = null;
}
return $i;
}
@ -67,7 +67,7 @@ class Memcached_DataObject extends DB_DataObject
return $result;
}
function update($orig=NULL) {
function update($orig=null) {
if (is_object($orig) && $orig instanceof Memcached_DataObject) {
$orig->decache(); # might be different keys
}

View File

@ -22,7 +22,7 @@ class Message extends Memcached_DataObject
public $source; // varchar(32)
/* Static get */
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Message',$k,$v); }
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Message',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE

View File

@ -18,7 +18,7 @@ class Nonce extends Memcached_DataObject
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
/* Static get */
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Nonce',$k,$v); }
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Nonce',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE

View File

@ -48,7 +48,7 @@ class Notice extends Memcached_DataObject
public $source; // varchar(32)
/* Static get */
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Notice',$k,$v); }
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Notice',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
@ -91,7 +91,7 @@ class Notice extends Memcached_DataObject
return true;
}
static function saveNew($profile_id, $content, $source=NULL, $is_local=1, $reply_to=NULL, $uri=NULL) {
static function saveNew($profile_id, $content, $source=null, $is_local=1, $reply_to=null, $uri=null) {
$profile = Profile::staticGet($profile_id);
@ -293,7 +293,7 @@ class Notice extends Memcached_DataObject
# XXX: too many args; we need to move to named params or even a separate
# class for notice streams
static function getStream($qry, $cachekey, $offset=0, $limit=20, $since_id=0, $before_id=0, $order=NULL, $since=NULL) {
static function getStream($qry, $cachekey, $offset=0, $limit=20, $since_id=0, $before_id=0, $order=null, $since=null) {
if (common_config('memcached', 'enabled')) {
@ -383,7 +383,7 @@ class Notice extends Memcached_DataObject
# If outside our cache window, just go to the DB
if ($offset + $limit > NOTICE_CACHE_WINDOW) {
return Notice::getStreamDirect($qry, $offset, $limit, NULL, NULL, $order, NULL);
return Notice::getStreamDirect($qry, $offset, $limit, null, null, $order, null);
}
# Get the cache; if we can't, just go to the DB
@ -391,7 +391,7 @@ class Notice extends Memcached_DataObject
$cache = common_memcache();
if (!$cache) {
return Notice::getStreamDirect($qry, $offset, $limit, NULL, NULL, $order, NULL);
return Notice::getStreamDirect($qry, $offset, $limit, null, null, $order, null);
}
# Get the notices out of the cache
@ -423,7 +423,7 @@ class Notice extends Memcached_DataObject
# bet with our DB.
$new_notice = Notice::getStreamDirect($qry, 0, NOTICE_CACHE_WINDOW,
$last_id, NULL, $order, NULL);
$last_id, null, $order, null);
if ($new_notice) {
$new_notices = array();
@ -447,7 +447,7 @@ class Notice extends Memcached_DataObject
# Otherwise, get the full cache window out of the DB
$notice = Notice::getStreamDirect($qry, 0, NOTICE_CACHE_WINDOW, NULL, NULL, $order, NULL);
$notice = Notice::getStreamDirect($qry, 0, NOTICE_CACHE_WINDOW, null, null, $order, null);
# If there are no hits, just return the value
@ -477,7 +477,7 @@ class Notice extends Memcached_DataObject
return $wrapper;
}
function publicStream($offset=0, $limit=20, $since_id=0, $before_id=0, $since=NULL) {
function publicStream($offset=0, $limit=20, $since_id=0, $before_id=0, $since=null) {
$parts = array();
@ -496,7 +496,7 @@ class Notice extends Memcached_DataObject
return Notice::getStream($qry,
'public',
$offset, $limit, $since_id, $before_id, NULL, $since);
$offset, $limit, $since_id, $before_id, null, $since);
}
function addToInboxes() {

View File

@ -35,7 +35,7 @@ class NoticeWrapper extends Notice {
public $is_local; // tinyint(1)
public $source; // varchar(32)
var $notices = NULL;
var $notices = null;
var $i = -1;
function __construct($arr) {

View File

@ -33,7 +33,7 @@ class Notice_inbox extends Memcached_DataObject
public $source; // tinyint(1) default_1
/* Static get */
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Notice_inbox',$k,$v); }
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Notice_inbox',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE

View File

@ -17,7 +17,7 @@ class Notice_source extends Memcached_DataObject
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
/* Static get */
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Notice_source',$k,$v); }
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Notice_source',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE

View File

@ -30,7 +30,7 @@ class Notice_tag extends Memcached_DataObject
public $created; // datetime() not_null
/* Static get */
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Notice_tag',$k,$v); }
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Notice_tag',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE

View File

@ -41,12 +41,12 @@ class Profile extends Memcached_DataObject
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
/* Static get */
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Profile',$k,$v); }
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Profile',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
function getAvatar($width, $height=NULL) {
function getAvatar($width, $height=null) {
if (is_null($height)) {
$height = $width;
}
@ -62,7 +62,7 @@ class Profile extends Memcached_DataObject
if ($avatar->find(true)) {
return $avatar;
} else {
return NULL;
return null;
}
}
@ -71,12 +71,12 @@ class Profile extends Memcached_DataObject
$info = @getimagesize($source);
if (!$info) {
return NULL;
return null;
}
$filename = common_avatar_filename($this->id,
image_type_to_extension($info[2]),
NULL, common_timestamp());
null, common_timestamp());
$filepath = common_avatar_path($filename);
copy($source, $filepath);
@ -96,12 +96,12 @@ class Profile extends Memcached_DataObject
if (!$this->delete_avatars()) {
@unlink($filepath);
return NULL;
return null;
}
if (!$avatar->insert()) {
@unlink($filepath);
return NULL;
return null;
}
foreach (array(AVATAR_PROFILE_SIZE, AVATAR_STREAM_SIZE, AVATAR_MINI_SIZE) as $size) {
@ -109,7 +109,7 @@ class Profile extends Memcached_DataObject
if (!($avatar->width == $size && $avatar->height == $size)) {
$s = $avatar->scale($size);
if (!$s) {
return NULL;
return null;
}
}
}
@ -132,7 +132,7 @@ class Profile extends Memcached_DataObject
}
# Get latest notice on or before date; default now
function getCurrentNotice($dt=NULL) {
function getCurrentNotice($dt=null) {
$notice = new Notice();
$notice->profile_id = $this->id;
if ($dt) {
@ -143,7 +143,7 @@ class Profile extends Memcached_DataObject
if ($notice->find(true)) {
return $notice;
}
return NULL;
return null;
}
function getNotices($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0) {

View File

@ -36,7 +36,7 @@ class Profile_block extends Memcached_DataObject
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
/* Static get */
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Profile_block',$k,$v); }
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Profile_block',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE

View File

@ -16,7 +16,7 @@ class Profile_tag extends Memcached_DataObject
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
/* Static get */
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Profile_tag',$k,$v); }
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Profile_tag',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE

View File

@ -16,7 +16,7 @@ class Queue_item extends Memcached_DataObject
public $claimed; // datetime()
/* Static get */
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Queue_item',$k,$v); }
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Queue_item',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
@ -28,7 +28,7 @@ class Queue_item extends Memcached_DataObject
$qi = new Queue_item();
$qi->transport = $transport;
$qi->orderBy('created');
$qi->whereAdd('claimed is NULL');
$qi->whereAdd('claimed is null');
$qi->limit(1);
@ -36,7 +36,7 @@ class Queue_item extends Memcached_DataObject
if ($cnt) {
# XXX: potential race condition
# can we force it to only update if claimed is still NULL
# can we force it to only update if claimed is still null
# (or old)?
common_log(LOG_INFO, 'claiming queue item = ' . $qi->notice_id . ' for transport ' . $transport);
$orig = clone($qi);
@ -49,7 +49,7 @@ class Queue_item extends Memcached_DataObject
common_log(LOG_INFO, 'claim failed.');
}
}
$qi = NULL;
return NULL;
$qi = null;
return null;
}
}

View File

@ -15,7 +15,7 @@ class Remember_me extends Memcached_DataObject
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
/* Static get */
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Remember_me',$k,$v); }
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Remember_me',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE

View File

@ -38,7 +38,7 @@ class Remote_profile extends Memcached_DataObject
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
/* Static get */
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Remote_profile',$k,$v); }
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Remote_profile',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE

View File

@ -16,7 +16,7 @@ class Reply extends Memcached_DataObject
public $replied_id; // int(4)
/* Static get */
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Reply',$k,$v); }
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Reply',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE

View File

@ -17,7 +17,7 @@ class Sms_carrier extends Memcached_DataObject
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
/* Static get */
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Sms_carrier',$k,$v); }
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Sms_carrier',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE

View File

@ -40,7 +40,7 @@ class Subscription extends Memcached_DataObject
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
/* Static get */
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Subscription',$k,$v); }
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Subscription',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE

View File

@ -19,7 +19,7 @@ class Token extends Memcached_DataObject
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
/* Static get */
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Token',$k,$v); }
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Token',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE

View File

@ -62,7 +62,7 @@ class User extends Memcached_DataObject
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
/* Static get */
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('User',$k,$v); }
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('User',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
@ -118,10 +118,10 @@ class User extends Memcached_DataObject
return !in_array($nickname, $merged);
}
function getCurrentNotice($dt=NULL) {
function getCurrentNotice($dt=null) {
$profile = $this->getProfile();
if (!$profile) {
return NULL;
return null;
}
return $profile->getCurrentNotice($dt);
}
@ -336,20 +336,20 @@ class User extends Memcached_DataObject
return $user;
}
function getReplies($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=NULL) {
function getReplies($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null) {
$qry =
'SELECT notice.* ' .
'FROM notice JOIN reply ON notice.id = reply.notice_id ' .
'WHERE reply.profile_id = %d ';
return Notice::getStream(sprintf($qry, $this->id),
'user:replies:'.$this->id,
$offset, $limit, $since_id, $before_id, NULL, $since);
$offset, $limit, $since_id, $before_id, null, $since);
}
function getNotices($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=NULL) {
function getNotices($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null) {
$profile = $this->getProfile();
if (!$profile) {
return NULL;
return null;
} else {
return $profile->getNotices($offset, $limit, $since_id, $before_id);
}
@ -365,7 +365,7 @@ class User extends Memcached_DataObject
$offset, $limit);
}
function noticesWithFriends($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=NULL) {
function noticesWithFriends($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null) {
$enabled = common_config('inboxes', 'enabled');
# Complicated code, depending on whether we support inboxes yet
@ -377,7 +377,7 @@ class User extends Memcached_DataObject
'SELECT notice.* ' .
'FROM notice JOIN subscription ON notice.profile_id = subscription.subscribed ' .
'WHERE subscription.subscriber = %d ';
$order = NULL;
$order = null;
} else if ($enabled === true ||
($enabled == 'transitional' && $this->inboxed == 1)) {

View File

@ -17,7 +17,7 @@ class User_openid extends Memcached_DataObject
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
/* Static get */
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('User_openid',$k,$v); }
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('User_openid',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE

View File

@ -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' );

View File

@ -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() {

View File

@ -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 = '';

View File

@ -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;
}
}

View File

@ -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);

View File

@ -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(); '.
'});');

View File

@ -32,7 +32,7 @@ class PersonalAction extends Action {
function views_menu() {
$user = NULL;
$user = null;
$action = $this->trimmed('action');
$nickname = $this->trimmed('nickname');

View File

@ -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;

View File

@ -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');
}

View File

@ -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']));

View File

@ -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);
}

View File

@ -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'));
}

View File

@ -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);

View File

@ -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;
}
}
}

Some files were not shown because too many files have changed in this diff Show More