Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
krzaczek committed Sep 26, 2016
1 parent 5f3085c commit 5ae8dc0
Show file tree
Hide file tree
Showing 3 changed files with 7,394 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/PocztaPolska/ElektronicznyNadawca.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
*/
class ElektronicznyNadawca extends \SoapClient
{

const WSDL_FILE = "https://e-nadawca.poczta-polska.pl/websrv/en.wsdl";
const WSDL_FILE = 'wsdl/en.wsdl';
const WSDL_TEST_FILE = 'wsdl/test/en.wsdl';
private $classmap = array(
'addShipment' => 'PocztaPolska\addShipment',
'addShipmentResponse' => 'PocztaPolska\addShipmentResponse',
Expand Down Expand Up @@ -301,7 +301,16 @@ public function __construct($wsdl = null, $options = array())
if (isset($options['headers'])) {
$this->__setSoapHeaders($options['headers']);
}
parent::__construct($wsdl ?: self::WSDL_FILE, $options);

if (!$wsdl) {
$wsdl = realpath(__DIR__ . '/../../' . self::WSDL_FILE);
}

if (!file_exists($wsdl)) {
$wsdl = realpath(__DIR__ . '/../../' . $wsdl);
}

parent::__construct($wsdl, $options);
}

/**
Expand Down
Loading

0 comments on commit 5ae8dc0

Please sign in to comment.