Skip to content

Commit

Permalink
Closes #107. Add PHP options for filters and directory_filters
Browse files Browse the repository at this point in the history
  • Loading branch information
Glavin001 committed Nov 20, 2014
1 parent 991a34c commit c6c6d95
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/langs/php-beautify.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ Requires http://pear.php.net/package/PHP_Beautifier
###
getCmd = (inputPath, outputPath, options) ->
phpBeautifierPath = options.beautifier_path # jshint ignore: line
if phpBeautifierPath
filters = options.filters
directoryFilters = options.directory_filters # jshint ignore: line

if phpBeautifierPath
# Use absolute path
"php \"" + phpBeautifierPath + "\" \"" + inputPath + "\" \"" + outputPath + "\""
"php \"#{phpBeautifierPath}\" --input \"#{inputPath}\" --output \"#{outputPath}\" --filters \"#{filters}\" --directory_filters \"#{directoryFilters}\""
else

# Use command available in $PATH
"php_beautifier \"" + inputPath + "\" \"" + outputPath + "\""
"php_beautifier --input \"#{inputPath}\" --output \"#{outputPath}\" --filters \"#{filters}\" --directory_filters \"#{directoryFilters}\""

"use strict"
cliBeautify = require("./cli-beautify")
module.exports = cliBeautify(getCmd)
2 changes: 2 additions & 0 deletions lib/language-options.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ module.exports =

# PHP
php_beautifier_path: ""
php_filters: ""
php_directory_filters: ""

# Python
python_autopep8_path: ""
Expand Down

0 comments on commit c6c6d95

Please sign in to comment.