Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit 039d2e9

Browse files
committed
Remove erroneous re-instantiation of processor when setting adapter. Fixes ticket #2
1 parent 9dcd95b commit 039d2e9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

phpZenfolio.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -788,10 +788,10 @@ public function __construct( $url = NULL, $method = 'POST', $timeout = 30 )
788788
// can't use curl's followlocation in safe_mode with open_basedir, so fallback to socket for now
789789
if ( function_exists( 'curl_init' ) && ( $this->config['adapter'] == 'curl' )
790790
&& ! ( ini_get( 'safe_mode' ) || ini_get( 'open_basedir' ) ) ) {
791-
$this->processor = new PhpZenfolioCurlRequestProcessor();
791+
$this->processor = new PhpZenfolioCurlRequestProcessor;
792792
}
793793
else {
794-
$this->processor = new PhpZenfolioSocketRequestProcessor();
794+
$this->processor = new PhpZenfolioSocketRequestProcessor;
795795
}
796796
}
797797

@@ -905,7 +905,6 @@ public function setAdapter( $adapter )
905905
$adapter = strtolower( $adapter );
906906
if ( $adapter == 'curl' || $adapter == 'socket' ) {
907907
$this->config['adapter'] = $adapter;
908-
$this->processor = ( $adapter == 'curl' ) ? new PhpZenfolioCurlRequestProcessor() : new PhpZenfolioSocketRequestProcessor();
909908
}
910909
}
911910

0 commit comments

Comments
 (0)