-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart-dev.bat
More file actions
121 lines (103 loc) · 2.64 KB
/
Copy pathstart-dev.bat
File metadata and controls
121 lines (103 loc) · 2.64 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
@echo off
setlocal
chcp 65001 >nul
echo [INFO] Starting development environment...
echo.
REM Check PHP
echo [INFO] Checking PHP...
php --version >nul 2>&1
if %errorlevel% neq 0 (
echo [ERROR] PHP not found. Please install PHP and add it to PATH.
pause
exit /b 1
)
REM Check PHP Extensions
echo [INFO] Checking PHP Extensions...
php -m | findstr /i "pdo_mysql" >nul
if %errorlevel% neq 0 (
echo [ERROR] PHP extension 'pdo_mysql' not found. Please enable it in php.ini.
pause
exit /b 1
)
REM Check Node.js
echo [INFO] Checking Node.js...
call node --version >nul 2>&1
if %errorlevel% neq 0 (
echo [ERROR] Node.js not found. Please install Node.js.
pause
exit /b 1
)
REM Check npm
echo [INFO] Checking npm...
call npm --version >nul 2>&1
if %errorlevel% neq 0 (
echo [ERROR] npm not found. Please install npm.
pause
exit /b 1
)
REM Check Composer
echo [INFO] Checking Composer...
call composer --version >nul 2>&1
if %errorlevel% neq 0 (
echo [ERROR] Composer not found. Please install Composer.
pause
exit /b 1
)
echo [INFO] Environment check passed.
echo.
REM Check .env
if not exist ".env" (
echo [WARNING] .env file not found.
if exist ".env.example" (
echo [INFO] Creating .env from .env.example...
copy .env.example .env >nul
echo [INFO] Please configure .env and run 'php scripts/setup_db.php' to initialize database.
) else (
echo [ERROR] .env.example not found.
)
echo.
)
echo [INFO] Checking dependencies...
REM Install PHP dependencies
if not exist "vendor" (
echo [INFO] Installing PHP dependencies...
call composer install
if errorlevel 1 (
echo [ERROR] Composer install failed.
pause
exit /b 1
)
)
REM Install Node.js dependencies
if not exist "node_modules" (
echo [INFO] Installing Node.js dependencies...
call npm install
if errorlevel 1 (
echo [ERROR] npm install failed.
pause
exit /b 1
)
)
REM Create log directory
if not exist "storage\logs" mkdir storage\logs
echo [INFO] Starting services...
echo =======================================
echo PHP Server: http://127.0.0.1:8100
echo Vite Server: http://127.0.0.1:5173
echo =======================================
echo Press Ctrl+C to stop all services
echo.
REM Start Vite server (in background)
echo [INFO] Starting Vite...
start "Vite Server" /MIN cmd /c "npm run dev"
REM Wait for Vite to start
timeout /t 3 /nobreak >nul
REM Start PHP server
echo [INFO] Starting PHP Server...
php -S 127.0.0.1:8100 -t public
if errorlevel 1 (
echo [ERROR] PHP Server exited with error.
pause
)
echo [INFO] Services stopped.
endlocal