本文整理汇总了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">
示例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;
}