本文整理汇总了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")
);
}