diff options
author | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2005-07-01 02:20:35 +0400 |
---|---|---|
committer | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2005-07-01 02:20:35 +0400 |
commit | 9fb62d3e4a1c1572234017908f3cc4d64ee7fe9b (patch) | |
tree | caabb69d1f5ddd27784c3331b21006b27608847a /mcs | |
parent | 8a9308f38581c6a5b4530cd07de61b749c94e3c4 (diff) |
from head
svn path=/branches/mono-1-1-8/mcs/; revision=46799
Diffstat (limited to 'mcs')
6 files changed, 59 insertions, 16 deletions
diff --git a/mcs/class/System.Web/System.Web.Compilation/AspGenerator.cs b/mcs/class/System.Web/System.Web.Compilation/AspGenerator.cs index cd331f2fdaa..63ccbc22873 100644 --- a/mcs/class/System.Web/System.Web.Compilation/AspGenerator.cs +++ b/mcs/class/System.Web/System.Web.Compilation/AspGenerator.cs @@ -187,7 +187,6 @@ namespace System.Web.Compilation public AspGenerator (TemplateParser tparser) { this.tparser = tparser; - tparser.AddDependency (tparser.InputFile); text = new StringBuilder (); stack = new BuilderLocationStack (); rootBuilder = new RootBuilder (tparser); @@ -270,7 +269,7 @@ namespace System.Web.Compilation CacheDependency cd = new CacheDependency ((string[]) tparser.Dependencies.ToArray (typeof (string))); - HttpRuntime.Cache.Insert ("@@Type" + tparser.InputFile, type, cd); + HttpRuntime.Cache.InsertPrivate ("@@Type" + tparser.InputFile, type, cd); return type; } diff --git a/mcs/class/System.Web/System.Web.Compilation/AspParser.cs b/mcs/class/System.Web/System.Web.Compilation/AspParser.cs index 87c88456f37..4a42bd87e6a 100644 --- a/mcs/class/System.Web/System.Web.Compilation/AspParser.cs +++ b/mcs/class/System.Web/System.Web.Compilation/AspParser.cs @@ -32,6 +32,7 @@ using System.Collections; using System.Globalization; using System.IO; using System.Text; +using System.Web.Util; namespace System.Web.Compilation { @@ -188,12 +189,12 @@ namespace System.Web.Compilation if (len < 10 || lastQuote != len - 1) return false; - if (!str.ToLower (CultureInfo.InvariantCulture).StartsWith ("#include ")) + if (!StrUtils.StartsWith (str, "#include ", true)) return false; str = str.Substring (9).Trim (); - bool isfile = (str.ToLower (CultureInfo.InvariantCulture).StartsWith ("file")); - if (!isfile && !str.ToLower (CultureInfo.InvariantCulture).StartsWith ("virtual")) + bool isfile = (StrUtils.StartsWith (str ,"file", true)); + if (!isfile && !StrUtils.StartsWith (str, "virtual", true)) return false; pathType = (isfile) ? "file" : "virtual"; diff --git a/mcs/class/System.Web/System.Web.Compilation/CachingCompiler.cs b/mcs/class/System.Web/System.Web.Compilation/CachingCompiler.cs index 2e469984335..9291e16b727 100644 --- a/mcs/class/System.Web/System.Web.Compilation/CachingCompiler.cs +++ b/mcs/class/System.Web/System.Web.Compilation/CachingCompiler.cs @@ -42,6 +42,7 @@ namespace System.Web.Compilation { class CachingCompiler { + static string dynamicBase = AppDomain.CurrentDomain.SetupInformation.DynamicBase; static object compilationLock = new object (); const string cachePrefix = "@@Assembly"; const string cacheTypePrefix = "@@@Type"; @@ -50,7 +51,7 @@ namespace System.Web.Compilation { string [] cacheKeys = new string [] { cachePrefix + filename }; CacheDependency dep = new CacheDependency (null, cacheKeys); - HttpRuntime.Cache.Insert (cacheTypePrefix + filename, type, dep); + HttpRuntime.Cache.InsertPrivate (cacheTypePrefix + filename, type, dep); } public static Type GetTypeFromCache (string filename) @@ -74,7 +75,7 @@ namespace System.Web.Compilation ICodeCompiler comp = compiler.Compiler; results = comp.CompileAssemblyFromDom (compiler.CompilerParameters, compiler.Unit); string [] deps = (string []) compiler.Parser.Dependencies.ToArray (typeof (string)); - cache.Insert (key, results, new CacheDependency (deps)); + cache.InsertPrivate (key, results, new CacheDependency (deps)); } return results; @@ -98,7 +99,7 @@ namespace System.Web.Compilation options.IncludeDebugInformation = parser.Debug; results = compiler.Compiler.CompileAssemblyFromFile (options, compiler.InputFile); string [] deps = (string []) parser.Dependencies.ToArray (typeof (string)); - cache.Insert (key, results, new CacheDependency (deps)); + cache.InsertPrivate (key, results, new CacheDependency (deps)); } return results; @@ -124,6 +125,9 @@ namespace System.Web.Compilation if (results != null) return results; + if (!Directory.Exists (dynamicBase)) + Directory.CreateDirectory (dynamicBase); + lock (compilationLock) { results = (CompilerResults) cache [cachePrefix + key]; if (results != null) @@ -138,6 +142,9 @@ namespace System.Web.Compilation ICodeCompiler compiler = provider.CreateCompiler (); CompilerParameters options = GetOptions (assemblies); + TempFileCollection tempcoll = new TempFileCollection (config.TempDirectory, true); + string dllfilename = Path.GetFileName (tempcoll.AddExtension ("dll", true)); + options.OutputAssembly = Path.Combine (dynamicBase, dllfilename); results = compiler.CompileAssemblyFromFile (options, file); ArrayList realdeps = new ArrayList (assemblies.Count + 1); realdeps.Add (file); @@ -148,7 +155,7 @@ namespace System.Web.Compilation } string [] deps = (string []) realdeps.ToArray (typeof (string)); - cache.Insert (cachePrefix + key, results, new CacheDependency (deps)); + cache.InsertPrivate (cachePrefix + key, results, new CacheDependency (deps)); } return results; diff --git a/mcs/class/System.Web/System.Web.Compilation/ChangeLog b/mcs/class/System.Web/System.Web.Compilation/ChangeLog index 9ad0f79a6ea..6d85de25e60 100644 --- a/mcs/class/System.Web/System.Web.Compilation/ChangeLog +++ b/mcs/class/System.Web/System.Web.Compilation/ChangeLog @@ -1,3 +1,33 @@ +2005-06-26 Gonzalo Paniagua Javier <gonzalo@ximian.com> + + * TagAttributes.cs: + * AspParser.cs: + * TemplateControlCompiler.cs: use invariant culture versions of starts/ + endswith. + +2005-06-25 Gonzalo Paniagua Javier <gonzalo@ximian.com> + + * TemplateControlCompiler.cs: comparison between member name and the + first part of the id provided by the user should also be + case-insensitive. Fixes bug #75379. + +2005-06-25 Gonzalo Paniagua Javier <gonzalo@ximian.com> + + * CachingCompiler.cs: use cache.InsertPrivate. + * AspGenerator.cs: use cache.InsertPrivate. Removed extra call to + AddDependency. + +2005-06-24 Gonzalo Paniagua Javier <gonzalo@ximian.com> + + * CachingCompiler.cs: create the assemly in the DynamicBase directory, + as all the others, when compiling an assembly from a Src file. Fixes + bug #75371. + +2005-06-15 Gonzalo Paniagua Javier <gonzalo@ximian.com> + + * TemplateControlCompiler.cs: if the property is not found, don't forget + about trying the field. + 2005-06-13 Lluis Sanchez Gual <lluis@novell.com> * Directive.cs: Register the MasterType directive. diff --git a/mcs/class/System.Web/System.Web.Compilation/TagAttributes.cs b/mcs/class/System.Web/System.Web.Compilation/TagAttributes.cs index d668646130f..2ecffcd604d 100644 --- a/mcs/class/System.Web/System.Web.Compilation/TagAttributes.cs +++ b/mcs/class/System.Web/System.Web.Compilation/TagAttributes.cs @@ -31,6 +31,7 @@ using System; using System.Collections; using System.Text; +using System.Web.Util; namespace System.Web.Compilation { @@ -149,7 +150,7 @@ namespace System.Web.Compilation if (att == null || !got_hashed) return false; - return (att.StartsWith ("<%#") && att.EndsWith ("%>")); + return (StrUtils.StartsWith (att, "<%#") && StrUtils.EndsWith (att, "%>")); } public Hashtable GetDictionary (string key) diff --git a/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs b/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs index e9cca1bdbeb..0718c58d585 100644 --- a/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs +++ b/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs @@ -37,6 +37,7 @@ using System.Reflection; using System.Text; using System.Web; using System.Web.UI; +using System.Web.Util; using System.ComponentModel.Design.Serialization; #if NET_2_0 using System.Collections.Specialized; @@ -294,7 +295,7 @@ namespace System.Web.Compilation return false; string str = value.Trim (); - return (str.StartsWith ("<%#") && str.EndsWith ("%>")); + return (StrUtils.StartsWith (str, "<%#") && StrUtils.EndsWith (str, "%>")); } #if NET_2_0 @@ -302,7 +303,7 @@ namespace System.Web.Compilation { string str = value.Trim (); str = str.Substring (3).Trim (); // eats "<%#" - if (str.StartsWith ("Bind")) { + if (StrUtils.StartsWith (str, "Bind")) { Match match = bindRegex.Match (str); if (match.Success) { string bindingName = match.Groups [1].Value; @@ -334,15 +335,19 @@ namespace System.Web.Compilation static MemberInfo GetFieldOrProperty (Type type, string name) { + MemberInfo member = null; try { - return type.GetProperty (name, noCaseFlags); + member = type.GetProperty (name, noCaseFlags); } catch {} + + if (member != null) + return member; try { - return type.GetField (name, noCaseFlags); + member = type.GetField (name, noCaseFlags); } catch {} - return null; + return member; } bool ProcessPropertiesAndFields (ControlBuilder builder, MemberInfo member, string id, @@ -375,7 +380,7 @@ namespace System.Web.Compilation string prop_field = id.Replace ("-", "."); string [] parts = prop_field.Split (new char [] {'.'}); int length = parts.Length; - if (length < 2 || !InvariantCompare (member.Name, parts [0])) + if (length < 2 || !InvariantCompareNoCase (member.Name, parts [0])) return false; if (length > 2) { |