PHPackages                             bugo/forko - 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. bugo/forko

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

bugo/forko
==========

Class to work with Database via SMF forks

0.5.1(2y ago)16MITPHPPHP ^8.0

Since Apr 18Pushed 1y ago1 watchersCompare

[ Source](https://github.com/dragomano/Forko)[ Packagist](https://packagist.org/packages/bugo/forko)[ Docs](https://github.com/dragomano/Forko)[ RSS](/packages/bugo-forko/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

Wrappers for SMF and forks to work with Database
================================================

[](#wrappers-for-smf-and-forks-to-work-with-database)

[![ElkArte 1.1.x](https://camo.githubusercontent.com/618deb87d0ba1ff32c83cd340f83ab5d363e3866171ebcd16748fb47db6c34e4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f456c6b417274652d312e312e782d677265656e2e7376673f7374796c653d666c6174)](https://camo.githubusercontent.com/618deb87d0ba1ff32c83cd340f83ab5d363e3866171ebcd16748fb47db6c34e4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f456c6b417274652d312e312e782d677265656e2e7376673f7374796c653d666c6174)[![SMF 2.1.x](https://camo.githubusercontent.com/c1a95ad1861fe3c64ddca4552d462b1ba7ae7ab8d1a1f223b37b51f9f0f9a794/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f534d462d322e312e782d6564363033332e7376673f7374796c653d666c6174)](https://camo.githubusercontent.com/c1a95ad1861fe3c64ddca4552d462b1ba7ae7ab8d1a1f223b37b51f9f0f9a794/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f534d462d322e312e782d6564363033332e7376673f7374796c653d666c6174)[![PHP](https://camo.githubusercontent.com/d3fd739f7d208cc523aa8d6267c4dd6e50f4ea43d243e4dbb8c53b081f8d2690/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253545382e302d626c75652e7376673f7374796c653d666c6174)](https://camo.githubusercontent.com/d3fd739f7d208cc523aa8d6267c4dd6e50f4ea43d243e4dbb8c53b081f8d2690/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253545382e302d626c75652e7376673f7374796c653d666c6174)[![Coverage Status](https://camo.githubusercontent.com/a3e19a92f30b707bcf91480edbffd8f6148477a18c60062ef2f99125ebb4b3c9/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f647261676f6d616e6f2f466f726b6f2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/dragomano/Forko?branch=master)

Install
-------

[](#install)

`composer require bugo/forko`

Usage
-----

[](#usage)

```
// At first, require SSI.php of your forum (or autoload.php of your engine)
require_once(dirname(__FILE__) . '/SSI.php');

// Then require autoload.php from this package
require_once(__DIR__ . '/vendor/autoload.php');

// Define SMF
$name = 'smf';
$obj = $smcFunc;

// ... or Wedge
$name = 'wedge';
$obj = new wesql();

// ... or ElkArte
$name = 'elkarte';
$obj = database();

// ... or PortaMx
$name = 'pmx';
$obj = $pmxcFunc;

// ... or StoryBB
$name = 'sbb';
$obj = $smcFunc['db'];

// And now get the adapter
$forko = new \Bugo\Forko\Forko($name);
$adapter = $forko->getAdapterName();
$db = new $adapter($obj);

// ... or you can call concrete adapter directly
$db = new \Bugo\Forko\Adapters\SMFAdapter($obj);
```

```
// SELECT * FROM {db_prefix}topics
$all_topics = $db->findAll('topics');
var_dump($all_topics);
```

```
// INSERT INTO {db_prefix}calendar_holidays (event_date, title) VALUES('2020-01-01', 'The Event Name')
$result = $note_id = $db->insert('calendar_holidays', ['event_date' => 'string', 'title' => 'string'], ['2020-01-01', 'The Event Name'], ['id_holiday']);
var_dump($result);
```

```
// UPDATE FROM {db_prefix}topics SET title = "New title" WHERE id_topic = 1
$result = $db->update('topics', ['is_sticky' => '{int:is_sticky}'], 'WHERE id_topic = 1', ['is_sticky' => 1]);
var_dump($result);
```

```
// DELETE FROM {db_prefix}calendar_holidays WHERE id_holiday = $note_id
$result = $db->delete('calendar_holidays', 'WHERE id_holiday = {int:id}', ['id' => $note_id]);
var_dump($result);
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~222 days

Total

2

Last Release

905d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6ef0dd570abdd5696bf5ba391bcd00ed0bb0ac5d1a5654785e8f204d548ddfc0?d=identicon)[Bugo](/maintainers/Bugo)

---

Top Contributors

[![dragomano](https://avatars.githubusercontent.com/u/229402?v=4)](https://github.com/dragomano "dragomano (21 commits)")

---

Tags

elkarteportamxsmfstorybbwedgedatabaseSMFwedgeelkarteforkostorybbportamx

### Embed Badge

![Health badge](/badges/bugo-forko/health.svg)

```
[![Health](https://phpackages.com/badges/bugo-forko/health.svg)](https://phpackages.com/packages/bugo-forko)
```

###  Alternatives

[doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.

9.7k578.4M5.6k](/packages/doctrine-dbal)[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[doctrine/doctrine-bundle

Symfony DoctrineBundle

4.8k241.3M3.3k](/packages/doctrine-doctrine-bundle)[doctrine/migrations

PHP Doctrine Migrations project offer additional functionality on top of the database abstraction layer (DBAL) for versioning your database schema and easily deploying changes to it. It is a very easy to use and a powerful tool.

4.8k204.8M440](/packages/doctrine-migrations)[doctrine/data-fixtures

Data Fixtures for all Doctrine Object Managers

2.8k136.1M516](/packages/doctrine-data-fixtures)[robmorgan/phinx

Phinx makes it ridiculously easy to manage the database migrations for your PHP app.

4.5k46.2M405](/packages/robmorgan-phinx)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
