Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/karser/smsbundle
https://github.com/karser/smsbundle
Last synced: 9 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/karser/smsbundle
- Owner: karser
- Created: 2013-05-21T06:00:57.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-02-08T12:37:10.000Z (almost 11 years ago)
- Last Synced: 2024-10-11T13:12:45.931Z (about 1 month ago)
- Language: PHP
- Size: 195 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Getting started with SMSBundle
=============## Prerequisites
This version of the bundle requires Symfony 2.1+ and Doctrine ORM 2.2+
## Installation
### Step 1: Download KarserSMSBundle using composer
Add KarserSMSBundle in your composer.json:
```js
{
"require": {
"karser/sms-bundle": "dev-master",
}
}
```Now tell composer to download the bundle by running the command:
``` bash
$ php ./composer.phar update
```Composer will install the bundle to your project's `vendor/karser` directory.
### Step 2: Enable the bundle
Enable the bundle in the kernel:
``` php
createdAt = new \DateTime();
}/**
* @param string $sessionId
*/
public function setSessionId($sessionId)
{
$this->sessionId = $sessionId;
}/**
* @return string
*/
public function getSessionId()
{
return $this->sessionId;
}/**
* @param int $userId
*/
public function setUserId($userId)
{
$this->userId = $userId;
}/**
* @return int
*/
public function getUserId()
{
return $this->userId;
}/**
* @param string $ipAddress
*/
public function setIpAddress($ipAddress)
{
$this->ipAddress = $ipAddress;
}/**
* @return string
*/
public function getIpAddress()
{
return $this->ipAddress;
}/**
* Set createdAt
*
* @param \DateTime $createdAt
* @return SmsTask
*/
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;return $this;
}/**
* Get createdAt
*
* @return \DateTime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
}
```### Step 5: Available backends
- [MainSMS](http://mainsms.ru/): [KarserMainSMSBundle](https://github.com/karser/MainSMSBundle)
- [SMSVesti](http://smsvesti.ru/): [KarserSMSVestiBundle](https://github.com/karser/SMSVestiBundle)### Usage Steps
``` php
$task = new \Your\Module\Entity\SmsTask();
$task->setPhoneNumber('+799999999999');
$task->setMessage('ni hao');
$task->setSender('your_friend');$handler = $container->get('karser.sms.manager')->getDefaultHandler();
$msg_id = $handler->send($task);
$status = $handler->checkStatus($task->getMessageId());
if ($status === SMSTaskInterface::STATUS_PROCESSING) {
//is sent
}
```