Esempio n. 1
0
		private static void CreatePHPIndexPage(IEntryPoint e, string file_name, Action entryfunction)
		{
			{
				var a = new StringBuilder();

				a.AppendLine("<?");

				foreach (var u in SharedHelper.LocalModulesOf(Assembly.GetExecutingAssembly(), ScriptType.PHP))
				{
					a.AppendLine("require_once '" + u + ".php';");
				}

				a.AppendLine(entryfunction.Method.Name + "();");
				a.AppendLine("?>");


				e[file_name] = a.ToString();
			}

			{
				var w = new StringBuilder();

				SharedHelper.LoadReferencedAssemblies(Assembly.GetExecutingAssembly(), true).Where(
					a => a.GetCustomAttributes(typeof(ScriptTypeFilterAttribute), false).Cast<ScriptTypeFilterAttribute>().Any(k => k.Type == ScriptType.JavaScript)
				).Select(k => new FileInfo(k.Location).Name).ForEach(
					src => w.AppendLine("<script type='text/javascript' src='" + src + ".js'></script>")
				);

				
				e[file_name + ".js"] = w.ToString();
			}

		}