-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcomposer.json
36 lines (36 loc) · 1.79 KB
/
composer.json
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
{
"name": "dasunnethsara/zenithphp",
"description": "ZenithPHP is a lightweight PHP framework for MVC architecture, streamlining modern PHP web development.",
"type": "project",
"license": "MIT",
"authors": [
{
"name": "Dasun Nethsara",
"email": "techsaralk.pro@gmail.com"
}
],
"require": {
"php": "^8.0",
"dasunnethsara/zenithphp-core": "^1.0",
"firebase/php-jwt": "^6.10",
"vlucas/phpdotenv": "^5.6"
},
"autoload": {
"psr-4": {
"ZenithPHP\\App\\": "App/",
"ZenithPHP\\App\\Controllers\\": "App/Controllers/",
"ZenithPHP\\App\\Models\\": "App/Models/",
"ZenithPHP\\Config\\": "Config/",
"ZenithPHP\\Migrations\\": "Migrations/",
"ZenithPHP\\Core\\": "vendor/dasunnethsara/zenithphp-core/src/"
}
},
"scripts": {
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php -r \"$envFile = '.env'; if (file_exists($envFile)) { $content = file_get_contents($envFile); $projectName = basename(getcwd()); $content = preg_replace('/^APP_NAME=.*/m', 'APP_NAME=' . $projectName, $content); $dbName = $projectName . '_db'; $content = preg_replace('/^DB_NAME=.*/m', 'DB_NAME=' . $dbName, $content); $dbHost = 'localhost'; $content = preg_replace('/^DB_HOST=.*/m', 'DB_HOST=' . $dbHost, $content); $dbUser = 'root'; $content = preg_replace('/^DB_USER=.*/m', 'DB_USER=' . $dbUser, $content); $dbPass = ''; $content = preg_replace('/^DB_PASS=.*/m', 'DB_PASS=' . $dbPass, $content); file_put_contents($envFile, $content); echo 'Updated .env file with APP_NAME, DB_NAME, DB_HOST, DB_USER, and DB_PASS.'; }\""
]
}
}