Skip to content

Commit 3f69b74

Browse files
committed
feupdated CLI command references in documentation to use direct php warvil syntax
1 parent 79fd669 commit 3f69b74

4 files changed

Lines changed: 37 additions & 25 deletions

File tree

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ STORAGE_MAX_SIZE=1000000
167167

168168
Generate a secure application key:
169169
```sh
170-
php bin/warvil key:generate
170+
php warvil key:generate
171171
```
172172

173173
## 🖥️ Command Line Interface
@@ -176,40 +176,40 @@ WarvilPHP comes with a command-line tool called warvil for scaffolding component
176176
Available Commands
177177
```sh
178178
# Create a controller
179-
php bin/warvil make:controller UserController
179+
php warvil make:controller UserController
180180

181181
# Create a model
182-
php bin/warvil make:model User
182+
php warvil make:model User
183183

184184
# Create a view
185-
php bin/warvil make:view users/index
185+
php warvil make:view users/index
186186

187187
# Create a middleware
188-
php bin/warvil make:middleware Auth
188+
php warvil make:middleware Auth
189189

190190
# Create a component
191-
php bin/warvil make:component buttons/primary
191+
php warvil make:component buttons/primary
192192

193193
# Create a service
194-
php bin/warvil make:service UserService
194+
php warvil make:service UserService
195195

196196
# Create an API controller
197-
php bin/warvil make:api ProductController
197+
php warvil make:api ProductController
198198

199199
# Create a layout
200-
php bin/warvil make:layout admin
200+
php warvil make:layout admin
201201

202202
# Create a database table schema
203-
php bin/warvil make:table Users
203+
php warvil make:table Users
204204

205205
# Run a migration
206-
php bin/warvil migration:run User:up
206+
php warvil migration:run User:up
207207

208208
# Generate an application key
209-
php bin/warvil key:generate
209+
php warvil key:generate
210210

211211
# Show help
212-
php bin/warvil help
212+
php warvil help
213213
```
214214

215215
## 🌐 Routing System
@@ -474,7 +474,7 @@ class User extends Model
474474

475475
Using components in views:
476476
```sh
477-
php bin/warvil migration:run User:up
477+
php warvil migration:run User:up
478478
```
479479

480480
## 🔌 API Development

bin/install

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ foreach ($directories as $dir) {
5151
}
5252

5353
// Make warvil executable
54-
if (file_exists('bin/warvil')) {
55-
chmod('bin/warvil', 0755);
54+
if (file_exists('warvil')) {
55+
chmod('warvil', 0755);
5656
echo "{$green}{$reset}Made warvil command executable\n";
5757
}
5858

@@ -91,8 +91,8 @@ foreach ($defaultFiles as $path => $content) {
9191

9292
// Set up a symbolic link for the warvil command (Unix-like systems)
9393
if (PHP_OS_FAMILY !== 'Windows') {
94-
$binPath = '/usr/local/bin/warvil';
95-
$warvilScriptPath = getcwd() . '/bin/warvil';
94+
$binPath = '/usr/local/warvil';
95+
$warvilScriptPath = getcwd() . '/warvil';
9696

9797
// Check if we have permission to create the symlink
9898
if (is_writable(dirname($binPath))) {
@@ -114,14 +114,14 @@ if (file_exists('.env')) {
114114
if (strpos($envContent, 'APP_KEY=base64:') === false || strpos($envContent, 'APP_KEY=base64:your-random-key-here') !== false) {
115115
echo "{$yellow}Generating application key...{$reset}\n";
116116
// Execute the key generation command
117-
if (file_exists('bin/warvil')) {
118-
exec('php bin/warvil key:generate', $output);
117+
if (file_exists('warvil')) {
118+
exec('php warvil key:generate', $output);
119119
foreach ($output as $line) {
120120
echo $line . "\n";
121121
}
122122
} else {
123123
echo "{$yellow}! {$reset}Could not generate application key. Please run manually:\n";
124-
echo " php bin/warvil key:generate\n";
124+
echo " php warvil key:generate\n";
125125
}
126126
}
127127
}
@@ -132,5 +132,5 @@ echo "{$green}✓ {$reset}WarvilPHP installed successfully!\n\n";
132132
echo "{$yellow}Next steps:{$reset}\n";
133133
echo " 1. Configure your database in .env\n";
134134
echo " 2. Start the development server with: {$yellow}composer serve{$reset}\n";
135-
echo " 3. Create components with: {$yellow}php bin/warvil make:controller YourController{$reset}\n";
135+
echo " 3. Create components with: {$yellow}php warvil make:controller YourController{$reset}\n";
136136
echo "\nEnjoy building with WarvilPHP!\n";

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,16 @@
3838
"php bin/install"
3939
],
4040
"post-install-cmd": [
41-
"php -r \"chmod('bin/warvil', 0755);\""
41+
"php -r \"chmod('warvil', 0755);\""
4242
],
4343
"serve": "php -S localhost:8000",
44-
"warvil": "php bin/warvil",
44+
"warvil": "php warvil",
4545
"setup": "php bin/install"
4646
},
4747
"minimum-stability": "dev",
4848
"prefer-stable": true,
4949
"bin": [
50-
"bin/warvil"
50+
"warvil"
5151
],
5252
"config": {
5353
"sort-packages": true,

warvil

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env php
2+
<?php
3+
4+
/**
5+
* WarvilPHP Command Line Interface
6+
*
7+
* This is the main entry point for the WarvilPHP CLI.
8+
* It allows direct execution from the project root.
9+
*/
10+
11+
// Simply forward to the actual CLI implementation
12+
require __DIR__ . '/bin/warvil';

0 commit comments

Comments
 (0)