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