Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .githooks/post-receive
Original file line number Diff line number Diff line change
@@ -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;
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/vendor/
15 changes: 15 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -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": "[email protected]"
}
]
}
9 changes: 6 additions & 3 deletions phplistHostedClient.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand All @@ -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));
}
Expand All @@ -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);
}
}
Expand Down