Changed all $config[][] calls to common_config()

This commit is contained in:
Eric Helgeson 2009-03-09 20:01:35 -05:00
parent 945bbf00dc
commit c6cd87c106
9 changed files with 14 additions and 27 deletions

View File

@ -62,9 +62,8 @@ class FinishopenidloginAction extends Action
if ($this->error) { if ($this->error) {
$this->element('div', array('class' => 'error'), $this->error); $this->element('div', array('class' => 'error'), $this->error);
} else { } else {
global $config;
$this->element('div', 'instructions', $this->element('div', 'instructions',
sprintf(_('This is the first time you\'ve logged into %s so we must connect your OpenID to a local account. You can either create a new account, or connect with your existing account, if you have one.'), $config['site']['name'])); sprintf(_('This is the first time you\'ve logged into %s so we must connect your OpenID to a local account. You can either create a new account, or connect with your existing account, if you have one.'), common_config('site', 'name')));
} }
} }

View File

@ -82,10 +82,9 @@ class NoticesearchrssAction extends Rss10Action
function getChannel() function getChannel()
{ {
global $config;
$q = $this->trimmed('q'); $q = $this->trimmed('q');
$c = array('url' => common_local_url('noticesearchrss', array('q' => $q)), $c = array('url' => common_local_url('noticesearchrss', array('q' => $q)),
'title' => $config['site']['name'] . sprintf(_(' Search Stream for "%s"'), $q), 'title' => common_config('site', 'name') . sprintf(_(' Search Stream for "%s"'), $q),
'link' => common_local_url('noticesearch', array('q' => $q)), 'link' => common_local_url('noticesearch', array('q' => $q)),
'description' => sprintf(_('All updates matching search term "%s"'), $q)); 'description' => sprintf(_('All updates matching search term "%s"'), $q));
return $c; return $c;

View File

@ -84,12 +84,11 @@ class PublicrssAction extends Rss10Action
*/ */
function getChannel() function getChannel()
{ {
global $config;
$c = array( $c = array(
'url' => common_local_url('publicrss') 'url' => common_local_url('publicrss')
, 'title' => sprintf(_('%s Public Stream'), $config['site']['name']) , 'title' => sprintf(_('%s Public Stream'), common_config('site', 'name'))
, 'link' => common_local_url('public') , 'link' => common_local_url('public')
, 'description' => sprintf(_('All updates for %s'), $config['site']['name'])); , 'description' => sprintf(_('All updates for %s'), common_config('site', 'name')));
return $c; return $c;
} }

View File

@ -333,8 +333,6 @@ class RemotesubscribeAction extends Action
function requestAuthorization($user, $omb, $token, $secret) function requestAuthorization($user, $omb, $token, $secret)
{ {
global $config; # for license URL
$con = omb_oauth_consumer(); $con = omb_oauth_consumer();
$tok = new OAuthToken($token, $secret); $tok = new OAuthToken($token, $secret);
@ -358,7 +356,7 @@ class RemotesubscribeAction extends Action
$req->set_parameter('omb_listenee', $user->uri); $req->set_parameter('omb_listenee', $user->uri);
$req->set_parameter('omb_listenee_profile', common_profile_url($user->nickname)); $req->set_parameter('omb_listenee_profile', common_profile_url($user->nickname));
$req->set_parameter('omb_listenee_nickname', $user->nickname); $req->set_parameter('omb_listenee_nickname', $user->nickname);
$req->set_parameter('omb_listenee_license', $config['license']['url']); $req->set_parameter('omb_listenee_license', common_config('license', 'url'));
$profile = $user->getProfile(); $profile = $user->getProfile();
if (!$profile) { if (!$profile) {

View File

@ -50,10 +50,9 @@ function mail_backend()
static $backend = null; static $backend = null;
if (!$backend) { if (!$backend) {
global $config; $backend = Mail::factory(common_config('mail', 'backend'),
$backend = Mail::factory($config['mail']['backend'], (common_config('mail', 'params')) ?
($config['mail']['params']) ? common_config('mail', 'params') :
$config['mail']['params'] :
array()); array());
if (PEAR::isError($backend)) { if (PEAR::isError($backend)) {
common_server_error($backend->getMessage(), 500); common_server_error($backend->getMessage(), 500);

View File

@ -251,7 +251,6 @@ function omb_broadcast_profile($profile)
function omb_update_profile($profile, $remote_profile, $subscription) function omb_update_profile($profile, $remote_profile, $subscription)
{ {
global $config; # for license URL
$user = User::staticGet($profile->id); $user = User::staticGet($profile->id);
$con = omb_oauth_consumer(); $con = omb_oauth_consumer();
$token = new OAuthToken($subscription->token, $subscription->secret); $token = new OAuthToken($subscription->token, $subscription->secret);

View File

@ -110,8 +110,6 @@ class SearchAction extends Action
function showForm($error=null) function showForm($error=null)
{ {
global $config;
$q = $this->trimmed('q'); $q = $this->trimmed('q');
$page = $this->trimmed('page', 1); $page = $this->trimmed('page', 1);
$this->elementStart('form', array('method' => 'get', $this->elementStart('form', array('method' => 'get',
@ -122,7 +120,7 @@ class SearchAction extends Action
$this->element('legend', null, _('Search site')); $this->element('legend', null, _('Search site'));
$this->elementStart('ul', 'form_data'); $this->elementStart('ul', 'form_data');
$this->elementStart('li'); $this->elementStart('li');
if (!isset($config['site']['fancy']) || !$config['site']['fancy']) { if (!common_config('site', 'fancy')) {
$this->hidden('action', $this->trimmed('action')); $this->hidden('action', $this->trimmed('action'));
} }
$this->input('q', 'Keyword(s)', $q); $this->input('q', 'Keyword(s)', $q);

View File

@ -224,7 +224,6 @@ function is_twitter_bound($notice, $flink) {
function broadcast_twitter($notice) function broadcast_twitter($notice)
{ {
global $config;
$success = true; $success = true;
$flink = Foreign_link::getByUserID($notice->profile_id, $flink = Foreign_link::getByUserID($notice->profile_id,
@ -248,7 +247,7 @@ function broadcast_twitter($notice)
CURLOPT_POSTFIELDS => CURLOPT_POSTFIELDS =>
array( array(
'status' => $statustxt, 'status' => $statustxt,
'source' => $config['integration']['source'] 'source' => common_config('integration', 'source')
), ),
CURLOPT_RETURNTRANSFER => true, CURLOPT_RETURNTRANSFER => true,
CURLOPT_FAILONERROR => true, CURLOPT_FAILONERROR => true,

View File

@ -72,8 +72,7 @@ function common_timezone()
} }
} }
global $config; return common_config('site', 'timezone');
return $config['site']['timezone'];
} }
function common_language() function common_language()
@ -737,9 +736,8 @@ function common_local_url($action, $args=null, $params=null, $fragment=null)
function common_path($relative) function common_path($relative)
{ {
global $config; $pathpart = (common_config('site', 'path')) ? common_config('site', 'path')."/" : '';
$pathpart = ($config['site']['path']) ? $config['site']['path']."/" : ''; return "http://".common_config('site', 'server').'/'.$pathpart.$relative;
return "http://".$config['site']['server'].'/'.$pathpart.$relative;
} }
function common_date_string($dt) function common_date_string($dt)
@ -992,8 +990,7 @@ function common_ensure_syslog()
{ {
static $initialized = false; static $initialized = false;
if (!$initialized) { if (!$initialized) {
global $config; openlog(common_config('syslog', 'appname'), 0, LOG_USER);
openlog($config['syslog']['appname'], 0, LOG_USER);
$initialized = true; $initialized = true;
} }
} }