<commit_before># PHP BiblioDB
[![Build Status](https://status.continuousphp.com/git-hub/eutampieri/PHPBiblioDB?token=<PASSWORD>)](https://continuousphp.com/git-hub/eutampieri/PHPBiblioDB)

## Requirements
<!--* Yandex API key, available at https://translate.yandex.com/developers/keys. It has to be put in `res/yandexAPIKey.txt`.-->

## DataBase structure:

The database consists in an SQLITE file containing four tables.

### Libri

This table contains books. It has these columns:
* ID (text)
* ISBN (text)
* Titolo (text)
* Autore (text)
* Posizione (text)
* Disponibilita (0:in prestito, 1:disponibile)
* DataPrestito (YYYY-MM-DD)

### Utenti

This table contains users. It has theese columns:
* Utente (text)
* Password (bcrypt encoded)
* Master (bool)

### Sessioni

This table contains sessions. It can be used for logging purposes. It has theese columns:
* Token (text)
* IP (text)
* Scadenza (YYYY-MM-DD H:i:s)
* Utente (text)

### Iscritti

This table contains library users. It has theese columns:
* ID (text)
* RFID (text)
* Nome (text)
* Cognome (text)
* Dati (JSON containing additional infos)

##Caching
To save time and load covers quickly, create a file named `covers.json` in the
folder in wich is contained `index.php` with the following content:
```
{}
```<commit_msg>Fixed readme<commit_after># PHP BiblioDB
[![Build Status](https://status.continuousphp.com/git-hub/eutampieri/PHPBiblioDB?token=<PASSWORD>-435951b5a04a)](https://continuousphp.com/git-hub/eutampieri/PHPBiblioDB)

## Requirements
<!--* Yandex API key, available at https://translate.yandex.com/developers/keys. It has to be put in `res/yandexAPIKey.txt`.-->

## DataBase structure:

The database consists in an SQLITE file containing four tables.

### Libri

This table contains books. It has these columns:
* ID (text)
* ISBN (text)
* Titolo (text)
* Autore (text)
* Posizione (text)
* Disponibilita (0:in prestito, 1:disponibile)
* DataPrestito (YYYY-MM-DD)

### Utenti

This table contains users. It has theese columns:
* Utente (text)
* Password (bcrypt encoded)
* Master (bool)

### Sessioni

This table contains sessions. It can be used for logging purposes. It has theese columns:
* Token (text)
* IP (text)
* Scadenza (YYYY-MM-DD H:i:s)
* Utente (text)

### Iscritti

This table contains library users. It has theese columns:
* ID (text)
* RFID (text)
* Nome (text)
* Cognome (text)
* Dati (JSON containing additional infos)

## Caching
To save time and load covers quickly, create a file named `covers.json` in the
folder in which is contained `index.php` with the following content:
```
{}
```
{'fraction_non_alphanumeric': 0.12934362934362933, 'fraction_numerical': 0.005019305019305019, 'mean_word_length': 4.682017543859649, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4380564', 'n_tokens_mistral': 905, 'n_tokens_neox': 880, 'n_words': 291}