Some updates

This commit is contained in:
Gergely Polonkai (W00d5t0ck)
2012-09-25 19:20:56 +02:00
parent 80376ff566
commit 61d0399828
7 changed files with 42 additions and 72 deletions

View File

@@ -0,0 +1,8 @@
<?php
namespace SmsGateway\Backend;
use SmsGateway\AuthInterface;
class DatabaseAuth implements AuthInterface
{
}

View File

@@ -1,6 +1,6 @@
<?php
namespace SmsGateway;
interface BackendInterface
interface AuthInterface
{
}
}

View File

@@ -1,8 +0,0 @@
<?php
namespace SmsGateway\Backend;
use SmsGateway\BackendInterface;
class DatabaseBackend implements BackendInterface
{
}

View File

@@ -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;
}
}

View File

@@ -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);
}