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


PHP Installer::create_database方法代碼示例

本文整理匯總了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";
開發者ID:katopenzz,項目名稱:openemr,代碼行數:31,代碼來源:setup.php

示例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
開發者ID:istrwei,項目名稱:Luna,代碼行數:31,代碼來源:install.php


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