Move declarations of globals into functions, so that unit tests are possible
This commit is contained in:
parent
8eaaa70f21
commit
d3fa11c19b
@ -9,6 +9,40 @@ if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets required globals
|
||||
*/
|
||||
function PMA_EVN_setGlobals()
|
||||
{
|
||||
global $event_status, $event_type, $event_interval;
|
||||
|
||||
$event_status = array(
|
||||
'query' => array('ENABLE',
|
||||
'DISABLE',
|
||||
'DISABLE ON SLAVE'),
|
||||
'display' => array('ENABLED',
|
||||
'DISABLED',
|
||||
'SLAVESIDE_DISABLED')
|
||||
);
|
||||
$event_type = array('RECURRING',
|
||||
'ONE TIME');
|
||||
$event_interval = array('YEAR',
|
||||
'QUARTER',
|
||||
'MONTH',
|
||||
'DAY',
|
||||
'HOUR',
|
||||
'MINUTE',
|
||||
'WEEK',
|
||||
'SECOND',
|
||||
'YEAR_MONTH',
|
||||
'DAY_HOUR',
|
||||
'DAY_MINUTE',
|
||||
'DAY_SECOND',
|
||||
'HOUR_MINUTE',
|
||||
'HOUR_SECOND',
|
||||
'MINUTE_SECOND');
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is defined in: rte_routines.lib.php, rte_triggers.lib.php and
|
||||
* rte_events.lib.php. It is used to retreive some language strings that are
|
||||
@ -40,6 +74,7 @@ function PMA_RTE_main()
|
||||
{
|
||||
global $db;
|
||||
|
||||
PMA_EVN_setGlobals();
|
||||
/**
|
||||
* Process all requests
|
||||
*/
|
||||
|
||||
@ -71,51 +71,6 @@ $titles = PMA_buildActionTitles();
|
||||
*/
|
||||
$errors = array();
|
||||
|
||||
// Some definitions for triggers
|
||||
$action_timings = array('BEFORE',
|
||||
'AFTER');
|
||||
$event_manipulations = array('INSERT',
|
||||
'UPDATE',
|
||||
'DELETE');
|
||||
|
||||
// Some definitions for routines
|
||||
$param_directions = array('IN',
|
||||
'OUT',
|
||||
'INOUT');
|
||||
$param_opts_num = array('UNSIGNED',
|
||||
'ZEROFILL',
|
||||
'UNSIGNED ZEROFILL');
|
||||
$param_sqldataaccess = array('NO SQL',
|
||||
'CONTAINS SQL',
|
||||
'READS SQL DATA',
|
||||
'MODIFIES SQL DATA');
|
||||
|
||||
// Some definitions for events
|
||||
$event_status = array(
|
||||
'query' => array('ENABLE',
|
||||
'DISABLE',
|
||||
'DISABLE ON SLAVE'),
|
||||
'display' => array('ENABLED',
|
||||
'DISABLED',
|
||||
'SLAVESIDE_DISABLED')
|
||||
);
|
||||
$event_type = array('RECURRING',
|
||||
'ONE TIME');
|
||||
$event_interval = array('YEAR',
|
||||
'QUARTER',
|
||||
'MONTH',
|
||||
'DAY',
|
||||
'HOUR',
|
||||
'MINUTE',
|
||||
'WEEK',
|
||||
'SECOND',
|
||||
'YEAR_MONTH',
|
||||
'DAY_HOUR',
|
||||
'DAY_MINUTE',
|
||||
'DAY_SECOND',
|
||||
'HOUR_MINUTE',
|
||||
'HOUR_SECOND',
|
||||
'MINUTE_SECOND');
|
||||
/**
|
||||
* The below function is defined in rte_routines.lib.php,
|
||||
* rte_triggers.lib.php and rte_events.lib.php
|
||||
|
||||
@ -9,6 +9,25 @@ if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets required globals
|
||||
*/
|
||||
function PMA_RTN_setGlobals()
|
||||
{
|
||||
global $param_directions, $param_opts_num, $param_sqldataaccess;
|
||||
|
||||
$param_directions = array('IN',
|
||||
'OUT',
|
||||
'INOUT');
|
||||
$param_opts_num = array('UNSIGNED',
|
||||
'ZEROFILL',
|
||||
'UNSIGNED ZEROFILL');
|
||||
$param_sqldataaccess = array('NO SQL',
|
||||
'CONTAINS SQL',
|
||||
'READS SQL DATA',
|
||||
'MODIFIES SQL DATA');
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is defined in: rte_routines.lib.php, rte_triggers.lib.php and
|
||||
* rte_events.lib.php. It is used to retreive some language strings that are
|
||||
@ -40,6 +59,7 @@ function PMA_RTE_main()
|
||||
{
|
||||
global $db;
|
||||
|
||||
PMA_RTN_setGlobals();
|
||||
/**
|
||||
* Process all requests
|
||||
*/
|
||||
|
||||
@ -9,6 +9,21 @@ if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets required globals
|
||||
*/
|
||||
function PMA_TRI_setGlobals()
|
||||
{
|
||||
global $action_timings, $event_manipulations;
|
||||
|
||||
// Some definitions for triggers
|
||||
$action_timings = array('BEFORE',
|
||||
'AFTER');
|
||||
$event_manipulations = array('INSERT',
|
||||
'UPDATE',
|
||||
'DELETE');
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is defined in: rte_routines.lib.php, rte_triggers.lib.php and
|
||||
* rte_events.lib.php. It is used to retreive some language strings that are
|
||||
@ -40,6 +55,7 @@ function PMA_RTE_main()
|
||||
{
|
||||
global $db, $table;
|
||||
|
||||
PMA_TRI_setGlobals();
|
||||
/**
|
||||
* Process all requests
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user