当前位置: 首页>>代码示例>>PHP>>正文


PHP PMA_extractDbOrTable函数代码示例

本文整理汇总了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);
}
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:39,代码来源:structure.lib.php

示例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;
 }
开发者ID:TheBlackBloodyUnicorn,项目名称:pico_wanderblog,代码行数:17,代码来源:DatabaseStructureController.class.php

示例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);
}
开发者ID:tecshuttle,项目名称:51qsk,代码行数:44,代码来源:structure.lib.php


注:本文中的PMA_extractDbOrTable函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。