Commit eb2f9c98 authored by Evan Prodromou's avatar Evan Prodromou

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
parent edbc0c66
...@@ -59,4 +59,12 @@ Evan Prodromou <evan@prodromou.name>**20081223191907 ...@@ -59,4 +59,12 @@ Evan Prodromou <evan@prodromou.name>**20081223191907
getting us towards phpcs-compliance. And that means better code getting us towards phpcs-compliance. And that means better code
readability, and that means more participation. 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.
] ]
\ No newline at end of file
...@@ -25,7 +25,7 @@ require_once(INSTALLDIR.'/lib/rssaction.php'); ...@@ -25,7 +25,7 @@ require_once(INSTALLDIR.'/lib/rssaction.php');
class AllrssAction extends Rss10Action { class AllrssAction extends Rss10Action {
var $user = NULL; var $user = null;
function init() { function init() {
$nickname = $this->trimmed('nickname'); $nickname = $this->trimmed('nickname');
...@@ -69,9 +69,9 @@ class AllrssAction extends Rss10Action { ...@@ -69,9 +69,9 @@ class AllrssAction extends Rss10Action {
$user = $this->user; $user = $this->user;
$profile = $user->getProfile(); $profile = $user->getProfile();
if (!$profile) { if (!$profile) {
return NULL; return null;
} }
$avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE); $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
return ($avatar) ? $avatar->url : NULL; return ($avatar) ? $avatar->url : null;
} }
} }
\ No newline at end of file
...@@ -152,8 +152,8 @@ class ApiAction extends Action { ...@@ -152,8 +152,8 @@ class ApiAction extends Action {
header('Content-Type: application/xml; charset=utf-8'); header('Content-Type: application/xml; charset=utf-8');
common_start_xml(); common_start_xml();
common_element_start('hash'); common_element_start('hash');
common_element('error', NULL, $msg); common_element('error', null, $msg);
common_element('request', NULL, $_SERVER['REQUEST_URI']); common_element('request', null, $_SERVER['REQUEST_URI']);
common_element_end('hash'); common_element_end('hash');
common_end_xml(); common_end_xml();
} else if ($this->content_type == 'json') { } else if ($this->content_type == 'json') {
......
...@@ -21,7 +21,7 @@ if (!defined('LACONICA')) { exit(1); } ...@@ -21,7 +21,7 @@ if (!defined('LACONICA')) { exit(1); }
class BlockAction extends Action { class BlockAction extends Action {
var $profile = NULL; var $profile = null;
function prepare($args) { function prepare($args) {
...@@ -77,7 +77,7 @@ class BlockAction extends Action { ...@@ -77,7 +77,7 @@ class BlockAction extends Action {
common_show_header(_('Block user')); common_show_header(_('Block user'));
common_element('p', NULL, common_element('p', null,
_('Are you sure you want to block this user? '. _('Are you sure you want to block this user? '.
'Afterwards, they will be unsubscribed from you, '. 'Afterwards, they will be unsubscribed from you, '.
'unable to subscribe to you in the future, and '. 'unable to subscribe to you in the future, and '.
......
...@@ -88,7 +88,7 @@ class ConfirmaddressAction extends Action { ...@@ -88,7 +88,7 @@ class ConfirmaddressAction extends Action {
$cur->query('COMMIT'); $cur->query('COMMIT');
common_show_header(_('Confirm Address')); 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)); sprintf(_('The address "%s" has been confirmed for your account.'), $cur->$type));
common_show_footer(); common_show_footer();
} }
......
...@@ -41,7 +41,7 @@ class DeletenoticeAction extends DeleteAction { ...@@ -41,7 +41,7 @@ class DeletenoticeAction extends DeleteAction {
return _('Delete notice'); return _('Delete notice');
} }
function show_form($error=NULL) { function show_form($error=null) {
$user = common_current_user(); $user = common_current_user();
common_show_header($this->get_title(), array($this, 'show_header'), $error, common_show_header($this->get_title(), array($this, 'show_header'), $error,
...@@ -91,7 +91,7 @@ class DeletenoticeAction extends DeleteAction { ...@@ -91,7 +91,7 @@ class DeletenoticeAction extends DeleteAction {
$notice->delete(); $notice->delete();
} else { } else {
if ($url) { if ($url) {
common_set_returnto(NULL); common_set_returnto(null);
} else { } else {
$url = common_local_url('public'); $url = common_local_url('public');
} }
......
...@@ -36,9 +36,9 @@ class DeleteprofileAction extends Action { ...@@ -36,9 +36,9 @@ class DeleteprofileAction extends Action {
return _('Export and delete your user information.'); 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, common_show_header($title,
NULL, null,
array($msg, $success), array($msg, $success),
array($this, 'show_top')); array($this, 'show_top'));
} }
...@@ -84,9 +84,9 @@ class DeleteprofileAction extends Action { ...@@ -84,9 +84,9 @@ class DeleteprofileAction extends Action {
common_element_end('li'); 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); $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(); $this->show_confirm_delete_form();
common_show_footer(); common_show_footer();
} }
...@@ -213,7 +213,7 @@ class DeleteprofileAction extends Action { ...@@ -213,7 +213,7 @@ class DeleteprofileAction extends Action {
$n_users_deleted = $user->delete(); $n_users_deleted = $user->delete();
// logout and redirect to public // logout and redirect to public
common_set_user(NULL); common_set_user(null);
common_real_login(false); # not logged in common_real_login(false); # not logged in
common_forgetme(); # don't log back in! common_forgetme(); # don't log back in!
common_redirect(common_local_url('public')); common_redirect(common_local_url('public'));
......
...@@ -27,7 +27,7 @@ class EmailsettingsAction extends SettingsAction { ...@@ -27,7 +27,7 @@ class EmailsettingsAction extends SettingsAction {
return _('Manage how you get email from %%site.name%%.'); 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(); $user = common_current_user();
$this->form_header(_('Email Settings'), $msg, $success); $this->form_header(_('Email Settings'), $msg, $success);
common_element_start('form', array('method' => 'post', common_element_start('form', array('method' => 'post',
...@@ -36,7 +36,7 @@ class EmailsettingsAction extends SettingsAction { ...@@ -36,7 +36,7 @@ class EmailsettingsAction extends SettingsAction {
common_local_url('emailsettings'))); common_local_url('emailsettings')));
common_hidden('token', common_session_token()); common_hidden('token', common_session_token());
common_element('h2', NULL, _('Address')); common_element('h2', null, _('Address'));
if ($user->email) { if ($user->email) {
common_element_start('p'); common_element_start('p');
...@@ -58,14 +58,14 @@ class EmailsettingsAction extends SettingsAction { ...@@ -58,14 +58,14 @@ class EmailsettingsAction extends SettingsAction {
common_submit('cancel', _('Cancel')); common_submit('cancel', _('Cancel'));
} else { } else {
common_input('email', _('Email Address'), 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"')); _('Email address, like "UserName@example.org"'));
common_submit('add', _('Add')); common_submit('add', _('Add'));
} }
} }
if ($user->email) { if ($user->email) {
common_element('h2', NULL, _('Incoming email')); common_element('h2', null, _('Incoming email'));
if ($user->incomingemail) { if ($user->incomingemail) {
common_element_start('p'); common_element_start('p');
...@@ -83,7 +83,7 @@ class EmailsettingsAction extends SettingsAction { ...@@ -83,7 +83,7 @@ class EmailsettingsAction extends SettingsAction {
common_submit('newincoming', _('New')); common_submit('newincoming', _('New'));
} }
common_element('h2', NULL, _('Preferences')); common_element('h2', null, _('Preferences'));
common_checkbox('emailnotifysub', common_checkbox('emailnotifysub',
_('Send me notices of new subscriptions through email.'), _('Send me notices of new subscriptions through email.'),
...@@ -118,7 +118,7 @@ class EmailsettingsAction extends SettingsAction { ...@@ -118,7 +118,7 @@ class EmailsettingsAction extends SettingsAction {
if ($confirm->find(TRUE)) { if ($confirm->find(TRUE)) {
return $confirm; return $confirm;
} else { } else {
return NULL; return null;
} }
} }
...@@ -273,7 +273,7 @@ class EmailsettingsAction extends SettingsAction { ...@@ -273,7 +273,7 @@ class EmailsettingsAction extends SettingsAction {
$user->query('BEGIN'); $user->query('BEGIN');
$original = clone($user); $original = clone($user);
$user->email = NULL; $user->email = null;
$result = $user->updateKeys($original); $result = $user->updateKeys($original);
if (!$result) { if (!$result) {
common_log_db_error($user, 'UPDATE', __FILE__); common_log_db_error($user, 'UPDATE', __FILE__);
...@@ -294,7 +294,7 @@ class EmailsettingsAction extends SettingsAction { ...@@ -294,7 +294,7 @@ class EmailsettingsAction extends SettingsAction {
} }
$orig = clone($user); $orig = clone($user);
$user->incomingemail = NULL; $user->incomingemail = null;
if (!$user->updateKeys($orig)) { if (!$user->updateKeys($orig)) {
common_log_db_error($user, 'UPDATE', __FILE__); common_log_db_error($user, 'UPDATE', __FILE__);
......
...@@ -29,7 +29,7 @@ class FavoritedAction extends StreamAction { ...@@ -29,7 +29,7 @@ class FavoritedAction extends StreamAction {
$page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; $page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
common_show_header(_('Popular notices'), common_show_header(_('Popular notices'),
array($this, 'show_header'), NULL, array($this, 'show_header'), null,
array($this, 'show_top')); array($this, 'show_top'));
$this->show_notices($page); $this->show_notices($page);
......
...@@ -25,7 +25,7 @@ require_once(INSTALLDIR.'/lib/rssaction.php'); ...@@ -25,7 +25,7 @@ require_once(INSTALLDIR.'/lib/rssaction.php');
class FavoritesrssAction extends Rss10Action { class FavoritesrssAction extends Rss10Action {
var $user = NULL; var $user = null;
function init() { function init() {
$nickname = $this->trimmed('nickname'); $nickname = $this->trimmed('nickname');
...@@ -68,6 +68,6 @@ class FavoritesrssAction extends Rss10Action { ...@@ -68,6 +68,6 @@ class FavoritesrssAction extends Rss10Action {
} }
function get_image() { function get_image() {
return NULL; return null;
} }
} }
\ No newline at end of file
...@@ -30,7 +30,7 @@ class FeaturedAction extends StreamAction { ...@@ -30,7 +30,7 @@ class FeaturedAction extends StreamAction {
$page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; $page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
common_show_header(_('Featured users'), common_show_header(_('Featured users'),
array($this, 'show_header'), NULL, array($this, 'show_header'), null,
array($this, 'show_top')); array($this, 'show_top'));
$this->show_notices($page); $this->show_notices($page);
......
...@@ -97,7 +97,7 @@ class FinishaddopenidAction extends Action { ...@@ -97,7 +97,7 @@ class FinishaddopenidAction extends Action {
function message($msg) { function message($msg) {
common_show_header(_('OpenID Login')); common_show_header(_('OpenID Login'));
common_element('p', NULL, $msg); common_element('p', null, $msg);
common_show_footer(); common_show_footer();
} }
} }
...@@ -52,7 +52,7 @@ class FinishopenidloginAction extends Action { ...@@ -52,7 +52,7 @@ class FinishopenidloginAction extends Action {
} }
} }
function show_top($error=NULL) { function show_top($error=null) {
if ($error) { if ($error) {
common_element('div', array('class' => 'error'), $error); common_element('div', array('class' => 'error'), $error);
} else { } else {
...@@ -62,17 +62,17 @@ class FinishopenidloginAction extends Action { ...@@ -62,17 +62,17 @@ class FinishopenidloginAction extends Action {
} }
} }
function show_form($error=NULL, $username=NULL) { function show_form($error=null, $username=null) {
common_show_header(_('OpenID Account Setup'), NULL, $error, common_show_header(_('OpenID Account Setup'), null, $error,
array($this, 'show_top')); array($this, 'show_top'));
common_element_start('form', array('method' => 'post', common_element_start('form', array('method' => 'post',
'id' => 'account_connect', 'id' => 'account_connect',
'action' => common_local_url('finishopenidlogin'))); 'action' => common_local_url('finishopenidlogin')));
common_hidden('token', common_session_token()); common_hidden('token', common_session_token());
common_element('h2', NULL, common_element('h2', null,
_('Create new account')); _('Create new account'));
common_element('p', NULL, common_element('p', null,
_('Create a new user with this nickname.')); _('Create a new user with this nickname.'));
common_input('newname', _('New nickname'), common_input('newname', _('New nickname'),
($username) ? $username : '', ($username) ? $username : '',
...@@ -88,9 +88,9 @@ class FinishopenidloginAction extends Action { ...@@ -88,9 +88,9 @@ class FinishopenidloginAction extends Action {
common_text(_(' except this private data: password, email address, IM address, phone number.')); common_text(_(' except this private data: password, email address, IM address, phone number.'));
common_element_end('p'); common_element_end('p');
common_submit('create', _('Create')); common_submit('create', _('Create'));
common_element('h2', NULL, common_element('h2', null,
_('Connect existing account')); _('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.')); _('If you already have an account, login with your username and password to connect it to your OpenID.'));
common_input('nickname', _('Existing nickname')); common_input('nickname', _('Existing nickname'));
common_password('password', _('Password')); common_password('password', _('Password'));
...@@ -141,14 +141,14 @@ class FinishopenidloginAction extends Action { ...@@ -141,14 +141,14 @@ class FinishopenidloginAction extends Action {
$this->go_home($user->nickname); $this->go_home($user->nickname);
} else { } else {
$this->save_values($display, $canonical, $sreg); $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) { function message($msg) {
common_show_header(_('OpenID Login')); common_show_header(_('OpenID Login'));
common_element('p', NULL, $msg); common_element('p', null, $msg);
common_show_footer(); common_show_footer();
} }
...@@ -290,7 +290,7 @@ class FinishopenidloginAction extends Action { ...@@ -290,7 +290,7 @@ class FinishopenidloginAction extends Action {
$url = common_get_returnto(); $url = common_get_returnto();
if ($url) { if ($url) {
# We don't have to return to it again # We don't have to return to it again
common_set_returnto(NULL); common_set_returnto(null);
} else { } else {
$url = common_local_url('all', $url = common_local_url('all',
array('nickname' => array('nickname' =>
...@@ -329,7 +329,7 @@ class FinishopenidloginAction extends Action { ...@@ -329,7 +329,7 @@ class FinishopenidloginAction extends Action {
# XXX: others? # XXX: others?
return NULL; return null;
} }
function is_new_nickname($str) { function is_new_nickname($str) {
...@@ -369,7 +369,7 @@ class FinishopenidloginAction extends Action { ...@@ -369,7 +369,7 @@ class FinishopenidloginAction extends Action {
foreach ($bad as $badpart) { foreach ($bad as $badpart) {
if (array_key_exists($badpart, $parts)) { if (array_key_exists($badpart, $parts)) {
return NULL; return null;
} }
} }
...@@ -403,14 +403,14 @@ class FinishopenidloginAction extends Action { ...@@ -403,14 +403,14 @@ class FinishopenidloginAction extends Action {
} }
} }
return NULL; return null;
} }
function xri_to_nickname($xri) { function xri_to_nickname($xri) {
$base = $this->xri_base($xri); $base = $this->xri_base($xri);
if (!$base) { if (!$base) {
return NULL; return null;
} else { } else {
# =evan.prodromou # =evan.prodromou
# or @gratis*evan.prodromou # or @gratis*evan.prodromou
......
...@@ -278,7 +278,7 @@ class FinishremotesubscribeAction extends Action { ...@@ -278,7 +278,7 @@ class FinishremotesubscribeAction extends Action {
common_debug('got result: "'.print_r($result,TRUE).'"', __FILE__); common_debug('got result: "'.print_r($result,TRUE).'"', __FILE__);
if ($result->status != 200) { if ($result->status != 200) {
return NULL; return null;
} }
parse_str($result->body, $return); parse_str($result->body, $return);
......
...@@ -66,21 +66,21 @@ class FoafAction extends Action { ...@@ -66,21 +66,21 @@ class FoafAction extends Action {
# XXX: might not be a person # XXX: might not be a person
common_element_start('Person', array('rdf:about' => common_element_start('Person', array('rdf:about' =>
$user->uri)); $user->uri));
common_element('mbox_sha1sum', NULL, sha1('mailto:' . $user->email)); common_element('mbox_sha1sum', null, sha1('mailto:' . $user->email));
if ($profile->fullname) { if ($profile->fullname) {
common_element('name', NULL, $profile->fullname); common_element('name', null, $profile->fullname);
} }
if ($profile->homepage) { if ($profile->homepage) {
common_element('homepage', array('rdf:resource' => $profile->homepage)); common_element('homepage', array('rdf:resource' => $profile->homepage));
} }
if ($profile->bio) { if ($profile->bio) {
common_element('rdfs:comment', NULL, $profile->bio); common_element('rdfs:comment', null, $profile->bio);
} }
# XXX: more structured location data # XXX: more structured location data
if ($profile->location) { if ($profile->location) {
common_element_start('based_near'); common_element_start('based_near');
common_element_start('geo:SpatialThing'); 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('geo:SpatialThing');
common_element_end('based_near'); common_element_end('based_near');
} }
...@@ -156,7 +156,7 @@ class FoafAction extends Action { ...@@ -156,7 +156,7 @@ class FoafAction extends Action {
common_element_end('Person'); common_element_end('Person');
foreach ($person as $uri => $p) { foreach ($person as $uri => $p) {
$foaf_url = NULL; $foaf_url = null;
if ($p[1] instanceof User) { if ($p[1] instanceof User) {
$foaf_url = common_local_url('foaf', array('nickname' => $p[1]->nickname)); $foaf_url = common_local_url('foaf', array('nickname' => $p[1]->nickname));
} }
...@@ -166,7 +166,7 @@ class FoafAction extends Action { ...@@ -166,7 +166,7 @@ class FoafAction extends Action {
common_element('knows', array('rdf:resource' => $user->uri)); common_element('knows', array('rdf:resource' => $user->uri));
} }
$this->show_microblogging_account($profile, ($p[1] instanceof User) ? $this->show_microblogging_account($profile, ($p[1] instanceof User) ?
common_root_url() : NULL); common_root_url() : null);
if ($foaf_url) { if ($foaf_url) {
common_element('rdfs:seeAlso', array('rdf:resource' => $foaf_url)); common_element('rdfs:seeAlso', array('rdf:resource' => $foaf_url));
} }
...@@ -186,7 +186,7 @@ class FoafAction extends Action { ...@@ -186,7 +186,7 @@ class FoafAction extends Action {
common_element_end('PersonalProfileDocument'); common_element_end('PersonalProfileDocument');
} }
function show_microblogging_account($profile, $service=NULL) { function show_microblogging_account($profile, $service=null) {
# Their account # Their account
common_element_start('holdsAccount'); common_element_start('holdsAccount');
common_element_start('OnlineAccount'); common_element_start('OnlineAccount');
...@@ -194,7 +194,7 @@ class FoafAction extends Action { ...@@ -194,7 +194,7 @@ class FoafAction extends Action {
common_element('accountServiceHomepage', array('rdf:resource' => common_element('accountServiceHomepage', array('rdf:resource' =>
$service)); $service));
} }
common_element('accountName', NULL, $profile->nickname); common_element('accountName', null, $profile->nickname);
common_element('homepage', array('rdf:resource' => $profile->profileurl)); common_element('homepage', array('rdf:resource' => $profile->profileurl));
common_element_end('OnlineAccount'); common_element_end('OnlineAccount');
common_element_end('holdsAccount'); common_element_end('holdsAccount');
......
...@@ -28,7 +28,7 @@ class ImsettingsAction extends SettingsAction { ...@@ -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.'); return _('You can send and receive notices through Jabber/GTalk [instant messages](%%doc.im%%). Configure your address and settings below.');
}