Skip to content

Commit b3e6c66

Browse files
committed
Removed old storage
1 parent b1e26e4 commit b3e6c66

File tree

2 files changed

+6
-33
lines changed

2 files changed

+6
-33
lines changed

src/Artdarek/OAuth/OAuth.php

+2-24
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ class OAuth
2222
*/
2323
private $_serviceFactory;
2424

25-
/**
26-
* Storege name from config
27-
* @var string
28-
*/
29-
private $_storage_name = 'Session';
30-
3125
/**
3226
* Client ID from config
3327
* @var string
@@ -70,34 +64,18 @@ public function setConfig( $service )
7064
// if config/oauth-4-laravel.php exists use this one
7165
if ( Config::get('oauth-4-laravel.consumers') != null ) {
7266

73-
$this->_storage_name = Config::get('oauth-4-laravel.storage', 'Session');
7467
$this->_client_id = Config::get("oauth-4-laravel.consumers.$service.client_id");
7568
$this->_client_secret = Config::get("oauth-4-laravel.consumers.$service.client_secret");
7669
$this->_scope = Config::get("oauth-4-laravel.consumers.$service.scope", array() );
7770

78-
// esle try to find config in packages configs
71+
// else try to find config in packages configs
7972
} else {
80-
$this->_storage_name = Config::get('oauth-4-laravel::storage', 'Session');
8173
$this->_client_id = Config::get("oauth-4-laravel::consumers.$service.client_id");
8274
$this->_client_secret = Config::get("oauth-4-laravel::consumers.$service.client_secret");
8375
$this->_scope = Config::get("oauth-4-laravel::consumers.$service.scope", array() );
8476
}
8577
}
8678

87-
/**
88-
* Create storage instance
89-
*
90-
* @param string $storageName
91-
* @return OAuth\Common\\Storage
92-
*/
93-
public function createStorageInstance($storageName)
94-
{
95-
$storageClass = "\\OAuth\\Common\\Storage\\$storageName";
96-
$storage = new $storageClass();
97-
98-
return $storage;
99-
}
100-
10179
/**
10280
* Set the http client object
10381
*
@@ -122,7 +100,7 @@ public function consumer( $service, $url = null, $scope = null )
122100
$this->setConfig( $service );
123101

124102
// get storage object
125-
$storage = $this->createStorageInstance( $this->_storage_name );
103+
$storage =
126104

127105
// create credentials object
128106
$credentials = new Credentials(

src/config/config.php

+4-9
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
1-
<?php
1+
<?php
2+
3+
return array(
24

3-
return array(
4-
55
/*
66
|--------------------------------------------------------------------------
77
| oAuth Config
88
|--------------------------------------------------------------------------
99
*/
1010

11-
/**
12-
* Storage
13-
*/
14-
'storage' => 'Session',
15-
1611
/**
1712
* Consumers
1813
*/
@@ -25,7 +20,7 @@
2520
'client_id' => '',
2621
'client_secret' => '',
2722
'scope' => array(),
28-
),
23+
),
2924

3025
)
3126

0 commit comments

Comments
 (0)