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 Tamir.SharpSsh;
  4. using System.Collections;
  5. using System.IO;
  6.  
  7. namespace Dizzy
  8. {
  9.  
  10. public class SFTPConnection
  11. {
  12.  
  13. public Sftp sftp;
  14. string user;
  15. public delegate void SFTPEvent (string src, string dest, int transferredBytes,
  16. int totalBytes, string message);
  17.  
  18. public event SFTPEvent TransferStarted;
  19. public event SFTPEvent TransferProgress;
  20. public event SFTPEvent TransferStopped;
  21.  
  22. public delegate void Del (string src, string dest,
  23. int transferredBytes, int totalBytes, string message);
  24.  
  25. public SFTPConnection (string user, string password)
  26. {
  27.  
  28. // Inizializziamo il protocollo
  29. this.user = user;
  30. this.sftp = new Sftp (GlobalConfig.GetValue("server"), user);
  31. this.sftp.Password = password;
  32.  
  33. this.sftp.OnTransferStart += new FileTransferEvent(this.TransferStartedHandler);
  34. this.sftp.OnTransferProgress += new FileTransferEvent(this.TransferProgressHandler);
  35. this.sftp.OnTransferEnd += new FileTransferEvent(this.TransferStoppedHandler);
  36.  
  37. }
  38.  
  39. public void Abort () {
  40. this.sftp.Cancel ();
  41. }
  42.  
  43. private void TransferStartedHandler(string src, string dest, int transferredBytes,
  44. int totalBytes, string message)
  45. {
  46. if(TransferStarted != null)
  47. TransferStarted(src, dest, transferredBytes, totalBytes, message);
  48. }
  49.  
  50. private void TransferProgressHandler(string src, string dest, int transferredBytes,
  51. int totalBytes, string message)
  52. {
  53. if (TransferProgress != null)
  54. TransferProgress(src, dest, transferredBytes, totalBytes, message);
  55. }
  56.  
  57. private void TransferStoppedHandler(string src, string dest, int transferredBytes,
  58. int totalBytes, string message)
  59. {
  60. if (TransferStopped != null)
  61. TransferStopped(src, dest, transferredBytes, totalBytes, message);
  62. }
  63.  
  64. public void Connect()
  65. {
  66. sftp.Connect (22);
  67. }
  68.  
  69.  
  70. public void Download(File f, string downloadFolder)
  71. {
  72. this.sftp.Get (f.path, downloadFolder + Path.DirectorySeparatorChar + f.name);
  73. }
  74.  
  75. public void Upload(string filename)
  76. {
  77. /* Normalizziamo il nome della cartella sul server */
  78. string folder = GlobalConfig.GetValue("folder");
  79. if (!folder.EndsWith("/"))
  80. folder = folder + "/";
  81. this.sftp.Put(filename, folder + this.user + "/");
  82. }
  83.  
  84. public void Disconnect ()
  85. {
  86. sftp.Close ();
  87. }
  88. }
  89.  
  90.  
  91. }