Skip to content

Commit 84a3b01

Browse files
committed
Merge pull request #2 from scaytrase/feature/refactoring
Refactoring. * Standalone service * Custom transports * Profiler
2 parents 4ebd7ad + cc8119a commit 84a3b01

30 files changed

+620
-759
lines changed

.properties

-2
This file was deleted.

.travis.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
language: php
2+
3+
php:
4+
- 5.4
5+
- 5.5
6+
- 5.6
7+
- hhvm
8+
9+
env:
10+
- SYMFONY_VERSION='2.3.*' deps='no'
11+
- SYMFONY_VERSION='2.5.*' deps='no'
12+
- SYMFONY_VERSION='2.6.*' deps='no'
13+
- SYMFONY_VERSION='2.7.*@dev' deps='no'
14+
15+
matrix:
16+
include:
17+
- php: 5.5
18+
env: SYMFONY_VERSION='~2.8@dev' deps='no'
19+
- php: 5.5
20+
env: SYMFONY_VERSION='~2.8|~3.0@dev' deps='no'
21+
- php: 5.4
22+
env: SYMFONY_VERSION='2.3.*' deps='low'
23+
24+
allow_failures:
25+
- php: hhvm
26+
27+
before_install:
28+
- travis_retry composer self-update
29+
30+
install:
31+
- composer require --no-update symfony/symfony=${SYMFONY_VERSION}
32+
- if [ "$deps" = "no" ]; then composer --prefer-source install; fi;
33+
- if [ "$deps" = "low" ]; then composer --prefer-source --prefer-lowest --prefer-stable update; fi;
34+
35+
script:
36+
- mkdir -p build
37+
- phpunit --colors -c phpunit.xml --coverage-text

README.md

+28-26
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,68 @@
11

2-
# symfony-sms-interface
2+
# scaytrase/symfony-sms-delivery-bundle
33
[![Latest Stable Version](https://poser.pugx.org/scaytrase/symfony-sms-interface/v/stable.svg)](https://packagist.org/packages/scaytrase/symfony-sms-interface) [![Total Downloads](https://poser.pugx.org/scaytrase/symfony-sms-interface/downloads.svg)](https://packagist.org/packages/scaytrase/symfony-sms-interface) [![Latest Unstable Version](https://poser.pugx.org/scaytrase/symfony-sms-interface/v/unstable.svg)](https://packagist.org/packages/scaytrase/symfony-sms-interface) [![License](https://poser.pugx.org/scaytrase/symfony-sms-interface/license.svg)](https://packagist.org/packages/scaytrase/symfony-sms-interface)
44

55
[![Monthly Downloads](https://poser.pugx.org/scaytrase/symfony-sms-interface/d/monthly.png)](https://packagist.org/packages/scaytrase/symfony-sms-interface)
66
[![Daily Downloads](https://poser.pugx.org/scaytrase/symfony-sms-interface/d/daily.png)](https://packagist.org/packages/scaytrase/symfony-sms-interface)
77

8-
This Symfony2 bundle provides basic interface for sending short messages as a service
8+
This Symfony2 bundle provides basic service for sending short messages. This bundle does not provide you any finished implementation for communicating the SMS gateway. To use it you have use some transport implementation or implemenent a transport on your own. See [usage section](#Usage) for known implementations
99

10-
## Current features
10+
## Features
1111

12-
- Extensible inteface and basic service class
13-
- Ability to disable delivery via config for testing purposes
14-
- Ability to force redirect messages for testing purposes
12+
### Current features
1513

14+
- [x] Service and configurable transports
15+
- [x] Ability to disable delivery via config for testing purposes
16+
- [x] Ability to force redirect messages for testing purposes
17+
- [x] Profiling via Sf2 Toolbar
18+
19+
### Planned features
1620

17-
## Installation
18-
19-
Installation is available via Composer
21+
- [ ] Bulk sending
22+
- [ ] Spooling and delayed sending
2023

21-
### composer.json
24+
## Installation
2225

26+
This bunde could be installed via Composer
2327

2428
```
25-
require: "scaytrase/symfony-sms-interface": "~0.2.0"
29+
composer require scaytrase/symfony-sms-delivery-bundle:~1.0
2630
```
2731

2832
### app/AppKernel.php
2933

3034
update your kernel bundle requirements as follows:
3135

32-
```
36+
```php
3337
$bundles = array(
34-
....
35-
new ScayTrase\Utils\SMSDeliveryBundle\SMSDeliveryBundle(),
36-
....
38+
//....
39+
new ScayTrase\SmsDeliveryBundle\SmsDeliveryBundle(),
40+
//....
3741
);
3842
```
3943

4044
## Configuration
4145

42-
Basic interface supports two optional parameters:
46+
Below is the configuration example and their default values
4347

44-
```
48+
```yaml
4549
sms_delivery:
46-
disable_delivery: true # disables actual delivery making every send return successful result. use profiler to get message details
50+
transport: sms_delivery.dummy_sender # @id of the transport service
51+
disable_delivery: false # disables actual delivery making every send return successful result. use profiler to get message details
4752
delivery_recipient: null # when not null - sends every message to the specified recipient, ignoring actual recipient of the message.
4853
```
4954
5055
## Usage
5156
52-
To use this interface you must create a message class implementing ``ShortMessageInterface`` and extend abstract MessageDeliveryService with your own delivery api service. As soon as you a ready to go, you must specify sender class via ``sms_delivery.class`` parameter.
57+
To use this interface you must create a message class implementing ``ShortMessageInterface`` and implement a transport that delivers your message to end point sms gateway. You can refer my [WebSMS](https://github.com/scaytrase/symfony-websms-bundle) gateway implementation as a reference.
58+
5359
54-
Refer [DummyMessageDeliveryService](src/ScayTrase/Utils/SMSDeliveryBundle/Service/DummySender/DummyMessageDeliveryService.php) as an example. It is also set as a default delivery service for quick start usage.
55-
56-
5760
### Example
5861
59-
```
62+
```php
6063
public function sendSmsAction(){
6164
$message = new YourMessage('5552368','Help!')
62-
$sender = $this->get('sms_delivery.sender');
63-
$result = $sender->send($message);
65+
$result = $this->get('sms_delivery.sender')->send($message);
6466
return new Response('Delivery '. $result ? 'successful' ; 'failed');
6567
}
66-
```
68+
```

build.xml

-152
This file was deleted.

composer.json

+7-10
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "scaytrase/symfony-sms-interface",
3-
"description": "Symfony2 Bundle with simple interface for sending sms",
4-
"minimum-stability": "dev",
5-
"license": "GPLv2",
2+
"name": "scaytrase/symfony-sms-delivery-bundle",
3+
"description": "Symfony2 Bundle with service for sending sms",
4+
"minimum-stability": "stable",
5+
"license": "GPL-2.0+",
66
"authors": [
77
{
88
"name": "Pavel Batanov",
@@ -14,15 +14,12 @@
1414
"symfony/symfony": "~2.4"
1515
},
1616
"require-dev": {
17-
"scaytrase/symfony-test-utils": "dev-master",
18-
"phpunit/phpunit": "~4.3",
19-
"behat/behat": "~3.0",
20-
"behat/mink-extension": "dev-master",
21-
"behat/symfony2-extension": "dev-master"
17+
"phpunit/phpunit": "~4.6@stable",
18+
"scaytrase/symfony-test-utils": "~1.0"
2219
},
2320
"autoload": {
2421
"psr-0": {
25-
"ScayTrase\\Utils\\SMSDeliveryBundle": "src/"
22+
"": "src/"
2623
}
2724
}
2825
}

phpdox.xml

-53
This file was deleted.

0 commit comments

Comments
 (0)