mirror of
https://github.com/ZeJMaN/LBCAlerte_ynh.git
synced 2025-07-06 11:50:48 +02:00
Initial commit
Functional, without SSO
This commit is contained in:
33
sources/lib/Message/AdapterFactory.php
Normal file
33
sources/lib/Message/AdapterFactory.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Message;
|
||||
|
||||
use \Message\Adapter;
|
||||
|
||||
class AdapterFactory
|
||||
{
|
||||
/**
|
||||
* @param string $service
|
||||
* @param array $options
|
||||
* @return \Adapter\AdapterAbstract
|
||||
*/
|
||||
public static function factory($service, array $options = array())
|
||||
{
|
||||
$service = strtolower($service);
|
||||
switch ($service) {
|
||||
case "smsfreemobile":
|
||||
case "freemobile":
|
||||
return new Adapter\SmsFreeMobile($options);
|
||||
case "smsovh":
|
||||
case "ovh":
|
||||
return new Adapter\SmsOvh($options);
|
||||
case "notifymyandroid":
|
||||
return new Adapter\NotifyMyAndroid($options);
|
||||
case "pushbullet":
|
||||
return new Adapter\Pushbullet($options);
|
||||
case "pushover":
|
||||
return new Adapter\Pushover($options);
|
||||
}
|
||||
throw new \Exception("No service available");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user