Pharox
©2026 Systemi Co. Ltd.

Plugins

Pharox is built on the principle of K.I.S.S. (Keep It Simple, Stupid), with the main focus on avoiding feature creep! Instead of packing everything into the core, the system is intentionally split into a stable canon (core),and an extensible layer of plugins. This separation allows to react to customer wishes, additional css themes, and experimental ideas to live outside the core without bloating it. Over time, well-proven and broadly accepted features can be promoted from plugins into the core, ensuring that the foundation remains clean, maintainable, and focused.

Enable / Disable Plugins

after initializing a new project with pharox init, type pharox plugins to opt-in and out the plugins you wanna use for your project. As an alternative you can also directly edit the config.json inside your project folder.

...
"plugins": [
    "inheritance-diagram"
]

Plugin Scaffold

In order to write your very own plugin you have to create a new folder in in ./plugin. Give that folder a unique name and use the following javascript code as a starting point.

import { HOOK } from "../../hook.js";

export default 
{
    id  : "myPlugin"
,   name: "myPlugin"
,   run() 
    {
        HOOK.add_action("actionExample", (arg1, arg2) => { });
        HOOK.add_filter("filterExample", (arg1, arg2) => { return `...`; });
    }
};

Actions and Filters

Pharox uses the same hook system as WordPress. A hook is basicly an event that fires when you reach a certain point in code.

There are two types of hooks: Actions and Filters. An example for an action would be: "programStarted", "cssFileLoad". Now you can hook into that event and append a custom callback function that fires when that point in code get reached.

Action Filter
HOOK.do_action(name, ...args) HOOK.apply_filter(name, value, ...args)
HOOK.add_action(name, callback, priority?) HOOK.add_filter(name, callback, priority?)
import { HOOK } from './hook.js';

generateFileXY()
{
    //  the event gets executed
    HOOK.do_action( 'myHookName', myVar );

    ...

}

//  append additional behaviour via callback
HOOK.add_action('myHookName', ( myVar ) => { console.log( myVar ); })

The only difference between an Action and a Filter is that a filter needs to return a value in its callback function to manipulate the original result, while an action does not need to return a value.

const content = HOOK.apply_filter("myFile", fs.readFileSync(file, 'utf8'));

...

HOOK.add_filter("myFile", ( file ) => { return file..replaceAll('a','x'); })

But why using the hooksystem at all? When adding a new feature to pharox it is highly recommended to write a new plugin using the hooksystem instead of bloating core files in order to keep the codebase nice and clean. By using hooks we can manipulate the flow of the program from the outside without messing around with the core files.