PHP.Core.CompilerConfiguration.LoadLibraries C# (CSharp) Method

LoadLibraries() private method

Load class libraries collected while parsing configuration files.
private LoadLibraries ( PHP.Core.ApplicationContext appContext ) : void
appContext PHP.Core.ApplicationContext
return void
        internal void LoadLibraries(ApplicationContext/*!*/ appContext)
        {
            addedLibraries.LoadLibrariesNoLock(
                    (_assemblyName, _assemblyUrl, _sectionName, /*!*/ _node) =>
                    {
                        appContext.AssemblyLoader.Load(_assemblyName, _assemblyUrl, new LibraryConfigStore(_node));
                        return true;
                    },
                    null // ignore class library sections
                    );
        }

Usage Example

Esempio n. 1
0
        /// <summary>
        /// Loads configuration from Machine.config, phpc.exe.config, from files specified by command line arguments,
        /// and from command line arguments themselves.
        /// </summary>
        /// <exception cref="ConfigurationErrorsException">An error occured while loading the configuration.</exception>
        public static CompilerConfiguration/*!*/ LoadConfiguration(
            ApplicationContext/*!*/ appContext, List<FullPath>/*!*/ paths, TextWriter output)
        {
            Configuration.IsBuildTime = true;

            Configuration.Reload(appContext, true);

            // Machine.config, phpc.exe.config:
            CompilerConfiguration result = new CompilerConfiguration(Configuration.Application);

            // explicitly specified or default configs:
            foreach (FullPath path in paths)
            {
                if (output != null) output.WriteLine(path);
                result.LoadFromFile(appContext, path);
            }

            // load libraries lazily
            result.LoadLibraries(appContext);

            //
            return result;
        }