PHPackages                             rockstarcode/markdb - 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. rockstarcode/markdb

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

rockstarcode/markdb
===================

Markdown flat file database

1.1.1(9y ago)92841MITPHPPHP &gt;=5.5.0

Since Oct 29Pushed 9y ago1 watchersCompare

[ Source](https://github.com/rockstarcode/MarkDB)[ Packagist](https://packagist.org/packages/rockstarcode/markdb)[ RSS](/packages/rockstarcode-markdb/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (4)Versions (6)Used By (0)

[![Build Status](https://camo.githubusercontent.com/5cfc5b96bce1c4b43084c3eba87723334cc9f49de1059b73bc5a865fd4d1280f/68747470733a2f2f7472617669732d63692e6f72672f726f636b73746172636f64652f4d61726b44422e706e67)](https://travis-ci.org/rockstarcode/MarkDB)[![Latest Stable Version](https://camo.githubusercontent.com/5f4cdfd191ccbc4f777611e653bad3c1dba16615beb1f249251368e48b23343e/68747470733a2f2f706f7365722e707567782e6f72672f726f636b73746172636f64652f6d61726b64622f762f737461626c65)](https://packagist.org/rockstarcode/markdb)[![Total Downloads](https://camo.githubusercontent.com/eee865e441be04b568ace415ccaa34ff4884814d26146c2794bd7e2467bac18a/68747470733a2f2f706f7365722e707567782e6f72672f726f636b73746172636f64652f6d61726b64622f646f776e6c6f616473)](https://packagist.org/packages/rockstarcode/markdb)[![Latest Unstable Version](https://camo.githubusercontent.com/c21f0fb067ca2a794cc44d630c5ef2b4b76abdc976ebcbffb874b1df9cc27e46/68747470733a2f2f706f7365722e707567782e6f72672f726f636b73746172636f64652f6d61726b64622f762f756e737461626c65)](https://packagist.org/packages/rockstarcode/markdb)[![Daily Downloads](https://camo.githubusercontent.com/f544f30c48361f72e6af98e310dac3c39029bfd9c2021b09ea5868f26633fb3e/68747470733a2f2f706f7365722e707567782e6f72672f726f636b73746172636f64652f6d61726b64622f642f6461696c79)](https://packagist.org/packages/rockstarcode/markdb)

MarkDB - MarkDown Database for Blogs/CMSs
-----------------------------------------

[](#markdb---markdown-database-for-blogscmss)

MarkDB is an engine that allows you to use MarkDown + Yaml files as data points for your CMS or Blog.

The intent is allow you to separate content creation from the platform which controls your application design. This allows you to write your blog or project in any method you'd like and attach content as if it were database driven.

This project stemmed from my blog at [RockstarCode](http://www.rockstarcode.com) where I didnt want to have to design my site via a CMS like OctoberCMS or Wordpress which would force me to write posts via their interface, nor did I want to store content in a database which needed to be sync'd.

The solution I chose was to create a flat file .git repo to house my articles and MarkDB was the interface to collect and manage posts.

This allows me to write posts and preview them locally before pushing them to different environments by simple git push.

Features
--------

[](#features)

- Pretty URL slug to identify files or directories
- Customize settings per file/directory
- Use a git repo to version control your data points
- Simple search for articles via attributes
- \[FUTURE\] - caching

### Libraries vs Articles

[](#libraries-vs-articles)

MarkDB will look for files and directories given a $base path

From there it will provide a list of Libraries (directories) and Articles (Files)

Libraries hold collections of child libraries and all child articles to allow you to loop thru if needed to create navigation. For example you may have a base blog with navigation on various topics \[Rants, Tutorials, Personal Thoughts\] Your base new MarkDB('/path/to/blog/data') would house 3 libraries Rants, Tutorials, Personal Thoughts which you can use to pull unique data from or link to

Articles house file information in both YAML &amp; MarkDown which you can use to customize data and presentation.

```
    ---
    title: Article Title
    author: Authr Name
    author_email: Author@Email.com
    authdeck: author.name
    ---
    ### Hello World

    This is my article
```

Everything between `---` will be processed as yaml, below the second `---` will be processed as markdown

### Requirements

[](#requirements)

- LibYaml &amp; pecl yaml for PHP Updated to symfony/yaml to remove dependency
- Carbon for data time

### Installation

[](#installation)

```
    composer require "rockstarcode/markdb:dev-master"

```

### Usage

[](#usage)

```
$MarkDb = new MarkDB\MarkDB('/path/to/files/','base/path/to/form/relative/slugs');

$slug = 'path/to/some/article';

$article = $MarkDb->get($slug); # (object) Article

   $article->slug           # url friendly path that identifies article in MarkDB
   $article->{$property}    # properties extracted from YAML processing of the article
   $article->content()      # processed MarkDown of content of article
   $article->read_time()    # helper to calculate words in article and average read time
   $article->summary()      # Extract certain percentage of content for preview

$find = $MarkDb->where(['author'=>'Author Name','category'=>'Books Ive Read']);  (Array)[Articles]

foreach($MarkDb->libraries as $library){
     $library->articles     # list of articles within library
     $library->libraries    # list of child libraries
     $library->index        # list of all libraries/articles by slug
     $library->slug         # slug which identifies library

}
```

### Laravel

[](#laravel)

MarkDB comes with a Laravel 5.\* Service Provider which will add MarkDB as a facade to your application

```
# .env
MARKDB_PATH=/path/to/blog-cms

# config/app.php

    'providers'=>[
        ...
        \MarkDb\Support\Laravel\MarkDBServiceProvider::class,
    ],

    'aliases' => [
        ...
        'MarkDb' => \MarkDB\Support\Laravel\MarkDBFacade::class,
    ]
```

a sample route to see articles in Laravel :

```
#routes.php
  Route::get('/posts, ['as'=>'posts','uses'=>function($slug){

          $markdb= app()->make('markdb');

          $articles = $cms->articles( /*optional*/ ['page'=>1, 'limit'=>10]);

          return view('index',['articles'=>$articles]);

    }])->where('slug','(.*)');

  Route::get('/posts/{slug}', ['as'=>'post','uses'=>function($slug){

        $article = \MarkDB::get($slug);

        return view('article',['article'=>$article]);

  }])->where('slug','(.*)');
```

### Tutorial

[](#tutorial)

I created a simple Lumen + MarkDB tutorial which steps you thru basic usage

[RockstarCode - Lumen + MarkDB](http://www.rockstarcode.com/posts/tutorials/laravel/markdb)

License
-------

[](#license)

Released under MIT license, feel free to use, modify, contribute changes.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

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

Total

4

Last Release

3599d ago

Major Versions

0.1.0 → 1.0.02015-10-30

PHP version history (2 changes)0.1.0PHP &gt;=5.5.9

1.0.0PHP &gt;=5.5.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/65c27a46e9e70beb8aaa7c6c8da6643d3fbc6a32deeb5ea1c9191e6f509a5af5?d=identicon)[wonderfulso](/maintainers/wonderfulso)

---

Top Contributors

[![82rules](https://avatars.githubusercontent.com/u/2653133?v=4)](https://github.com/82rules "82rules (42 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rockstarcode-markdb/health.svg)

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

###  Alternatives

[getgrav/grav

Modern, Crazy Fast, Ridiculously Easy and Amazingly Powerful Flat-File CMS

15.4k84.1k1](/packages/getgrav-grav)[kimai/kimai

Kimai - Time Tracking

4.6k7.4k1](/packages/kimai-kimai)[bolt/core

🧿 Bolt Core

585142.5k54](/packages/bolt-core)[ryangjchandler/orbit

A flat-file database driver for Eloquent.

922256.2k5](/packages/ryangjchandler-orbit)[jerome/filterable

Streamline dynamic Eloquent query filtering with seamless API request integration and advanced caching strategies.

19226.1k](/packages/jerome-filterable)[alajusticia/laravel-expirable

Make Eloquent models expirable

2193.4k5](/packages/alajusticia-laravel-expirable)

PHPackages © 2026

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