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


PHP POD::tableList方法代码示例

本文整理汇总了PHP中POD::tableList方法的典型用法代码示例。如果您正苦于以下问题:PHP POD::tableList方法的具体用法?PHP POD::tableList怎么用?PHP POD::tableList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在POD的用法示例。


在下文中一共展示了POD::tableList方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: doesExistTable

function doesExistTable($tablename)
{
    global $database;
    static $tables = array();
    if (empty($tables)) {
        $tables = POD::tableList($database['prefix']);
    }
    $dbCaseInsensitive = Setting::getServiceSetting('lowercaseTableNames', null, 'global');
    if ($dbCaseInsensitive === null) {
        if (in_array(POD::dbms(), array('MySQL', 'MySQLi'))) {
            $result = POD::queryRow("SHOW VARIABLES LIKE 'lower_case_table_names'");
            $dbCaseInsensitive = $result['Value'] == 1 ? 1 : 0;
        } else {
            $dbCaseInsensitive = 1;
        }
        Setting::setServiceSetting('lowercaseTableNames', $dbCaseInsensitive, true);
    }
    if ($dbCaseInsensitive == 1) {
        $tablename = strtolower($tablename);
    }
    if (in_array($tablename, $tables)) {
        return true;
    }
    return false;
}
开发者ID:ragi79,项目名称:Textcube,代码行数:25,代码来源:DBModel.php

示例2: _t

										<th class="tablename"><span class="text"><?php 
    echo _t('테이블 이름');
    ?>
</span></th>
										<th class="delete"><span class="text"><?php 
    echo _t('삭제');
    ?>
</span></th>
									</tr>
								</thead>
								<tbody>
<?php 
    //$likeEscape = array ( '/_/' , '/%/' );
    //$likeReplace = array ( '\\_' , '\\%' );
    //$escapename = preg_replace($likeEscape, $likeReplace, $database['prefix']);
    $dbtables = POD::tableList($database['prefix']);
    if (in_array(POD::dbms(), array('MySQL', 'MySQLi'))) {
        $result = POD::queryRow("SHOW VARIABLES LIKE 'lower_case_table_names'");
        $dbCaseInsensitive = $result['Value'] == 1 ? true : false;
    } else {
        $dbCaseInsensitive = true;
    }
    requireModel('common.setting');
    $definedTables = getDefinedTableNames();
    $dbtables = array_values(array_diff($dbtables, $definedTables));
    if ($dbCaseInsensitive == true) {
        $tempTables = $definedTables;
        $definedTables = array();
        foreach ($tempTables as $table) {
            $table = strtolower($table);
            array_push($definedTables, $table);
开发者ID:ragi79,项目名称:Textcube,代码行数:31,代码来源:index.php

示例3: getPluginTableName

function getPluginTableName()
{
    importlib('model.common.setting');
    $context = Model_Context::getInstance();
    $likeEscape = array('/_/', '/%/');
    $likeReplace = array('\\_', '\\%');
    $escapename = preg_replace($likeEscape, $likeReplace, $context->getProperty('database.prefix'));
    $dbtables = POD::tableList($escapename);
    $dbCaseInsensitive = Setting::getServiceSetting('lowercaseTableNames', true);
    if ($dbCaseInsensitive === null) {
        doesExistTable('');
        // determine the table name rule. (lowercase only / mixed cases)
    }
    $definedTables = getDefinedTableNames();
    $dbtables = array_values(array_diff($dbtables, $definedTables));
    if ($dbCaseInsensitive == 1) {
        $tempTables = $definedTables;
        $definedTables = array();
        foreach ($tempTables as $table) {
            $table = strtolower($table);
            array_push($definedTables, $table);
        }
        $tempTables = $dbtables;
        $dbtables = array();
        foreach ($tempTables as $table) {
            $table = strtolower($table);
            array_push($dbtables, $table);
        }
        $dbtables = array_values(array_diff($dbtables, $definedTables));
    }
    return $dbtables;
}
开发者ID:webhacking,项目名称:Textcube,代码行数:32,代码来源:plugin.php

示例4: checkStep


//.........这里部分代码省略.........
                                ?>
                  <li style="color:red"><?php 
                                echo $function;
                                ?>
</li>
<?php 
                            }
                        }
                    }
                    ?>
    </ul>
    <h3><?php 
                    echo POD::dbms();
                    ?>
</h3>
    <ul>
<?php 
                    if (POD::charset() == 'utf8') {
                        echo '<li>Character Set: OK</li>';
                    } else {
                        echo '<li style="color:navy">Character Set: ', _t('UTF8 미지원 (경고: 한글 지원이 불완전할 수 있습니다.)'), '</li>';
                    }
                    if (POD::query("CREATE TABLE {$_POST['dbPrefix']}Setup (a INT NOT NULL)")) {
                        POD::query("DROP TABLE {$_POST['dbPrefix']}Setup");
                        echo '<li>', _t('테이블 생성 권한'), ': OK</li>';
                    } else {
                        $error = 6;
                        echo '<li style="color:red">', _t('테이블 생성 권한'), ': ', _t('없음'), '</li>';
                    }
                    ?>
    </ul>
<?php 
                    $tables = array();
                    if ($result = POD::tableList()) {
                        foreach ($result as $table) {
                            if (strncmp($table, $_POST['dbPrefix'], strlen($_POST['dbPrefix']))) {
                                continue;
                            }
                            switch (strtolower(substr($table, strlen($_POST['dbPrefix'])))) {
                                case 'attachments':
                                case 'blogsettings':
                                case 'blogstatistics':
                                case 'categories':
                                case 'comments':
                                case 'commentsnotified':
                                case 'commentsnotifiedqueue':
                                case 'commentsnotifiedsiteinfo':
                                case 'dailystatistics':
                                case 'entries':
                                case 'entriesarchive':
                                case 'feedgrouprelations':
                                case 'feedgroups':
                                case 'feeditems':
                                case 'feedreads':
                                case 'feedsettings':
                                case 'feedstarred':
                                case 'feeds':
                                case 'filters':
                                case 'linkcategories':
                                case 'links':
                                case 'openidusers':
                                case 'pagecachelog':
                                case 'plugins':
                                case 'refererlogs':
                                case 'refererstatistics':
                                case 'reservedwords':
开发者ID:hoksi,项目名称:Textcube,代码行数:67,代码来源:setup.php

示例5: getPluginTableName

function getPluginTableName()
{
    requireModel('common.setting');
    $ctx = Model_Context::getInstance();
    $likeEscape = array('/_/', '/%/');
    $likeReplace = array('\\_', '\\%');
    $escapename = preg_replace($likeEscape, $likeReplace, $ctx->getProperty('database.prefix'));
    $dbtables = POD::tableList($escapename);
    $dbCaseInsensitive = Setting::getServiceSetting('lowercaseTableNames', true);
    if ($dbCaseInsensitive === null) {
        $result = POD::queryRow("SHOW VARIABLES LIKE 'lower_case_table_names'");
        $dbCaseInsensitive = $result['Value'] == 1 ? 1 : 0;
        Setting::setServiceSetting('lowercaseTableNames', $dbCaseInsensitive, true);
    }
    $definedTables = getDefinedTableNames();
    $dbtables = array_values(array_diff($dbtables, $definedTables));
    if ($dbCaseInsensitive == 1) {
        $tempTables = $definedTables;
        $definedTables = array();
        foreach ($tempTables as $table) {
            $table = strtolower($table);
            array_push($definedTables, $table);
        }
        $tempTables = $dbtables;
        $dbtables = array();
        foreach ($tempTables as $table) {
            $table = strtolower($table);
            array_push($dbtables, $table);
        }
        $dbtables = array_values(array_diff($dbtables, $definedTables));
    }
    return $dbtables;
}
开发者ID:ragi79,项目名称:Textcube,代码行数:33,代码来源:common.plugin.php


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