SAREhub/php_component_worker

View on GitHub
src/SAREhub/Component/Worker/Cli/SystemdHelper.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace SAREhub\Component\Worker\Cli;

class SystemdHelper {
    
    /**
     * @param string $unitName
     */
    public function start($unitName) {
        $this->exec('systemctl start '.$unitName);
    }
    
    /**
     * @param string $path
     * @return string
     */
    public function escape($path) {
        return $this->exec('systemd-escape '.$path);
    }
    
    /**
     * @param string $command
     * @return string
     */
    public function exec($command) {
        return shell_exec($command);
    }
}