Node Manager Pm2

PHP

Plesk extension for managing PM2-powered Node.js applications with process control, monitoring, deployment automation, and seamless server integration.

Stars
16
Forks
2
Downloads
N/A
Open Issues
0
Files main

Repository Files

Loading file structure...
plib/library/NodeManagerPm2/Autoload.php
<?php
class Modules_NodeManagerPm2_Autoload
{
    public static function register()
    {
        spl_autoload_register([__CLASS__, 'load']);
    }

    public static function load($class)
    {
        $prefix = 'Modules_NodeManagerPm2_';
        if (strpos($class, $prefix) !== 0) {
            return false;
        }

        $relative = substr($class, strlen($prefix));
        $path = __DIR__ . '/' . str_replace('_', '/', $relative) . '.php';
        if (is_file($path)) {
            require_once $path;
            return true;
        }

        return false;
    }
}