Skip to content

Commit

Permalink
Making MCAPI class instance a singleton
Browse files Browse the repository at this point in the history
  • Loading branch information
hugofirth committed Aug 21, 2013
1 parent 679a1a5 commit 272d7d9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace HugoFirth\Mailchimp;

class Mailchimp {
class MCAPI {
var $version = "1.3";
var $errorMessage;
var $errorCode;
Expand Down
8 changes: 3 additions & 5 deletions src/Hugofirth/Mailchimp/MailchimpServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<?php

namespace Hugofirth\Mailchimp;
<?php namespace Hugofirth\Mailchimp;

use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Config;
Expand Down Expand Up @@ -31,8 +29,8 @@ public function boot()
*/
public function register()
{
$this->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'));
});
}

Expand Down
7 changes: 3 additions & 4 deletions src/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
|
*/

Expand Down

0 comments on commit 272d7d9

Please # to comment.