Some updates
This commit is contained in:
8
src/SmsGateway/Auth/DatabaseAuth.php
Normal file
8
src/SmsGateway/Auth/DatabaseAuth.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
namespace SmsGateway\Backend;
|
||||
|
||||
use SmsGateway\AuthInterface;
|
||||
|
||||
class DatabaseAuth implements AuthInterface
|
||||
{
|
||||
}
|
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
namespace SmsGateway;
|
||||
|
||||
interface BackendInterface
|
||||
interface AuthInterface
|
||||
{
|
||||
}
|
||||
}
|
@@ -1,8 +0,0 @@
|
||||
<?php
|
||||
namespace SmsGateway\Backend;
|
||||
|
||||
use SmsGateway\BackendInterface;
|
||||
|
||||
class DatabaseBackend implements BackendInterface
|
||||
{
|
||||
}
|
@@ -5,4 +5,18 @@ use SmsGateway\SenderInterface;
|
||||
|
||||
class GnokiiSender implements SenderInterface
|
||||
{
|
||||
}
|
||||
private $gnokiiPath;
|
||||
|
||||
public function __construct($gnokiiPath)
|
||||
{
|
||||
$this->gnokiiPath = $gnokiiPath;
|
||||
|
||||
if (!is_executable($this->gnokiiPath)) {
|
||||
throw new \Exception('Specified Gnokii executable is not executable by me!');
|
||||
}
|
||||
|
||||
public function send($recipient, $message)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@@ -3,4 +3,12 @@ namespace SmsGateway;
|
||||
|
||||
interface SenderInterface
|
||||
{
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param string $recipient
|
||||
* @param string $message
|
||||
* @return boolean true upon success. On error, throws exceptions.
|
||||
* @throws Exception Upon sending error. Gnokii output will be
|
||||
* stored in $e->message
|
||||
public function send($recipient, $message);
|
||||
}
|
||||
|
Reference in New Issue
Block a user