phinx.bat 896 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. @echo off
  2. rem This script will do the following:
  3. rem - check for PHP_COMMAND env, if found, use it.
  4. rem - if not found detect php, if found use it, otherwise err and terminate
  5. if "%OS%"=="Windows_NT" @setlocal
  6. rem %~dp0 is expanded pathname of the current script under NT
  7. set DEFAULT_PHINX_HOME=%~dp0..
  8. goto init
  9. goto cleanup
  10. :init
  11. if "%PHINX_HOME%" == "" set PHINX_HOME=%DEFAULT_PHINX_HOME%
  12. set DEFAULT_PHINX_HOME=
  13. if "%PHP_COMMAND%" == "" goto no_phpcommand
  14. goto run
  15. goto cleanup
  16. :run
  17. "%PHP_COMMAND%" -d html_errors=off -qC "%PHINX_HOME%\bin\phinx" %*
  18. goto cleanup
  19. :no_phpcommand
  20. rem PHP_COMMAND environment variable not found, assuming php.exe is on path.
  21. set PHP_COMMAND=php.exe
  22. goto init
  23. :err_home
  24. echo ERROR: Environment var PHINX_HOME not set. Please point this
  25. echo variable to your local phinx installation!
  26. goto cleanup
  27. :cleanup
  28. if "%OS%"=="Windows_NT" @endlocal
  29. rem pause