本文整理汇总了PHP中Installer::create_database方法的典型用法代码示例。如果您正苦于以下问题:PHP Installer::create_database方法的具体用法?PHP Installer::create_database怎么用?PHP Installer::create_database使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Installer
的用法示例。
在下文中一共展示了Installer::create_database方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: flush
// Only pertinent if mirroring another installation directory
if (!empty($installer->source_site_id)) {
echo "Creating site directory...";
if (!$installer->create_site_directory()) {
echo $installer->error_message;
break;
} else {
echo "OK.<BR>";
flush();
}
}
// Skip below if database shell has already been created.
if ($inst != 2) {
echo "Creating database...\n";
flush();
if (!$installer->create_database()) {
echo "ERROR. Check your login credentials.\n";
echo $installer->error_message;
break;
} else {
echo "OK.<br>\n";
flush();
}
echo "Creating user with permissions for database...\n";
flush();
if (!$installer->grant_privileges()) {
echo "ERROR when granting privileges to the specified user.\n";
echo $installer->error_message;
break;
} else {
echo "OK.<br>\n";
示例2: _e
<input type="submit" class="btn btn-primary" name="start" value="<?php
_e('Start install', 'luna');
?>
" />
</div>
</div>
</form>
</div>
</body>
</html>
<?php
} else {
// Enable/disable avatars depending on file_uploads setting in PHP configuration
$avatars = in_array(strtolower(@ini_get('file_uploads')), array('on', 'true', '1'));
// Create the tables
$db = Installer::create_database($db_type, $db_host, $db_name, $db_username, $db_password, $db_prefix, $title, $description, $default_lang, $default_style, $email, $avatars, $base_url);
// Insert some other default data
Installer::insert_default_groups();
// groups
Installer::insert_default_users($username, $password1, $email, $default_lang, $default_style);
// users
Installer::instert_default_menu();
// menus
Installer::insert_default_data();
// other stuff, like ranks
$alerts = array();
// Check if we disabled uploading avatars because file_uploads was disabled
if (!$avatars) {
$alerts[] = __('<strong>File uploads appear to be disallowed on this server!</strong> If you want users to be able to upload their own avatar images you must enable the file_uploads configuration setting in PHP. Once file uploads have been enabled, avatar uploads can be enabled in Administration/Options/Features.', 'luna');
}
// Generate the config.php file data