diff --git a/.githooks/post-receive b/.githooks/post-receive new file mode 100755 index 0000000..ecd7f94 --- /dev/null +++ b/.githooks/post-receive @@ -0,0 +1,12 @@ +#!/bin/sh +# +# Script to update dependencies after reception + +# Check if composer is available +if ! [ -x "$(command -v composer)" ]; then + echo 'Error: composer is not installed.' >&2 + exit 1 +fi + +# Update dependencies +composer update; diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57872d0 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/vendor/ diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..3955920 --- /dev/null +++ b/composer.json @@ -0,0 +1,15 @@ +{ + "name": "phplist/phplist-soap-api", + "description": "A simple SOAP API for phpList Hosted", + "type": "library", + "require": { + "econea/nusoap": "v0.9.6" + }, + "license": "AGPL3", + "authors": [ + { + "name": "Sam Tuke", + "email": "mail@samtuke.com" + } + ] +} diff --git a/phplistHostedClient.class.php b/phplistHostedClient.class.php index 8d95331..ed687a5 100644 --- a/phplistHostedClient.class.php +++ b/phplistHostedClient.class.php @@ -8,7 +8,6 @@ * version 0.1 - 2011-07-20, Michiel Dethmers phpList Ltd * * requires nuSoap: http://sourceforge.net/projects/nusoap/ - * unpack nuSoap in ./lib/ * * for more info https://www.phplist.com/contactus * @@ -19,11 +18,15 @@ class phpListHostedSoapClient { private $soap_url = ''; private $soap; - function phpListHostedSoapClient($soap_url) { + function __construct($soap_url) { $this->soap_url = $soap_url; $this->xCreateSoap(); } + function setCredentials($username, $password, $authtype = 'basic', $digestRequest = array(), $certRequest = array()) { + $this->soap->setCredentials($username, $password, $authtype, $digestRequest, $certRequest); + } + function getMessageLittleStats($message_id) { return $this->soap->call('phpListHosted.getMessageLittleStats', array('message_id' => $message_id)); } @@ -50,7 +53,7 @@ function HelloWorld() { function xCreateSoap() { if (is_null($this->soap)) { - require(dirname(__FILE__)."/lib/nusoap.php"); + require(dirname(__FILE__)."/vendor/econea/nusoap/src/nusoap.php"); $this->soap = new nusoap_client($this->soap_url); } }