本文整理匯總了PHP中PMA_Tracker::enable方法的典型用法代碼示例。如果您正苦於以下問題:PHP PMA_Tracker::enable方法的具體用法?PHP PMA_Tracker::enable怎麽用?PHP PMA_Tracker::enable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PMA_Tracker
的用法示例。
在下文中一共展示了PMA_Tracker::enable方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1:
if (isset($response) && $response->isAjax() && $token_mismatch) {
$response->isSuccess(false);
$response->addJSON('message', PMA_Message::error(__('Error: Token mismatch')));
exit;
}
} else {
// end if !defined('PMA_MINIMUM_COMMON')
// load user preferences
$GLOBALS['PMA_Config']->loadUserPreferences();
}
// remove sensitive values from session
$GLOBALS['PMA_Config']->set('blowfish_secret', '');
$GLOBALS['PMA_Config']->set('Servers', '');
$GLOBALS['PMA_Config']->set('default_server', '');
/* Tell tracker that it can actually work */
PMA_Tracker::enable();
/**
* @global boolean $GLOBALS['is_ajax_request']
* @todo should this be moved to the variables init section above?
*
* Check if the current request is an AJAX request, and set is_ajax_request
* accordingly. Suppress headers, footers and unnecessary output if set to
* true
*/
if (isset($_REQUEST['ajax_request']) && $_REQUEST['ajax_request'] == true) {
$GLOBALS['is_ajax_request'] = true;
} else {
$GLOBALS['is_ajax_request'] = false;
}
if (isset($_REQUEST['GLOBALS']) || isset($_FILES['GLOBALS'])) {
PMA_fatalError(__("GLOBALS overwrite attempt"));
示例2: testIsTracked
/**
* Test for PMA_Tracker::isTracked()
*
* @return void
* @test
*/
public function testIsTracked()
{
$attr = new \ReflectionProperty('PMA_Tracker', 'enabled');
$attr->setAccessible(true);
$attr->setValue(null, false);
$reflection = new \ReflectionProperty('PMA_Tracker', 'pma_table');
$reflection->setAccessible(true);
$reflection->setValue(null, 'pma_table_tracking');
$this->assertFalse(
PMA_Tracker::isTracked("", "")
);
PMA_Tracker::enable();
$_SESSION['relation'][$GLOBALS['server']]['trackingwork'] = false;
$this->assertFalse(
PMA_Tracker::isTracked("", "")
);
$_SESSION['relation'][$GLOBALS['server']]['trackingwork'] = true;
$this->assertTrue(
PMA_Tracker::isTracked("pma_test_db", "pma_test_table")
);
$reflection->setValue(null, 'pma_table_tracking');
$this->assertFalse(
PMA_Tracker::isTracked("pma_test_db", "pma_test_table2")
);
}