pxgamer/minimin

A modular php interface for server management.

v1.0.4 2017-12-07 17:16 UTC

This package is auto-updated.

Last update: 2024-04-11 13:02:42 UTC


README

Latest Version on Packagist Software License Build Status Style CI Code Coverage Total Downloads

A modular php interface for server management.

Structure

public/
src/
tests/
vendor/

Install

Via Composer

$ composer create-project pxgamer/minimin

Usage

Basic Plugin format

Classes accessible to plugins:

  • Smarter (this will need to have a custom template directory added using addTemplateDir())
  • System* (nezamy/route classes)
  • Any classes that they import/require

Packages should follow the folder structure below:

/
    src/
        /Templates
            /{PluginName}
        App.php
        Plugin.php
    composer.json

For reference, view the minimin-package-example plugin on Github.

App.php

<?php

namespace {vendor}\{plugin};

use pxgamer\Minimin\Smarter;

class App
{
    // When initialised by the Minimin class, it will pass the $route to the plugin App constructor
    public function __construct($route)
    {
        // ... Run plugin commands
        $Smarter = Smarter::get();
        $Smarter->addTemplateDir(__DIR__ . '/Templates/');
    }
}

Plugin.php

<?php

namespace {vendor}\{plugin};

class Plugin
{
    public static function info()
    {
        /** This function MUST return the following values:
         *  - app_namespace
         *  - name
         *  - link
         *  - description
         */
        
        $object = (object)[
            'app_namespace' => '\\{vendor}\\{plugin}', // The namespace of the plugin
            'name' => 'Cron Tasks', // The name of the plugin, may contain spaces
            'link' => 'cron-tasks', // The link that will be used (e.g. `cron-tasks` will be `/cron-tasks`)
            'description' => 'A cron task manager for servers.' // The description of the plugin
        ];
        
        return $object;
    }
}

Example data/plugins.json format

[
  {
    "app_namespace": "\\pxgamer\\CronTasks",
    "name": "Cron Tasks",
    "link": "cron-tasks",
    "description": "A cron task manager for servers."
  }
]

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email owzie123@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.