The SSH host key has changed on 8 April, 2022 to this one: SHA256:573uTBSeh74kvOo0HJXi5ijdzRm8me27suzNEDlGyrQ
1
0
Fork 0
A JSON-RPC based SMS Gateway
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
smsgateway/src/SmsGateway/RpcServer.php

67 lines
1.3 KiB

<?php
namespace SmsGateway;
use Symfony\Component\HttpFoundation\Request;
use SmsGateway\BackendInterface;
use SmsGateway\LoggerInterface;
use SmsGateway\SenderInterface;
class RpcServer
{
/**
* The user backend
*
* @var SmsGateway\BackendInterface $backend
*/
private $backend;
/**
* The logger
*
* @var SmsGateway\LoggerInterface $logger
*/
private $logger;
/**
* The sender
*
* @var SmsGateway\SenderInterface $sender
*/
private $sender;
public function __construct(BackendInterface $backend, LoggerInterface $logger, SenderInterface $sender)
{
}
protected function login(array $params)
{
return true;
}
protected function send(array $params)
{
return true;
}
protected function logout(array $params)
{
return true;
}
public function handle(Request $request, array $jsonData)
{
$params = $jsonData['params'];
switch ($jsonData['method']) {
case 'login':
break;
case 'send':
break;
case 'logout':
break;
default:
throw new \Exception('Invalid request');
}
return 'ajaj';
}
}