/// <summary> /// Standard OSA Plugin architecture see Wiki Docs /// </summary> /// <param name="method">Standard Architecture parameter see Wiki Docs</param> public override void RunInterface(string pluginName) { try { PerformUpgradeIfRequired(); pName = pluginName; afm = new AdvancedFileModule("/", Common.ApiPath + @"\wwwroot"); afm.ServeUnknownTypes(true, "php"); afm.AddCgiApplication("php", @"C:\php\php-cgi.exe"); //Need both as Image path is not consistant in DB. afm.AddVirtualDirectory("Images", Common.ApiPath + @"\Images"); afm.AddVirtualDirectory("/Images", Common.ApiPath + @"\Images"); server.Add(afm); logging.AddToLog("starting server...", true); server.Start(IPAddress.Any, Int32.Parse(osae.GetObjectPropertyValue(pName, "Port").Value)); } catch (Exception ex) { logging.AddToLog("Error starting server: " + ex.Message, true); } }
public static void CreateHTTPServer(string filePath, string httpServerPath, string PHPCGIPath, uint port, bool allowDirectoryListing) { HttpServer server = new HttpServer(); AdvancedFileModule afm = new AdvancedFileModule(httpServerPath, filePath, false, allowDirectoryListing); afm.ServeUnknownTypes(true, "php"); afm.AddCgiApplication("php", PHPCGIPath); server.Add(afm); server.Start(IPAddress.Any, (int)port); }
public static void CreateHTTPServer(string filePath, string httpServerPath, string PHPCGIPath, uint port, bool allowDirectoryListing) { HttpServer server = new HttpServer(); AdvancedFileModule afm = new AdvancedFileModule(httpServerPath, filePath, false, allowDirectoryListing); afm.ServeUnknownTypes(true, "php"); afm.AddCgiApplication("php", PHPCGIPath); server.Add(afm); server.Start(IPAddress.Any, (int)port); }