Skip to content

Commit 4965e03

Browse files
Update README.md to include manual installation instructions and PSR-4 autoloading setup
1 parent 7beeec3 commit 4965e03

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,56 @@ composer require chriskacerguis/codeigniter-restserver
1919

2020
Auto-discovery is enabled, so the module’s config, filters, and migrations will be found automatically.
2121

22+
### Manual installation (no Composer)
23+
24+
If you cannot use Composer, you can install this module manually.
25+
26+
1) Download the source
27+
28+
- Download a release ZIP from GitHub or clone the repo, then copy the `src/` folder into your app. A common layout is:
29+
30+
```
31+
app/ThirdParty/RestServer/src
32+
```
33+
34+
2) Register PSR-4 autoloading
35+
36+
Edit `app/Config/Autoload.php` and add the namespace mapping so CodeIgniter can locate the classes:
37+
38+
```php
39+
public $psr4 = [
40+
'App\\' => APPPATH,
41+
// Add this line (adjust the path if you chose a different location)
42+
'chriskacerguis\\RestServer\\' => APPPATH . 'ThirdParty/RestServer/src',
43+
];
44+
```
45+
46+
Alternative: If you prefer `app/Modules/RestServer`, copy `src/` there and map it accordingly:
47+
48+
```php
49+
'chriskacerguis\\RestServer\\' => APPPATH . 'Modules/RestServer/src',
50+
```
51+
52+
3) Run the module migrations
53+
54+
Once the namespace is registered, you can run the included migrations by namespace:
55+
56+
```bash
57+
php spark migrate -n 'chriskacerguis\RestServer'
58+
```
59+
60+
4) Wire filters and routes
61+
62+
Follow the "Filters wiring" section below to add the filter aliases and route groups in your app configs.
63+
64+
5) Verify
65+
66+
Create a simple controller that extends `chriskacerguis\RestServer\RestController` and hit it in the browser or via curl. See the "Quick demo" section for a copy-paste example.
67+
68+
Notes:
69+
- Language files in this repository are optional; the core module doesn’t require them for basic operation.
70+
- When updating the module, repeat step 1 and keep your PSR-4 mapping intact.
71+
2272
## Database migrations
2373

2474
This package includes migrations for tables `keys`, `logs`, `access`, `limits`.

0 commit comments

Comments
 (0)