Associate .module with drupal php

This commit is contained in:
Joshua Peek
2012-07-20 15:42:21 -05:00
parent bbc5225086
commit e58f268258
2 changed files with 1 additions and 27 deletions

View File

@@ -136,13 +136,6 @@ module Linguist
['.png', '.jpg', '.jpeg', '.gif'].include?(extname) ['.png', '.jpg', '.jpeg', '.gif'].include?(extname)
end end
# Public: Is the blob a possible drupal php file?
#
# Return true or false
def drupal_extname?
['.module', '.install', '.test', '.inc'].include?(extname)
end
# Public: Is the blob likely to have a shebang? # Public: Is the blob likely to have a shebang?
# #
# Return true or false # Return true or false
@@ -430,9 +423,6 @@ module Linguist
# See if there is a Language for the extension # See if there is a Language for the extension
pathname.language || pathname.language ||
# Look for idioms in first line
first_line_language ||
# Try to detect Language from shebang line # Try to detect Language from shebang line
shebang_language shebang_language
end end
@@ -458,23 +448,6 @@ module Linguist
end end
end end
# Internal: Guess language from the first line.
#
# Look for leading "<?php" in Drupal files
#
# Returns a Language.
def first_line_language
# Only check files with drupal php extensions
return unless drupal_extname?
# Fail fast if blob isn't viewable?
return unless viewable?
if lines.first.to_s =~ /^<\?php/
Language['PHP']
end
end
# Internal: Extract the script name from the shebang line # Internal: Extract the script name from the shebang line
# #
# Requires Blob#data # Requires Blob#data

View File

@@ -876,6 +876,7 @@ PHP:
extensions: extensions:
- .aw - .aw
- .ctp - .ctp
- .module
- .php - .php
- .php3 - .php3
- .php4 - .php4