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


PHP Install::install方法代碼示例

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


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

示例1: Install

<?php

/**
 * @desc: 版權所有,翻版必究,未經同意不得用於商業項目
 * @author: 樊亞磊
 * @mail:fanyalei@aliyun.com
 * @QQ:451802973
 */
ini_set('display_errors', 'Off');
include_once 'conf/config.php';
if (!file_exists(CONFIG_PATH . 'install.lock')) {
    include_once ACTION_PATH . 'Install.class.php';
    $install = new Install();
    echo $install->install();
}
開發者ID:xpchg,項目名稱:iBarn,代碼行數:15,代碼來源:install.php

示例2: Flash

<?php

if (defined(BASE_URL) or defined(UPLOAD_DIR) or defined(SITE_TITLE) or defined(SITE_THEME) or defined(ADMIN_THEME) or defined(MYSQL_SERVERNAME) or defined(MYSQL_USERNAME) or empty(MYSQL_DB)) {
    $flash = new Flash();
    $flash->flash('flash_message', 'Please fix your gw-config.php!', 'danger');
} else {
    if (mysqli_ping(db_connect())) {
        $install = new Install();
        $install->install();
    } else {
        $flash = new Flash();
        $flash->flash('flash_message', 'Could not connect to database!', 'danger');
    }
}
開發者ID:gwhitcher,項目名稱:gwpress,代碼行數:14,代碼來源:install.php

示例3: dirname

require_once dirname(__FILE__) . '/../includes/install/ConfigInstallException.class.php';
require_once dirname(__FILE__) . '/../includes/install/DatabaseInstallException.class.php';
require_once dirname(__FILE__) . '/../includes/install/Install.class.php';
require_once dirname(__FILE__) . '/../includes/clearbricks/common/lib.l10n.php';
if (isset($_POST['validate_install'])) {
    // ActionState business.
    $logUsers = isset($_POST['logs_users_activate']) ? 'true' : 'false';
    $useOpenID = isset($_POST['openid_mode']) ? 'true' : 'false';
    $useServiceBrowser = isset($_POST['service_browser_activate']) ? 'true' : 'false';
    $errorMessage = '';
    try {
        $configFileIn = dirname(__FILE__) . '/../includes/config-sample.php';
        $configFileOut = dirname(__FILE__) . '/../includes/config.php';
        $params = array('database_login' => $_POST['database_login'], 'database_password' => $_POST['database_password'], 'database_name' => $_POST['database_name'], 'database_url' => $_POST['database_url'], 'theme_name' => $_POST['theme_name'], 'language' => $_POST['language'], 'openid_mode' => $useOpenID, 'application_name' => $_POST['application_name'], 'logs_users_activate' => $logUsers, 'logs_users_path' => $_POST['logs_users_path'], 'service_browser_activate' => $useServiceBrowser, 'service_browser_uri' => $_POST['service_browser_uri'], 'portal_uri' => $_POST['portal_uri']);
        $installer = new Install($configFileIn, $configFileOut, $params);
        $installer->install();
        header('Location: success.php');
        exit;
    } catch (DatabaseInstallException $dbEx) {
        $dbmsError = $dbEx->getDBMSMessage();
        switch ($dbEx->getCode()) {
            case DatabaseInstallException::FAILED_TO_CONNECT:
                $errorMessage = __("Failed to connect to the Database Management System. Please verify the provided database configuration.");
                break;
            case DatabaseInstallException::FAILED_TO_CREATE_DB:
                $errorMessage = __("Failed to create database: {$dbmsError}. Is the chosen database name already used ?");
                break;
            case DatabaseInstallException::FAILED_TO_CREATE_TABLE:
                $errorMessage = __("Failed to create a table in the database: {$dbmsError}.");
                break;
            case DatabaseInstallException::FAILED_TO_INSERT_DATA:
開發者ID:ripplecrpht,項目名稱:ripplecrpht,代碼行數:31,代碼來源:index.php


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