當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Dba::check_database_inserted方法代碼示例

本文整理匯總了PHP中Dba::check_database_inserted方法的典型用法代碼示例。如果您正苦於以下問題:PHP Dba::check_database_inserted方法的具體用法?PHP Dba::check_database_inserted怎麽用?PHP Dba::check_database_inserted使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Dba的用法示例。


在下文中一共展示了Dba::check_database_inserted方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: T_

    ?>
    </td>
    <td>
    <?php 
    echo T_('This attempts to connect to your database using the values read from your configuration file.');
    ?>
    </td>
</tr>
<tr>
    <td valign="top"><?php 
    echo T_('Database tables');
    ?>
</td>
    <td valign="top">
    <?php 
    echo debug_result(check_php_pdo() && Dba::check_database_inserted());
    ?>
    </td>
    <td>
    <?php 
    echo T_('This checks a few key tables to make sure that you have successfully inserted the Ampache database and that the user has access to the database');
    ?>
    </td>
</tr>
<tr>

    <td valign="top"><?php 
    echo T_('Web path');
    ?>
</td>
    <td valign="top">
開發者ID:bl00m,項目名稱:ampache,代碼行數:31,代碼來源:show_test_table.inc.php

示例2: install_create_account

/**
 * install_create_account
 * this creates your initial account and sets up the preferences for the -1 user and you
 */
function install_create_account($username, $password, $password2)
{
    if (!strlen($username) or !strlen($password)) {
        Error::add('general', T_('No Username/Password specified'));
        return false;
    }
    if ($password !== $password2) {
        Error::add('general', T_('Passwords do not match'));
        return false;
    }
    if (!Dba::check_database()) {
        Error::add('general', sprintf(T_('Database connection failed: %s'), Dba::error()));
        return false;
    }
    if (!Dba::check_database_inserted()) {
        Error::add('general', sprintf(T_('Database select failed: %s'), Dba::error()));
        return false;
    }
    $username = Dba::escape($username);
    $password = Dba::escape($password);
    $insert_id = User::create($username, 'Administrator', '', '', $password, '100');
    if (!$insert_id) {
        Error::add('general', sprintf(T_('Administrative user creation failed: %s'), Dba::error()));
        return false;
    }
    // Fix the system users preferences
    User::fix_preferences('-1');
    return true;
}
開發者ID:nioc,項目名稱:ampache,代碼行數:33,代碼來源:install.lib.php


注:本文中的Dba::check_database_inserted方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。