pe/component-cronos-controller

Cronos remote controller sub-component

v1.0.0 2019-04-02 12:57 UTC

This package is auto-updated.

Last update: 2022-10-29 02:14:11 UTC


README

The following versions of PHP are supported.

  • PHP 7.1+

Installation

To install, use composer:

php composer.phar require pe/component-cronos-controller

Usage

Server usage

<?php

namespace PE\Component\Cronos;

use PE\Component\Cronos\Controller\ControllerModule;
use PE\Component\Cronos\Core\ServerInterface;

// Initialize server
/* @var $server ServerInterface */
$server = '...';

// Attach module
$module = new ControllerModule();
$server->attachModule('controller', $module);

Client usage

<?php

namespace PE\Component\Cronos;

use PE\Component\Cronos\Core\ClientInterface;
use PE\Component\Cronos\Controller\ControllerAPI;

// Initialize client
/* @var $client ClientInterface */
$client = '...';

// Create API instance
$api = new ControllerAPI($client);

// Call for start server
$api->serverStart();

// Call for stop server
$api->serverStop();