News Archive
PhpRiot Newsletter
Your Email Address:

More information

Introducing phorkie: git based pastebin

Note: This article was originally published at Planet PHP on 19 April 2012.
Planet PHP

At work, we've been looking for a pastebin application with a special feature set:

  • Self-hosted, so we can paste code and data without having to care about sensitive customer data becoming public accidentially
  • written in PHP, since we're a PHP shop
  • editability so other people can do fixes for us
  • title support for pastes so we can find it later
  • navigation among pastes so we don't have to remember the number later
  • search because navigation doesn't help with 1k+ pastes

We did not find anything suitable after researching for some days. Since I needed a new spare time project, I began working on phorkie.

After working on it for a month, I've just released the first version 0.1.0 and you're welcome to try it.


phorkie is a self-hosted pastebin software written in PHP. Pastes are editable, may have multiple files and are stored in git repositories.

It turned out to be a clone of github's gist tool, but with less features - for now.


  • Every paste is a git repository
    • Repositories can be cloned
    • Clone url can be displayed
  • Multiple files in one paste
  • Pastes can be edited
    • Add and delete files
    • Replace file with upload
    • History in sidebar
    • Easy access to old revisions
  • Syntax highlighting with GeSHi
  • rST rendering with rst2html (python docutils).
  • image upload and display
  • external tool support (xmllint, php syntax check)

Missing tools

For the history/log display, I wanted to display the timestamps in a human readable manner, e.g. "5 minutes ago" instead of 2012-04-18 22:36.

Looking for existing libraries, I found plenty for Python and Javascript, but not a single one for PHP. After asking on stackoverflow without getting a usable answer, I wrote my own and proposed it to PEAR: Date_HumanDiff.


Also see the wiki.

Shadowbox.init({ continuous: true, displayCounter: false, displayNav: true, handleOversize: "resize" });