/// <summary> /// Determines whether to treat given PHAR entry as a PHP source file (whether to compile it). /// </summary> public static bool IsCompileEntry(this Devsense.PHP.Phar.Entry entry) { // TODO: what entries will be compiled? if (entry.IsDirectory) { return(false); } if (entry.Name.EndsWith(".php")) { return(true); } if (string.IsNullOrEmpty(entry.Code)) { return(false); } var ext = System.IO.Path.GetExtension(entry.Name); if (string.IsNullOrEmpty(ext) && entry.Code.StartsWith("<?php")) { return(true); } if (ext == ".php5" || ext == ".inc" || ext == ".module") { return(entry.Code.IndexOf("<?php") >= 0); } return(false); }
/// <summary> /// Gets value indicating this entry will be skipped. /// </summary> public static bool IsIgnoredEntry(this Devsense.PHP.Phar.Entry entry) { if (entry.Name.EndsWith(".phpstorm.meta.php")) { return(true); } return(false); }