Beispiel #1
0
        private void UpdatePHPSetupItem(PHPConfigInfo configInfo)
        {
            bool isPhpSetup = (configInfo != null && configInfo.RegistrationType == PHPRegistrationType.FastCgi);

            _phpSetupItem.SetTitleState(isPhpSetup);
            _phpSetupItem.ClearWarning();

            if (isPhpSetup)
            {
                // Show warning about non optimal configuration if
                // PHP configuration is not optimal and
                // user is a server administrator.
                if (!configInfo.IsConfigOptimal && Connection.IsUserServerAdministrator)
                {
                    _phpSetupItem.SetWarning(PreparePHPConfigWarning());
                }
                else if (configInfo.IsObsoleteRelease)
                {
                    _phpSetupItem.SetWarning(PrepareObsoleteReleaseWarning());
                }
                else if (configInfo.IsCppRuntimeMissing)
                {
                    _phpSetupItem.SetWarning(PrepareCppRuntimeMissingWarning());
                }
                else if (configInfo.IsExpiringRelease)
                {
                    _phpSetupItem.SetWarning(PrepareExpiringReleaseWarning());
                }
            }
            else if (configInfo != null)
            {
                // Show warning about PHP not being setup or setup incorrectly
                _phpSetupItem.SetWarning(PreparePHPRegistrationWarning(configInfo.RegistrationType));
            }
            else
            {
                // Show warning about failed IIS configuration
                var errorLabel = new Label {
                    Text = Resources.ErrorFailedToGetConfiguration
                };
                _phpSetupItem.SetWarning(errorLabel);
            }
            _versionValueLabel.Text        = isPhpSetup ? configInfo.Version : Resources.PHPPagePHPNotAvailable;
            _executableValueLabel.Text     = isPhpSetup ? configInfo.Executable : Resources.PHPPagePHPNotAvailable;
            _handlerMappingValueLabel.Text = isPhpSetup ? GetHandlerMappingLabelText(configInfo.HandlerIsLocal) : Resources.PHPPagePHPNotAvailable;

            // Allow PHP registration only for server administrators
            if (configInfo != null && configInfo.RegistrationType != PHPRegistrationType.NoneNoFastCgi)
            {
                _phpSetupItem.SetTaskState(IndexRegisterPhpTask, Connection.IsUserServerAdministrator);
            }
            else
            {
                // If there is an error in IIS configuration then do not allow new registrations
                _phpSetupItem.SetTaskState(IndexRegisterPhpTask, false);
            }

            _phpSetupItem.SetTaskState(IndexChangeVersionTask, isPhpSetup);
            _phpSetupItem.SetTaskState(IndexCheckPhpInfoTask, isPhpSetup);
        }
Beispiel #2
0
        private void UpdatePHPSettingsItem(PHPConfigInfo configInfo)
        {
            var isPhpSetup = (configInfo != null && configInfo.RegistrationType == PHPRegistrationType.FastCgi);

            _phpSettingsItem.SetTitleState(isPhpSetup);
            if (isPhpSetup)
            {
                PrepareOpenFileLink(_configPathValueLabel, configInfo.PHPIniFilePath, Connection.IsLocalConnection);
                PrepareOpenFileLink(_errorLogValueLabel, configInfo.ErrorLog, Connection.IsLocalConnection);
            }
            else
            {
                PrepareOpenFileLink(_configPathValueLabel, Resources.PHPPagePHPNotAvailable, false);
                PrepareOpenFileLink(_errorLogValueLabel, Resources.PHPPagePHPNotAvailable, false);
            }
            _phpSettingsItem.SetTaskState(IndexErrorReportingTask, isPhpSetup);
            _phpSettingsItem.SetTaskState(IndexLimitsTask, isPhpSetup);
            _phpSettingsItem.SetTaskState(IndexAllSettingsTask, isPhpSetup);
        }
Beispiel #3
0
        private void UpdatePHPExtensionsItem(PHPConfigInfo configInfo)
        {
            var isPhpSetup = (configInfo != null && configInfo.RegistrationType == PHPRegistrationType.FastCgi);

            _phpExtensionItem.SetTitleState(isPhpSetup);
            if (isPhpSetup)
            {
                _enabledExtLabel.Text   = String.Format(CultureInfo.CurrentCulture, Resources.PHPPageEnabledExtensions, configInfo.EnabledExtCount);
                _installedExtLabel.Text = String.Format(CultureInfo.CurrentCulture, Resources.PHPPageInstalledExtensions, configInfo.InstalledExtCount);
            }
            else
            {
                _enabledExtLabel.Text   = Resources.PHPPageExtensionsNotAvailable;
                _installedExtLabel.Text = Resources.PHPPageExtensionsNotAvailable;
            }
            _phpExtensionItem.SetTaskState(IndexAllExtensionsTask, isPhpSetup);

            if (Connection.IsUserServerAdministrator)
            {
                _phpExtensionItem.SetTaskState(IndexAddExtensionTask, isPhpSetup);
            }
        }