Skip to content

Commit e24db9b

Browse files
committed
Checks OpauthStrategy exists before require()
1 parent 52c3bb4 commit e24db9b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/Opauth/Opauth.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ class Opauth{
4141
* @param boolean $run Whether Opauth should auto run after initialization.
4242
*/
4343
public function __construct($config = array(), $run = true){
44-
require $this->env['lib_dir'].'OpauthStrategy.php';
45-
4644
/**
4745
* Configurable settings
4846
*/
@@ -73,6 +71,10 @@ public function __construct($config = array(), $run = true){
7371
'strategy_dir' => dirname(__FILE__).'/Strategy/'
7472
), $this->config);
7573

74+
if (!class_exists('OpauthStrategy')){
75+
require $this->env['lib_dir'].'OpauthStrategy.php';
76+
}
77+
7678
foreach ($this->env as $key => $value){
7779
$this->env[$key] = OpauthStrategy::envReplace($value, $this->env);
7880
}

0 commit comments

Comments
 (0)