Skip to content

Commit

Permalink
Slight variation for fixing #93
Browse files Browse the repository at this point in the history
  • Loading branch information
subfission authored Feb 23, 2021
1 parent e31e25b commit 14bb015
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions src/Subfission/Cas/CasManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,7 @@ class CasManager {
public function __construct( array $config ) {
$this->parseConfig( $config );
if ( $this->config['cas_debug'] === true ) {
try {
phpCAS::setDebug();
} catch (ErrorException) {
// Fix for depreciation of setDebug
phpCAS::setLogger();
}
phpCAS::log( 'Loaded configuration:' . PHP_EOL
. serialize( $config ) );
} else {
phpCAS::setDebug( $this->config['cas_debug'] );
$this->enableDebugCas();
}

phpCAS::setVerbose( $this->config['cas_verbose_errors'] );
Expand Down Expand Up @@ -72,7 +63,22 @@ public function __construct( array $config ) {
. $this->config['cas_masquerade'] );
}
}


/**
* Enable debug mode for CAS
*
* @param $enabled
*/
protected function enableDebugCas() {
try {
phpCAS::setDebug();
} catch (\Exception $e) {
// Fix for depreciation of setDebug
phpCAS::setLogger();
}
phpCAS::log( 'Loaded configuration:' . PHP_EOL
. serialize( $config ) );
}
/**
* Configure CAS Client|Proxy
*
Expand Down

0 comments on commit 14bb015

Please sign in to comment.