Skip to content

Commit f64c988

Browse files
committed
✨ add a json database feature
Signed-off-by: otengkwame <[email protected]>
1 parent 8e649d6 commit f64c988

File tree

5 files changed

+47
-0
lines changed

5 files changed

+47
-0
lines changed

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ app.use.outside = true
8787
# DATABASE
8888
#--------------------------------------------------------------------
8989

90+
# database.json.path = writable/jsondb/storage
91+
9092
# database.default.dsn = mysqli://username:[email protected]:3306/database_name
9193

9294
# database.default.hostname = localhost:3306

database/jsondb.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
/*
4+
| -------------------------------------------------------------------------
5+
| Configure Json Database Root Path
6+
| -------------------------------------------------------------------------
7+
| This path is where you will store
8+
| All your JSON Database files
9+
|
10+
*/
11+
12+
$config['json_db_path'] = (getenv('database.json.path'))
13+
? ROOTPATH . getenv('database.json.path')
14+
: WRITABLEPATH . 'jsondb' . DS . 'storage';

writable/jsondb/.htaccess

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<IfModule authz_core_module>
2+
Require all denied
3+
</IfModule>
4+
<IfModule !authz_core_module>
5+
Deny from all
6+
</IfModule>

writable/jsondb/index.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html>
3+
4+
<head>
5+
<title>403 Forbidden</title>
6+
</head>
7+
8+
<body>
9+
10+
<p>Directory access is forbidden.</p>
11+
12+
</body>
13+
14+
</html>

writable/jsondb/storage/index.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>403 Forbidden</title>
5+
</head>
6+
<body>
7+
8+
<p>Directory access is forbidden.</p>
9+
10+
</body>
11+
</html>

0 commit comments

Comments
 (0)