mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Associate .module with drupal php
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -876,6 +876,7 @@ PHP:
|
|||||||
extensions:
|
extensions:
|
||||||
- .aw
|
- .aw
|
||||||
- .ctp
|
- .ctp
|
||||||
|
- .module
|
||||||
- .php
|
- .php
|
||||||
- .php3
|
- .php3
|
||||||
- .php4
|
- .php4
|
||||||
|
|||||||
Reference in New Issue
Block a user