viewgit/index.php:465 Only variables should be passed by reference [2048]

viewgit/index.php:466 Non-static method GeSHi::get_language_name_from_extension() should not be called statically [2048]

  1.  
  2. using System;
  3. using System.Data.SQLite;
  4.  
  5. namespace Dizzy
  6. {
  7.  
  8.  
  9. public class GlobalConfig
  10. {
  11. public string user, password;
  12. private SQLiteConnection conn;
  13.  
  14. public GlobalConfig ()
  15. {
  16. conn = new SQLiteConnection ("Data Source=" + DataBaseName () + ";Version=3;");
  17. // Controlliamo che il database sia correttamente
  18. // inizializzato.
  19. Init ();
  20. }
  21.  
  22. protected void Init ()
  23. {
  24. SQLiteCommand sqlCmd;
  25. this.conn.Open ();
  26. sqlCmd = this.conn.CreateCommand ();
  27.  
  28. sqlCmd.CommandText = "SELECT * from sqlite_master WHERE type='table';";
  29. SQLiteDataReader reader = sqlCmd.ExecuteReader ();
  30.  
  31. if(!reader.HasRows)
  32. InitialSetup ();
  33. }
  34.  
  35. protected void InitialSetup ()
  36. {
  37.  
  38. }
  39.  
  40. protected string DataBaseName ()
  41. {
  42. string dir = "";
  43. if (System.Environment.OSVersion.ToString ().Contains("Windows"))
  44. {
  45.  
  46. System.Reflection.Assembly a = System.Reflection.Assembly.GetEntryAssembly ();
  47. dir = System.IO.Path.GetDirectoryName (a.Location);
  48.  
  49. }
  50. else // Assumiamo qualcosa di Unix-like
  51. {
  52. dir = System.Environment.GetEnvironmentVariable("HOME");
  53. dir += System.IO.Path.DirectorySeparatorChar + ".dizzy";
  54. }
  55. if (!System.IO.Directory.Exists(dir))
  56. System.IO.Directory.CreateDirectory (dir);
  57.  
  58. string db = dir + System.IO.Path.DirectorySeparatorChar + "list.sqlite";
  59. if (!System.IO.File.Exists (db))
  60. System.IO.File.Create (db);
  61. return db;
  62. }
  63. }
  64.  
  65. }