本文整理汇总了PHP中Util_Environment::redirect方法的典型用法代码示例。如果您正苦于以下问题:PHP Util_Environment::redirect方法的具体用法?PHP Util_Environment::redirect怎么用?PHP Util_Environment::redirect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Util_Environment
的用法示例。
在下文中一共展示了Util_Environment::redirect方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
/**
* Do logic
*/
function process()
{
/**
* Skip some pages
*/
switch (true) {
case defined('DOING_AJAX'):
case defined('DOING_CRON'):
case defined('APP_REQUEST'):
case defined('XMLRPC_REQUEST'):
case defined('WP_ADMIN'):
case defined('SHORTINIT') && SHORTINIT:
return;
}
/**
* Handle mobile or referrer redirects
*/
if ($this->_mobile || $this->_referrer) {
$mobile_redirect = $referrer_redirect = '';
if ($this->_mobile) {
$mobile_redirect = $this->_mobile->get_redirect();
}
if ($this->_referrer) {
$referrer_redirect = $this->_referrer->get_redirect();
}
$redirect = $mobile_redirect ? $mobile_redirect : $referrer_redirect;
if ($redirect) {
Util_Environment::redirect($redirect);
exit;
}
}
}
示例2: redirect_with_custom_messages2
/**
* Special redirect with ability to pass custom_message_id based on $data
* query_string
* actions - which actions to call on render
* errors
* notes
*/
public static function redirect_with_custom_messages2($data)
{
if (!isset($data['query_string']['page'])) {
$data['query_string']['page'] = Util_Request::get_string('page');
if ($data['query_string']['page'] == 'w3tc_extensions') {
$data['query_string']['extension'] = Util_Request::get_string('extension');
$data['query_string']['action'] = Util_Request::get_string('action');
}
}
$message_id = uniqid();
set_transient('w3tc_message', array($message_id => $data), 600);
$data['query_string']['w3tc_message'] = $message_id;
Util_Environment::redirect('admin.php', $data['query_string']);
}
示例3: w3tc_default_previewing
/**
* Start previewing
*/
function w3tc_default_previewing()
{
Util_Environment::set_preview(true);
Util_Environment::redirect(get_home_url());
}
示例4: w3tc_cdn_netdna_authorize
function w3tc_cdn_netdna_authorize()
{
try {
$state = Dispatcher::config_state();
if ($state->get_integer('track.maxcdn_authorize', 0) == 0) {
$state->set('track.maxcdn_authorize', time());
$state->save();
}
} catch (\Exception $ex) {
}
Util_Environment::redirect(NETDNA_AUTHORIZE_URL);
}