当前位置: 首页>>代码示例>>PHP>>正文


PHP drupal_check_profile函数代码示例

本文整理汇总了PHP中drupal_check_profile函数的典型用法代码示例。如果您正苦于以下问题:PHP drupal_check_profile函数的具体用法?PHP drupal_check_profile怎么用?PHP drupal_check_profile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了drupal_check_profile函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: install_check_requirements

/**
 * Page to check installation requirements and report any errors.
 */
function install_check_requirements($profile)
{
    $requirements = drupal_check_profile($profile);
    $severity = drupal_requirements_severity($requirements);
    // If there are issues, report them.
    if ($severity == REQUIREMENT_ERROR) {
        drupal_maintenance_theme();
        foreach ($requirements as $requirement) {
            if (isset($requirement['severity']) && $requirement['severity'] == REQUIREMENT_ERROR) {
                drupal_set_message($requirement['description'] . ' (' . st('Currently using !item !version', array('!item' => $requirement['title'], '!version' => $requirement['value'])) . ')', 'error');
            }
        }
        drupal_set_title(st('Incompatible environment'));
        print theme('install_page', '');
        exit;
    }
}
开发者ID:jiva-technology,项目名称:smcuk,代码行数:20,代码来源:install.php

示例2: install_check_requirements

/**
 * Check installation requirements and report any errors.
 */
function install_check_requirements($profile, $verify)
{
    // If Drupal is not set up already, we need to create a settings file.
    if (!$verify) {
        $writable = FALSE;
        $conf_path = './' . conf_path(FALSE, TRUE);
        $settings_file = $conf_path . '/settings.php';
        $file = $conf_path;
        $exists = FALSE;
        // Verify that the directory exists.
        if (drupal_verify_install_file($conf_path, FILE_EXIST, 'dir')) {
            // Check to make sure a settings.php already exists.
            $file = $settings_file;
            if (drupal_verify_install_file($settings_file, FILE_EXIST)) {
                $exists = TRUE;
                // If it does, make sure it is writable.
                $writable = drupal_verify_install_file($settings_file, FILE_READABLE | FILE_WRITABLE);
            }
        }
        if (!$exists) {
            drupal_set_message(st('The @drupal installer requires that you create a settings file as part of the installation process.
<ol>
<li>Copy the %default_file file to %file.</li>
<li>Change file permissions so that it is writable by the web server. If you are unsure how to grant file permissions, please consult the <a href="@handbook_url">on-line handbook</a>.</li>
</ol>
More details about installing Drupal are available in INSTALL.txt.', array('@drupal' => drupal_install_profile_name(), '%file' => $file, '%default_file' => $conf_path . '/default.settings.php', '@handbook_url' => 'http://drupal.org/server-permissions')), 'error');
        } elseif (!$writable) {
            drupal_set_message(st('The @drupal installer requires write permissions to %file during the installation process. If you are unsure how to grant file permissions, please consult the <a href="@handbook_url">on-line handbook</a>.', array('@drupal' => drupal_install_profile_name(), '%file' => $file, '@handbook_url' => 'http://drupal.org/server-permissions')), 'error');
        }
    }
    // Check the other requirements.
    $requirements = drupal_check_profile($profile);
    $severity = drupal_requirements_severity($requirements);
    // If there are issues, report them.
    if ($severity == REQUIREMENT_ERROR) {
        foreach ($requirements as $requirement) {
            if (isset($requirement['severity']) && $requirement['severity'] == REQUIREMENT_ERROR) {
                $message = $requirement['description'];
                if (isset($requirement['value']) && $requirement['value']) {
                    $message .= ' (' . st('Currently using !item !version', array('!item' => $requirement['title'], '!version' => $requirement['value'])) . ')';
                }
                drupal_set_message($message, 'error');
            }
        }
    }
    if ($severity == REQUIREMENT_WARNING) {
        foreach ($requirements as $requirement) {
            if (isset($requirement['severity']) && $requirement['severity'] == REQUIREMENT_WARNING) {
                $message = $requirement['description'];
                if (isset($requirement['value']) && $requirement['value']) {
                    $message .= ' (' . st('Currently using !item !version', array('!item' => $requirement['title'], '!version' => $requirement['value'])) . ')';
                }
                drupal_set_message($message, 'warning');
            }
        }
    }
}
开发者ID:alexismb5,项目名称:ckan-drupal,代码行数:60,代码来源:install.php

示例3: install_check_requirements

/**
 * Check installation requirements and report any errors.
 */
function install_check_requirements($profile, $verify)
{
    // Check the profile requirements.
    $requirements = drupal_check_profile($profile);
    // If Drupal is not set up already, we need to create a settings file.
    if (!$verify) {
        $writable = FALSE;
        $conf_path = './' . conf_path(FALSE, TRUE);
        $settings_file = $conf_path . '/settings.php';
        $file = $conf_path;
        $exists = FALSE;
        // Verify that the directory exists.
        if (drupal_verify_install_file($conf_path, FILE_EXIST, 'dir')) {
            // Check to make sure a settings.php already exists.
            $file = $settings_file;
            if (drupal_verify_install_file($settings_file, FILE_EXIST)) {
                $exists = TRUE;
                // If it does, make sure it is writable.
                $writable = drupal_verify_install_file($settings_file, FILE_READABLE | FILE_WRITABLE);
                $exists = TRUE;
            }
        }
        if (!$exists) {
            $requirements['settings file exists'] = array('title' => st('Settings file'), 'value' => st('The settings file does not exist.'), 'severity' => REQUIREMENT_ERROR, 'description' => st('The @drupal installer requires that you create a settings file as part of the installation process. Copy the %default_file file to %file. More details about installing Drupal are available in <a href="@install_txt">INSTALL.txt</a>.', array('@drupal' => drupal_install_profile_name(), '%file' => $file, '%default_file' => $conf_path . '/default.settings.php', '@install_txt' => base_path() . 'INSTALL.txt')));
        } else {
            $requirements['settings file exists'] = array('title' => st('Settings file'), 'value' => st('The %file file exists.', array('%file' => $file)));
            if (!$writable) {
                $requirements['settings file writable'] = array('title' => st('Settings file'), 'value' => st('The settings file is not writable.'), 'severity' => REQUIREMENT_ERROR, 'description' => st('The @drupal installer requires write permissions to %file during the installation process. If you are unsure how to grant file permissions, please consult the <a href="@handbook_url">online handbook</a>.', array('@drupal' => drupal_install_profile_name(), '%file' => $file, '@handbook_url' => 'http://drupal.org/server-permissions')));
            } else {
                $requirements['settings file'] = array('title' => st('Settings file'), 'value' => st('Settings file is writable.'));
            }
        }
    }
    return $requirements;
}
开发者ID:schuyler1d,项目名称:drupal,代码行数:38,代码来源:install.php


注:本文中的drupal_check_profile函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。