Ejemplo n.º 1
0
        internal static string IsFoundStaticIndex(string RequestDir)
        {
            string x = RequestDir + "index.html";

            if (AppHelper.IsFileExist(x))
            {
                return(x);
            }


            x = RequestDir + "index.xhtml";
            if (AppHelper.IsFileExist(x))
            {
                return(x);
            }


            x = RequestDir + "index.htm";
            if (AppHelper.IsFileExist(x))
            {
                return(x);
            }

            return("");
        }
Ejemplo n.º 2
0
        internal bool IsCompilable(string p)
        {
            try
            {
                if (!AppHelper.IsFileExist(this.phpPAth))
                {
                    return(false);
                }

                if (!p.ToLower().EndsWith(".php"))
                {
                    return(false);
                }
            }
            catch { }

            return(true);

            var ext = new FileInfo(p);

            foreach (RykonLang r in this.LanguageList)
            {
                if (r.CanCompile(p))
                {
                    return(true);
                }
            }
            return(false);
        }
Ejemplo n.º 3
0
        internal bool IsFoundDefaultIndex(string RequestFile)
        {
            string x = RequestFile + "\\index.html";

            x = x.Replace("\\\\", "\\");
            return(AppHelper.IsFileExist(x));
        }
Ejemplo n.º 4
0
        internal static void SetMaster(string mp)
        {
            if (!AppHelper.IsFileExist(mp))
            {
                return;
            }
            string content = AppHelper.ReadFileText(mp);

            if (content.Contains(WebServer.masterMiddleReplacor))
            {
                string[] x = content.Split(new string[] { WebServer.masterMiddleReplacor }, StringSplitOptions.RemoveEmptyEntries);
                WebServer.masterPagePre   = x[0];
                WebServer.masterPageAfter = x[1];
            }
        }
Ejemplo n.º 5
0
        internal bool IsFoundDefaultIndex(string RequestDir, out string x)
        {
            // d:\x\r\3
            // d:\x\r\3\
            List <string> ls = this.GetDefaultIndicesPathes(RequestDir);

            x = "";
            foreach (string l in ls)
            {
                if (AppHelper.IsFileExist(l))
                {
                    x = l;
                    return(true);
                }
            }
            x = WebServer.IsFoundStaticIndex(RequestDir);
            return(x != "");
        }
Ejemplo n.º 6
0
        public ServerConfig(string file)
        {
            this.FilePath = file;
            if (!AppHelper.IsFileExist(file))
            {
                return;
            }
            string[] data = new string[] { };
            try
            {
                data = System.IO.File.ReadAllLines(file);
            }
            catch { ValidConfigFile = false; return; }
            if (data.Length < 1)
            {
                ValidConfigFile = false; return;
            }

            Create(data);
        }