Skip to content

Commit

Permalink
Merge pull request #193 from P0rnflake/improvement/hybrid_auth_debugging
Browse files Browse the repository at this point in the history
Improvement/hybrid auth debugging
  • Loading branch information
SocalNick committed Mar 10, 2015
2 parents c98345b + 5eb4619 commit c1288c7
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
22 changes: 22 additions & 0 deletions config/scn-social-auth.local.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,28 @@ $settings = array(
*/
//'instagram_client_secret' => 'your-client-secret',

/**
* To enable Logging, set debug_mode to true,
* then provide a path of a writable file on debug_file on your configuration file
*
* Default: false
* Accepted Values: boolean (true or false)
*
* @see http://hybridauth.sourceforge.net/userguide/Debugging_and_Logging.html
*/
// 'debug_mode' => false,

/**
* To enable Logging, set debug_mode to true,
* then provide a path of a writable file on debug_file on your configuration file or hash
*
* Default: "/tmp/hybridauth.log"
* Accepted Values: string
*
* @see http://hybridauth.sourceforge.net/userguide/Debugging_and_Logging.html
*/
// 'debug_file' => "/tmp/hybridauth.log",

/**
* End of ScnSocialAuth configuration
*/
Expand Down
43 changes: 43 additions & 0 deletions src/ScnSocialAuth/Options/ModuleOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,16 @@ class ModuleOptions extends AbstractOptions
*/
protected $enableSocialRegistration = true;

/**
* @var boolean
*/
protected $debugMode = false;

/**
* @var boolean
*/
protected $debugFile = "/tmp/hybridauth.log";

/**
* get an array of enabled providers
*
Expand Down Expand Up @@ -1299,4 +1309,37 @@ public function getEnableSocialRegistration()
{
return $this->enableSocialRegistration;
}

/**
* @return boolean
*/
public function getDebugMode()
{
return $this->debugMode;
}

/**
* @param boolean $debugMode
*/
public function setDebugMode($debugMode)
{
$this->debugMode = (boolean) $debugMode;
}

/**
* @return string
*/
public function getDebugFile()
{
return $this->debugFile;
}

/**
* @param string $debugFile
*/
public function setDebugFile($debugFile)
{
$this->debugFile = (string) $debugFile;
}

}
2 changes: 2 additions & 0 deletions src/ScnSocialAuth/Service/HybridAuthFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public function createService(ServiceLocatorInterface $services)
$hybridAuth = new Hybrid_Auth(
array(
'base_url' => $baseUrl,
"debug_mode" => $options->getDebugMode(),
"debug_file" => $options->getDebugFile(),
'providers' => array(
'Facebook' => array(
'enabled' => $options->getFacebookEnabled(),
Expand Down

0 comments on commit c1288c7

Please sign in to comment.