summaryrefslogtreecommitdiffstats
path: root/notFinishedCode/pChart2.1.2/examples/buildAll.cmd
blob: 8518c72a0d26b0e4848ca5455b56a6aebe950285 (plain) (blame)
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
42
43
44
45
46
47
48
49
50
51
52
ECHO OFF
setlocal ENABLEDELAYEDEXPANSION

CLS
ECHO.
ECHO     ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
ECHO     º                                                                     º
ECHO     º  Processing all examples (this may takes 1-2 minutes)               º
ECHO     º                                                                     º
ECHO     ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
ECHO.

php -v 1>NUL 2>NUL
IF %ERRORLEVEL% == 0 GOTO getVersion
GOTO noPHP

:getVersion
FOR /F "tokens=1,2 delims= " %%G IN ('php -v') DO (
 IF %%G==PHP SET PHPVersion=%%H
 )

:render
ECHO     The PHP binaries (%PHPVersion%) have been located in your system PATH
ECHO.
ECHO Processing examples : >resources\errors.log

REM SET /P Var="   Progress : "<NUL

FOR %%f IN (*.*) DO (
   set t=%%f
   if !t:~-3! == php (
     SET /P Var=þ<NUL
     ECHO %%f >>resources\errors.log
     php -q "%~dp0%%f" 1>NUL 2>>resources\errors.log
    )
)

ECHO.
ECHO.
ECHO     All the example have been rendered in the following folder :
ECHO.
ECHO       %~dp0pictures\
GOTO end

:noPHP

ECHO     The PHP binaries can't be found. We strongly advise you to put it in
ECHO     the system path variable.
ECHO.
ECHO     Examples rendering has been aborded.
:end
PAUSE >NUL