mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-06-06 06:46:25 +02:00
add adapters
This commit is contained in:
parent
b1c4a1e3aa
commit
f609fc175f
3 changed files with 212 additions and 18 deletions
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
namespace \adapters;
|
||||
namespace adapters;
|
||||
|
||||
/**
|
||||
* Interface for phones adapters
|
||||
|
@ -10,47 +10,40 @@
|
|||
*/
|
||||
interface AdapterInterface
|
||||
{
|
||||
/**
|
||||
* Classname of the adapter
|
||||
*/
|
||||
public static function meta_classname() : string;
|
||||
|
||||
/**
|
||||
* Name of the adapter.
|
||||
* It should probably be the name of the service it adapt (e.g : Gammu SMSD, OVH SMS, SIM800L, etc.)
|
||||
*/
|
||||
public const $name;
|
||||
public static function meta_name() : string;
|
||||
|
||||
/**
|
||||
* Description of the adapter.
|
||||
* A short description of the service the adapter implements.
|
||||
*/
|
||||
public const $description;
|
||||
public static function meta_description() : string;
|
||||
|
||||
/**
|
||||
* Description of the datas expected by the adapter to help the user. (e.g : A list of expecteds Api credentials fields, with name and value)
|
||||
*/
|
||||
public const $datas_help;
|
||||
public static function meta_datas_help() : string;
|
||||
|
||||
/**
|
||||
* Does the implemented service support flash smss
|
||||
*/
|
||||
public const $support_flash;
|
||||
public static function meta_support_flash() : bool;
|
||||
|
||||
|
||||
/**
|
||||
* Phone number using the adapter
|
||||
*/
|
||||
private $number;
|
||||
|
||||
/**
|
||||
* Datas used to configure interaction with the implemented service. (e.g : Api credentials, ports numbers, etc.).
|
||||
*/
|
||||
private $datas;
|
||||
|
||||
|
||||
/**
|
||||
* Adapter constructor, called when instanciated by RaspiSMS
|
||||
* @param string $number : Phone number the adapter is used for
|
||||
* @param json string $datas : JSON string of the datas to configure interaction with the implemented service
|
||||
* @return bool : True on successfull creation and connection, False on error
|
||||
*/
|
||||
public function __construct (string $number, string $datas) : boolean;
|
||||
public function __construct (string $number, string $datas);
|
||||
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue