From bd0c41726603e733446d8ff5e84295745eca2a2b Mon Sep 17 00:00:00 2001 From: Ekta Date: Fri, 18 Mar 2016 14:23:15 +0530 Subject: [PATCH] API-20: Bundle compatible with both Symfony 2 & 3 --- README.md | 6 +++--- Wrapper/Mailin.php | 6 +++--- composer.json | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 100b23a..d22c7a2 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -## SendinBlue Symfony3 Bundle +## SendinBlue Symfony Bundle -This is [SendinBlue](https://www.sendinblue.com) provided API V2 Symfony3 Bundle. It implements the various exposed APIs that you can read more about on https://apidocs.sendinblue.com. +This is [SendinBlue](https://www.sendinblue.com) provided API V2 Symfony Bundle. It implements the various exposed APIs that you can read more about on https://apidocs.sendinblue.com. ## Prerequisites -This version of the bundle requires Symfony 3.x. +This version of the bundle requires Symfony 2.x OR 3.x. ## Installation diff --git a/Wrapper/Mailin.php b/Wrapper/Mailin.php index e76619a..2d99fae 100644 --- a/Wrapper/Mailin.php +++ b/Wrapper/Mailin.php @@ -2,7 +2,7 @@ namespace SendinBlue\SendinBlueApiBundle\Wrapper; -use Symfony\Component\Config\Definition\Exception\Exception; +use RuntimeException; /** * SendinBlue REST client * @@ -22,7 +22,7 @@ public function __construct($api_key) { if(!function_exists('curl_init')) { - throw new Exception('Mailin requires CURL module'); + throw new RuntimeException('Mailin requires CURL module'); } $this->base_url = "https://api.sendinblue.com/v2.0"; $this->api_key = $api_key; @@ -51,7 +51,7 @@ private function do_request($resource,$method,$input) $info = curl_getinfo($ch); if(curl_errno($ch)) { - echo 'Curl error: ' . curl_error($ch). '\n'; + throw new RuntimeException('Curl error: ' . curl_error($ch). '\n'); } curl_close($ch); return json_decode($data,true); diff --git a/composer.json b/composer.json index 0679ac5..3c4fb93 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "sendinblue/sendinblue-api-bundle", "type": "symfony-bundle", - "description": "Official SendinBlue provided API V2 Symfony3 Bundle", + "description": "Official SendinBlue provided API V2 Symfony Bundle", "keywords": ["Sendinblue", "api", "Bundle"], "homepage": "https://github.com/mailin-api/sendinblue-api-bundle", "license": "MIT", @@ -13,8 +13,8 @@ } ], "require": { - "php": ">=5.5", - "symfony/framework-bundle": "3.*" + "php": ">=5.3", + "symfony/framework-bundle": "2.*|3.*" }, "autoload": { "psr-4": { "SendinBlue\\SendinBlueApiBundle\\": "" }