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]
using System; namespace Dizzy { public class FileType { int type; const int UNKNOWN = 0; const int VIDEO = 1; const int AUDIO = 2; const int BOOK = 3; public FileType(string filename) { if(filename.EndsWith(".avi") || filename.EndsWith(".mpeg") || filename.EndsWith(".mpg")) type = VIDEO; else if(filename.EndsWith(".pdf") || filename.EndsWith(".dvi") || filename.EndsWith(".djvu") || filename.EndsWith(".ps")) type = BOOK; else if(filename.EndsWith(".mp3") || filename.EndsWith(".ogg")) type = AUDIO; else type = UNKNOWN; } public string Name() { if(type == VIDEO) return "Video"; else if(type == BOOK) return "Libro"; else if(type == AUDIO) return "Audio"; else return "Qualsiasi"; } } public class File { public string user; public string name; public string path; public int size; public FileType type; public File (string path, string user) : this (path, user, 0) {} public File (string path, string user, int size) : this (path, user, "", size) {} public File (string path, string user, string name, int size) { // Determino il tipo di file string [] a; if (user == "") { a = path.Split('/'); if (a.Length >= 2) user = a[2]; } this.user = user; this.path = path; this.size = size; if (name == "") { string[] pieces = path.Split ('/'); name = pieces[pieces.Length - 1]; } this.name = name; } public string SizeToString () { // Piccoli bytes if (size < 1024) return size.ToString() + " B"; else if (size < 1024*1024) { return (size/1024).ToString () + " KB"; } else return System.Convert.ToString( (size/1024/1024).ToString () + " MB"); } } }