Created
September 1, 2010 10:45
-
-
Save olleolleolle/560530 to your computer and use it in GitHub Desktop.
Deprecations checker: A PHP Bundle script that I put on Ctrl-Shift-V (as a second PHP validation). Will jump to the line of the first reported error.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# Uses Stas Malyshev's migrate.php script to check code style | |
# | |
require ENV['TM_SUPPORT_PATH'] + '/lib/textmate' | |
version = %x{#{ENV['TM_PHP'] || 'php'} -v}.split[0..2].join(' ') | |
result = `#{ENV['TM_PHP'] || 'php'} /Users/olle/opensource/php/migrate/migrate.php '#{ENV['TM_FILEPATH']}'` | |
result.gsub!("in file #{ENV['TM_FILEPATH']}", '') | |
puts "OK!" if result.empty? | |
puts result | |
TextMate.go_to :line => $1 if result =~ /line (\d+)/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just open the Bundle Editor, and duplicate the "Validate Syntax" item, then empty the big text box, and replace it with the above script. Change my migrate.php path, and you're good to go.