protected override void DoProcessing()
 {
     using (ServerManager serverManager = new ServerManager())
     {
         ServerManagerWrapper serverManagerWrapper = new ServerManagerWrapper(serverManager, this.SiteName, this.VirtualPath);
         PHPConfigHelper configHelper = new PHPConfigHelper(serverManagerWrapper);
         PHPConfigInfo configInfo = configHelper.GetPHPConfigInfo();
         if (configInfo.RegistrationType == PHPRegistrationType.FastCgi)
         {
             PHPConfigurationItem configurationItem = new PHPConfigurationItem(configInfo);
             WriteObject(configurationItem);
         }
         else
         {
             throw new InvalidOperationException(Resources.PHPIsNotRegisteredError);
         }
     }
 }
示例#2
0
        public object GetPHPConfigInfo()
        {
            EnsureServerOrSiteConnection();

            PHPConfigInfo result = null;
            try
            {
                PHPConfigHelper configHelper = new PHPConfigHelper(ManagementUnit);
                result = configHelper.GetPHPConfigInfo();
            }
            catch (FileNotFoundException)
            {
                RaiseException("ErrorPHPIniNotFound");
            }

            return (result != null) ? result.GetData() : null;
        }
示例#3
0
        public bool CheckForLocalPHPHandler(string siteName, string virtualPath)
        {
            EnsureServerOrSiteConnection();

            if (String.IsNullOrEmpty(siteName))
            {
                throw new InvalidOperationException();
            }

            Site site = ManagementUnit.ReadOnlyServerManager.Sites[siteName];
            if (site == null)
            {
                throw new InvalidOperationException();
            }

            ServerManagerWrapper serverManagerWrapper = new ServerManagerWrapper(ManagementUnit.ReadOnlyServerManager, siteName, virtualPath);
            PHPConfigHelper configHelper = new PHPConfigHelper(serverManagerWrapper);

            PHPConfigInfo configInfo = configHelper.GetPHPConfigInfo();
            if (configInfo.RegistrationType != PHPRegistrationType.FastCgi)
            {
                throw new InvalidOperationException("PHP is not registered via FastCGI, hence there is no FastCGI handler defined");
            }

            return configInfo.HandlerIsLocal;
        }
示例#4
0
        public object GetPHPConfigInfo()
        {
            EnsureServerOrSiteConnection();

            PHPConfigInfo result = null;
            try
            {
                ManagementUnitWrapper mgmtUnitWrapper = new ManagementUnitWrapper(ManagementUnit);
                PHPConfigHelper configHelper = new PHPConfigHelper(mgmtUnitWrapper);
                result = configHelper.GetPHPConfigInfo();
            }
            catch (FileNotFoundException)
            {
                RaiseException("ErrorPHPIniNotFound");
            }
            catch (InvalidOperationException)
            {
                RaiseException("ErrorPHPIsNotRegistered");
            }

            return (result != null) ? result.GetData() : null;
        }
示例#5
0
        public object GetPHPConfigInfo()
        {
            EnsureServerOrSiteConnection();

            PHPConfigHelper phpConfig = new PHPConfigHelper(ManagementUnit);
            PHPConfigInfo result = phpConfig.GetPHPConfigInfo();

            return (result != null) ? result.GetData() : null;
        }