PHPackages                             phonetworks/pho-kernel - 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. [Framework](/categories/framework)
4. /
5. phonetworks/pho-kernel

ActiveProject[Framework](/categories/framework)

phonetworks/pho-kernel
======================

A simple microkernel implementation with Twitter-like functionality.

3.0.0(7y ago)45.4k1[1 issues](https://github.com/phonetworks/pho-kernel/issues)[2 PRs](https://github.com/phonetworks/pho-kernel/pulls)2MITPHPPHP ^7.1

Since Aug 13Pushed 3y ago1 watchersCompare

[ Source](https://github.com/phonetworks/pho-kernel)[ Packagist](https://packagist.org/packages/phonetworks/pho-kernel)[ Docs](https://phonetworks.org)[ RSS](/packages/phonetworks-pho-kernel/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (7)Dependencies (7)Versions (10)Used By (2)

 [![](https://github.com/phonetworks/commons-php/raw/master/.github/cover-smaller.png)](https://github.com/phonetworks/commons-php/raw/master/.github/cover-smaller.png)

pho-kernel
==========

[](#pho-kernel)

A simple microkernel implementation with Twitter-like functionality by default. You may change the functionality simply by copy/pasting a new recipe from the [presets](https://github.com/phonetworks/pho-kernel/tree/master/presets) directory. Check out "Working with Custom Recipes" below the README file for more information.

Requirements
------------

[](#requirements)

The default pho-kernel requires:

- [Redis server 4.0+](https://redis.io)
- [PHP 7.2+](https://php.net)
- [Composer](https://getcomposer.org/) latest version

You may also test pho-kernel by using [Vagrant](https://www.vagrantup.com/). Check out "Testing" for more information.

Pho-Kernel used to depend on [Neo4j Server 3.1+](https://neo4j.com) for indexing. It no longer does as of version 3.0. But you may still use it if you prefer more advanced Cypher queries.

> If you will use Neo4J for indexing, make sure you change your .env file to include INDEX\_TYPE="neo4j" instead of INDEX\_TYPE ="redis"

Testing
-------

[](#testing)

Testing allows you to get a feel of pho-kernel without bloating your system with servers such as Redis and Neo4j. However, you would still need to have [Vagrant](https://www.vagrantup.com/) installed.

Once you have Vagrant, just type in the following in the directory where pho-kernel is installed:

```
vagrant up
vagrant ssh # this will open a new session, continue from there.
cd /opt/pho-kernel
yes | cp presets/basic ./composer.json
composer install # this may take a while to operate
php -a # this will also open a new session.
include("kernel.php");
```

Now you can play with the kernel. Check out "Getting Started" for more information.

Install
-------

[](#install)

The recommended way to install pho-kernel is through composer.

Let's say, you want to install a kernel under a directory called `test-dir`. Here's what you type in the terminal:

```
composer create-project -s "dev" phonetworks/pho-kernel test-dir
```

This will install pho-kernel as well as its dependencies. Once installed, read/edit the bootstrapper script [kernel.php](https://github.com/phonetworks/pho-kernel/blob/master/kernel.php). The sole purpose of the bootstrapper script is

- to set up the servers (e.g. Neo4J, Redis, loggers etc) given environment envirables set in `.env` file.
- provide you with the `$kernel` which you can use to interact with your graph, or embed in another environment (e.g. [REST Server](https://github.com/phonetworks/pho-server-rest)) for further functionality.

You will also need to set up a .env file to instruct the kernel about the services to use. A sample .env file is included as `.env.example`. Just copy/paste it as .env to get started with the basics.

```
cp .env.example .env
# vi .env # if necessary
```

Getting Started
---------------

[](#getting-started)

1. Make sure your .env file is functional; addressing your servers properly.
2. Run `php -a` on your terminal to switch to PHP shell. Then,

```
include("kernel.php"); // this will set it up.

echo $founder; // will dump the founder's ID.
echo $graph; // will dump the graph's ID.

$tweet = $founder->post("My first tweet"); // let's create a tweet.

$new_user = new \PhoNetworksAutogenerated\User($kernel, $graph, "my_password"); // let's create our first user object.
$new_user->like($tweet); // the user likes the one and only tweet in the graph.

// Now examine these:
var_dump($tweet->getLikers());
var_dump($tweet->getAuthors());
var_dump($new_user->getLikes());
var_dump($founder->getPosts());
```

Working with Custom Recipes
---------------------------

[](#working-with-custom-recipes)

If you'd like the kernel to run on a custom recipe, you must:

1. Clone this repository. `git clone https://github.com/phonetworks/pho-kernel`
2. Change the [composer.json](https://github.com/phonetworks/pho-kernel/tree/master/composer.json) file and replace `pho-recipes/basic` with your custom recipe repo.
3. Run `composer install` to finish up with dependencies.
4. Follow the steps described in the "Getting Started" section.

The [presets](https://github.com/phonetworks/pho-kernel/tree/master/presets) directory comes with custom composer.json files that you can copy/paste on the existing [one](https://github.com/phonetworks/pho-kernel/tree/master/composer.json). This could enable you to run a Facebook or Twitter clone in a few simple steps.

However, if your goal is to run a completely custom recipe, then first of all, you need to:

1. Form that recipe (possibly by cloning one of the existing ones in the  repo).
2. Make your recipe a composer package by uploading it to
3. Replace `pho-recipes/basic` with your custom recipe repo in [composer.json](https://github.com/phonetworks/pho-kernel/tree/master/composer.json)
4. Run `composer install` to finish up with dependencies.
5. Follow the steps described in the "Getting Started" section.

The kernel.php file
-------------------

[](#the-kernelphp-file)

If you are running pho-kernel on a custom set of compiled pgql files, make sure:

1. The `default_objects` variables in Kernel configs (as shown by `$configs` in [kernel.php](https://github.com/phonetworks/pho-kernel/blob/master/kernel.php)) have a proper set of "graph" and "user" classes set.
2. Before booting up the kernel, a custom founder object is initialized and passed as an argument to the `boot` method.

License
-------

[](#license)

MIT, see [LICENSE](https://github.com/phonetworks/pho-kernel/blob/master/LICENSE).

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity64

Established project with proven stability

 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 ~73 days

Recently: every ~110 days

Total

7

Last Release

2803d ago

Major Versions

0.9.1 → 1.0.02017-08-13

1.1.0 → 2.0.02018-01-11

2.0.1 → 3.0.02018-10-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/a3b6d80630289b910b490ff8998d30fd7a83e346ee6568e91c5df5eaae64d294?d=identicon)[esokullu](/maintainers/esokullu)

---

Top Contributors

[![esokullu](https://avatars.githubusercontent.com/u/19166?v=4)](https://github.com/esokullu "esokullu (94 commits)")

### Embed Badge

![Health badge](/badges/phonetworks-pho-kernel/health.svg)

```
[![Health](https://phpackages.com/badges/phonetworks-pho-kernel/health.svg)](https://phpackages.com/packages/phonetworks-pho-kernel)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k532.1M19.4k](/packages/laravel-framework)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k38.6M289](/packages/laravel-dusk)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[doppar/framework

The Doppar Framework

4011.2k14](/packages/doppar-framework)[lion/bundle

Lion-framework configuration and initialization package

122.3k3](/packages/lion-bundle)

PHPackages © 2026

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