From 272d7d96c450f0abba5f08788f19ae87c0fa5da3 Mon Sep 17 00:00:00 2001 From: Hugo Firth Date: Wed, 21 Aug 2013 16:01:52 +0100 Subject: [PATCH] Making MCAPI class instance a singleton --- src/Hugofirth/Mailchimp/{Mailchimp.php => MCAPI.php} | 2 +- src/Hugofirth/Mailchimp/MailchimpServiceProvider.php | 8 +++----- src/config/config.php | 7 +++---- 3 files changed, 7 insertions(+), 10 deletions(-) rename src/Hugofirth/Mailchimp/{Mailchimp.php => MCAPI.php} (99%) diff --git a/src/Hugofirth/Mailchimp/Mailchimp.php b/src/Hugofirth/Mailchimp/MCAPI.php similarity index 99% rename from src/Hugofirth/Mailchimp/Mailchimp.php rename to src/Hugofirth/Mailchimp/MCAPI.php index 3062c00..c933b69 100644 --- a/src/Hugofirth/Mailchimp/Mailchimp.php +++ b/src/Hugofirth/Mailchimp/MCAPI.php @@ -2,7 +2,7 @@ namespace HugoFirth\Mailchimp; -class Mailchimp { +class MCAPI { var $version = "1.3"; var $errorMessage; var $errorCode; diff --git a/src/Hugofirth/Mailchimp/MailchimpServiceProvider.php b/src/Hugofirth/Mailchimp/MailchimpServiceProvider.php index d0d18cd..5253e1c 100644 --- a/src/Hugofirth/Mailchimp/MailchimpServiceProvider.php +++ b/src/Hugofirth/Mailchimp/MailchimpServiceProvider.php @@ -1,6 +1,4 @@ -app['mailchimp'] = $this->app->share(function($app) { - return new Mailchimp(Config::get('mailchimp::apikey')); + $this->app->singleton('mailchimp', function() { + return new MCAPI(Config::get('mailchimp::apikey')); }); } diff --git a/src/config/config.php b/src/config/config.php index e9d55cb..7da9db5 100644 --- a/src/config/config.php +++ b/src/config/config.php @@ -8,10 +8,9 @@ | API Secret Key |-------------------------------------------------------------------------- | - | The api secret key is a 32 character string to be sent with each - | request to the api exposed by the routes.php file. Clients containing the - | key will be distributed so this is not considered to render the api secure - | however will remove some erroneous or dirty request + | The api secret key provided by Mailchimp. If you don't know your API key + | you can find out how to get it here: + | "http://kb.mailchimp.com/article/where-can-i-find-my-api-key/" | */