本文整理汇总了PHP中PMA_extractDbOrTable函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_extractDbOrTable函数的具体用法?PHP PMA_extractDbOrTable怎么用?PHP PMA_extractDbOrTable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PMA_extractDbOrTable函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PMA_getServerSlaveStatus
/**
* Get the server slave state
*
* @param boolean $server_slave_status server slave state
* @param string $truename true name
*
* @return array ($do, $ignored)
*/
function PMA_getServerSlaveStatus($server_slave_status, $truename)
{
$ignored = false;
$do = false;
include_once 'libraries/replication.inc.php';
if ($server_slave_status) {
$nbServerSlaveDoDb = count($server_slave_Do_DB);
$nbServerSlaveIgnoreDb = count($server_slave_Ignore_DB);
if (strlen(array_search($truename, $server_slave_Do_Table)) > 0 || strlen(array_search($GLOBALS['db'], $server_slave_Do_DB)) > 0 || $nbServerSlaveDoDb == 1 && $nbServerSlaveIgnoreDb == 1) {
$do = true;
}
foreach ($server_slave_Wild_Do_Table as $db_table) {
$table_part = PMA_extractDbOrTable($db_table, 'table');
$pattern = "@^" . substr($table_part, 0, strlen($table_part) - 1) . "@";
if ($GLOBALS['db'] == PMA_extractDbOrTable($db_table, 'db') && preg_match($pattern, $truename)) {
$do = true;
}
}
if (strlen(array_search($truename, $server_slave_Ignore_Table)) > 0 || strlen(array_search($GLOBALS['db'], $server_slave_Ignore_DB)) > 0) {
$ignored = true;
}
foreach ($server_slave_Wild_Ignore_Table as $db_table) {
$table_part = PMA_extractDbOrTable($db_table, 'table');
$pattern = "@^" . substr($table_part, 0, strlen($table_part) - 1) . "@";
if ($db == PMA_extractDbOrTable($db_table) && preg_match($pattern, $truename)) {
$ignored = true;
}
}
}
return array($do, $ignored);
}
示例2: hasTable
/**
* Find table with truename
*
* @param array $db DB to look into
* @param string $truename Table name
*
* @return bool
*/
protected function hasTable($db, $truename)
{
foreach ($db as $db_table) {
if ($this->db == PMA_extractDbOrTable($db_table) && preg_match("@^" . mb_substr(PMA_extractDbOrTable($db_table, 'table'), 0, -1) . "@", $truename)) {
return true;
}
}
return false;
}
示例3: PMA_getServerSlaveStatus
/**
* Get the server slave state
*
* @param boolean $server_slave_status server slave state
* @param string $truename true name
*
* @return array ($do, $ignored)
*/
function PMA_getServerSlaveStatus($server_slave_status, $truename)
{
$ignored = false;
$do = false;
include_once 'libraries/replication.inc.php';
if (!$server_slave_status) {
return array($do, $ignored);
}
$nbServSlaveDoDb = count($GLOBALS['replication_info']['slave']['Do_DB']);
$nbServSlaveIgnoreDb = count($GLOBALS['replication_info']['slave']['Ignore_DB']);
$searchDoDBInTruename = array_search($truename, $GLOBALS['replication_info']['slave']['Do_DB']);
$searchDoDBInDB = array_search($GLOBALS['db'], $GLOBALS['replication_info']['slave']['Do_DB']);
if (strlen($searchDoDBInTruename) > 0 || strlen($searchDoDBInDB) > 0 || $nbServSlaveDoDb == 1 && $nbServSlaveIgnoreDb == 1) {
$do = true;
}
foreach ($GLOBALS['replication_info']['slave']['Wild_Do_Table'] as $db_table) {
$table_part = PMA_extractDbOrTable($db_table, 'table');
$pattern = "@^" . mb_substr($table_part, 0, -1) . "@";
if ($GLOBALS['db'] == PMA_extractDbOrTable($db_table, 'db') && preg_match($pattern, $truename)) {
$do = true;
}
}
$searchDb = array_search($GLOBALS['db'], $GLOBALS['replication_info']['slave']['Ignore_DB']);
$searchTable = array_search($truename, $GLOBALS['replication_info']['slave']['Ignore_Table']);
if (strlen($searchTable) > 0 || strlen($searchDb) > 0) {
$ignored = true;
}
foreach ($GLOBALS['replication_info']['slave']['Wild_Ignore_Table'] as $db_table) {
$table_part = PMA_extractDbOrTable($db_table, 'table');
$pattern = "@^" . mb_substr($table_part, 0, -1) . "@";
if ($GLOBALS['db'] == PMA_extractDbOrTable($db_table) && preg_match($pattern, $truename)) {
$ignored = true;
}
}
return array($do, $ignored);
}