Skip to content

Commit 90fc4b1

Browse files
committed
Finalise README.md and add ini htaccess
Finalised REAME.md install instructions and added .htaccess file under ini directory to help with protecting publically available credentials.ini files
1 parent 808a37a commit 90fc4b1

File tree

3 files changed

+36
-36
lines changed

3 files changed

+36
-36
lines changed

README.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,36 @@ CREATE TABLE `likel_sessions` (
2525
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2626
```
2727

28-
Step 2
28+
Move the files under /src into a directory on your server such as "session"
2929

3030
```
31-
Example
31+
e.g. session/ini, session/models, session/autoload.php, session/example.php
3232
```
3333

34-
Run [src/example.php](src/example.php) and check your database
34+
Move the [ini/credentials.ini](ini/credentials.ini) file to a location not accessible by the public
35+
36+
```
37+
e.g. $ mv ini/credentials /var/www/html/
38+
```
39+
40+
Update the database information in the credentials.ini file
41+
42+
Ensure that when you create a new session you specify the new credentials.ini location
43+
44+
```
45+
$session = new Likel\Session\Handler(array(
46+
'credentials_location' => "/path/to/new/credentials.ini"
47+
));
48+
```
49+
50+
Run [src/example.php](src/example.php) and check your database for the newly created session
3551

3652
## Running the tests
3753

38-
Run [test/SessionHandlerTest.php](test/SessionHandlerTest.php) and [test/SessionDBTest.php](test/SessionDBTest.php) with PHPUnit
54+
Run [test/SessionHandlerTest.php](test/SessionHandlerTest.php) with PHPUnit
3955

4056
```
41-
$ phpunit test
57+
$ phpunit SessionHandlerTest.php
4258
```
4359

4460
## Author

src/ini/.htaccess

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# It is highly suggested to move credentials.ini to a directory not
2+
# accessible by the public, such as /var/www/html on linux
3+
#
4+
# If you need to keep the credentials.ini accessible, ensure that you
5+
# give the file '600' permissions '$ chmod 600 credentials.ini' and
6+
# that you have this .htaccess file to deny access or redirect if accessed
7+
#
8+
# @package php-simple-sessions
9+
# @author Liam Kelly <https://github.com/likel>
10+
# @copyright 2017 Liam Kelly
11+
# @license MIT License <https://github.com/likel/php-simple-sessions/blob/master/LICENSE>
12+
# @link https://github.com/likel/php-simple-sessions
13+
# @version 1.0.0
14+
15+
deny from all

test/SessionDBTest.php

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)