PHPackages                             bitendian/tbp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. bitendian/tbp

ActiveLibrary[Database &amp; ORM](/categories/database)

bitendian/tbp
=============

Light framed PHP library

v1.0.32(3y ago)23.8k25MITPHPPHP &gt;=5.3.2CI failing

Since Jun 26Pushed 3y ago4 watchersCompare

[ Source](https://github.com/Bitendian/tbp)[ Packagist](https://packagist.org/packages/bitendian/tbp)[ Docs](http://www.bitendian.com/portfolio/tbp-3/)[ RSS](/packages/bitendian-tbp/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (1)Versions (37)Used By (5)

TBP
===

[](#tbp)

*TBP* is a light framework designed to develop small and medium websites. Focused in component oriented

Database interfaces
-------------------

[](#database-interfaces)

### SQLite

[](#sqlite)

Connector to SQLite3. Works with prepared statements (mandatory). Support for transactions.

#### Installation

[](#installation)

PHP extension `ext-sqlite3` required. Check `phpinfo()`. By default, `tbp-web-server` Docker image supports SQLite.

Add to your `composer.json`, at `require` section:

```
"ext-sqlite3": "*"

```

#### Configuration

[](#configuration)

Create a config file, like `config/my-sqlite.config`

```
# TBP/SQLite config file.
# ALL PARAMETERS ARE OPTIONAL!

# Database file name (if not defined, will use 'default.db')
filename=resources/test.db

# Access type
# readOnly=yes

# Encryption key (if not defined, no encryption used)
# encryptionKey=

```

#### Implementation

[](#implementation)

Create a *Domain* extending `AbstractSqliteDomain` and pass your config file. Add one method for each needed query.

```
class MyDomain extends AbstractSqliteDomain
{
    public function __construct()
    {
        $configReader = new Config(__CONFIG_PATH__);            // getConfig('my-sqlite');        // filename =                                     // filename;
        parent::__construct($config);
        $this->open();                                          //
