PHP   21

php-parse

Guest on 24th August 2022 12:42:40 PM

  1. #!/usr/bin/env sh
  2.  
  3. dir=$(d=${0%[/\\]*}; cd "$d"; cd "../nikic/php-parser/bin" && pwd)
  4.  
  5. # See if we are running in Cygwin by checking for cygpath program
  6. if command -v 'cygpath' >/dev/null 2>&1; then
  7.         # Cygwin paths start with /cygdrive/ which will break windows PHP,
  8.         # so we need to translate the dir path to windows format. However
  9.         # we could be using cygwin PHP which does not require this, so we
  10.         # test if the path to PHP starts with /cygdrive/ rather than /usr/bin
  11.         if [[ $(which php) == /cygdrive/* ]]; then
  12.                 dir=$(cygpath -m "$dir");
  13.         fi
  14. fi
  15.  
  16. dir=$(echo $dir | sed 's/ /\ /g')
  17. "${dir}/php-parse" "$@"

Raw Paste


Login or Register to edit or fork this paste. It's free.