Exemplo n.º 1
0
        protected override void DoProcessing()
        {
            using (var serverManager = new ServerManager())
            {
                var serverManagerWrapper = new ServerManagerWrapper(serverManager, SiteName, VirtualPath);
                var configHelper = new PHPConfigHelper(serverManagerWrapper);
                var phpVersions = configHelper.GetAllPHPVersions();

                var nameWildcard = PrepareWildcardPattern(HandlerName);
                var versionWildcard = PrepareWildcardPattern(Version);

                var isActive = true;
                foreach (var phpVersion in phpVersions)
                {
                    if (!nameWildcard.IsMatch(phpVersion.HandlerName))
                    {
                        isActive = false;
                        continue;
                    }
                    if (!versionWildcard.IsMatch(phpVersion.Version))
                    {
                        isActive = false;
                        continue;
                    }

                    var versionItem = new PHPVersionItem(phpVersion, isActive);
                    WriteObject(versionItem);
                    isActive = false;
                }
            }
        }
Exemplo n.º 2
0
        protected override void DoProcessing()
        {
            using (ServerManager serverManager = new ServerManager())
            {
                ServerManagerWrapper serverManagerWrapper = new ServerManagerWrapper(serverManager, this.SiteName, this.VirtualPath);
                PHPConfigHelper configHelper = new PHPConfigHelper(serverManagerWrapper);
                RemoteObjectCollection<PHPVersion> phpVersions = configHelper.GetAllPHPVersions();

                WildcardPattern nameWildcard = PrepareWildcardPattern(HandlerName);
                WildcardPattern versionWildcard = PrepareWildcardPattern(Version);

                bool isActive = true;
                foreach (PHPVersion phpVersion in phpVersions)
                {
                    if (!nameWildcard.IsMatch(phpVersion.HandlerName))
                    {
                        isActive = false;
                        continue;
                    }
                    if (!versionWildcard.IsMatch(phpVersion.Version))
                    {
                        isActive = false;
                        continue;
                    }

                    PHPVersionItem versionItem = new PHPVersionItem(phpVersion, isActive);
                    WriteObject(versionItem);
                    isActive = false;
                }
            }
        }
Exemplo n.º 3
0
        public ArrayList GetAllPHPVersions()
        {
            EnsureServerOrSiteConnection();
            ArrayList versions = null;

            try
            {
                PHPConfigHelper configHelper = new PHPConfigHelper(ManagementUnit);
                versions = configHelper.GetAllPHPVersions();
            }
            catch (FileNotFoundException)
            {
                RaiseException("ErrorPHPIniNotFound");
            }

            return versions;
        }
Exemplo n.º 4
0
        public object GetAllPHPVersions()
        {
            EnsureServerOrSiteConnection();
            RemoteObjectCollection<PHPVersion> versions = null;

            try
            {
                ManagementUnitWrapper mgmtUnitWrapper = new ManagementUnitWrapper(ManagementUnit);
                PHPConfigHelper configHelper = new PHPConfigHelper(mgmtUnitWrapper);
                versions = configHelper.GetAllPHPVersions();
            }
            catch (FileNotFoundException)
            {
                RaiseException("ErrorPHPIniNotFound");
            }
            catch (InvalidOperationException)
            {
                RaiseException("ErrorPHPIsNotRegistered");
            }

            return (versions != null) ? versions.GetData() : null;
        }
Exemplo n.º 5
0
        public ArrayList GetAllPHPVersions()
        {
            EnsureServerOrSiteConnection();

            PHPConfigHelper phpConfig = new PHPConfigHelper(ManagementUnit);
            ArrayList versions = phpConfig.GetAllPHPVersions();
            return versions;
        }