Beispiel #1
0
        static void Main(string[] args)
        {
            string watchDirectory = null;

            ShowStartupBanner();

            // Initialize LPHP-Compiler
            LPHPCompiler.Init();

            // Set LPHP-Debug Mode
            LPHPDebugger.PrintDebug = LPHPDebugger.DebugOutputs.ToConsole;

            // Enable the creation of a log file
            LPHPDebugger.CreateLogFile = true;

            // Check if the project-path is provided upon startup
            if (args.Length > 0)
            {
                if (Directory.Exists(args[0].ToString()))
                {
                    watchDirectory = args[0].ToString();
                }
                else
                {
                    LPHPDebugger.PrintError("*** LPHP Startup Error ***");
                    LPHPDebugger.PrintError("The path provided is not a valid directory.");
                }
            }
            else
            {
                LPHPDebugger.PrintWarning("No path provided upon startup. Please provide a path to your LPHP-project at startup, or enter it below:");

                do
                {
                    Console.Write("LPHP Project Path > ");
                    watchDirectory = Console.ReadLine();
                    Console.WriteLine("");

                    if (!Directory.Exists(watchDirectory))
                    {
                        LPHPDebugger.PrintError("The entered path is not valid! Please try again.");
                    }
                }while (!Directory.Exists(watchDirectory));
            }

            Console.Write("Watching directory \"");
            Console.ForegroundColor = ConsoleColor.Green;
            Console.Write(watchDirectory);
            Console.ForegroundColor = ConsoleColor.White;
            Console.WriteLine("\"");

            // Set up the watchdog and set the project-root
            LPHPWatchdog.Init(watchDirectory);

            // Run the LPHP-Watchdog on the given directory
            LPHPWatchdog.Run();
        }
Beispiel #2
0
        private void DebugToTxb(string pMessage, LPHPMessageType pType)
        {
            Color foreColor = Color.White;

            switch (pType)
            {
            case LPHPMessageType.LPHPSuccess:
                foreColor = Color.Lime;
                break;

            case LPHPMessageType.LPHPWarning:
                foreColor = Color.OrangeRed;
                break;

            case LPHPMessageType.LPHPError:
                foreColor = Color.Red;
                break;
            }

            bgwLPHPCompiler.ReportProgress(0, new Tuple <string, Color>(pMessage, foreColor));


            LPHPDebugger.LogDebugData(pMessage.Replace(Environment.NewLine, ""), pType);
        }