Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aweber #1

Open
wants to merge 143 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
2d69e74
Moved request headers to an argument of _sendRequest; Added JSON cont…
Jan 20, 2011
75752ef
added move resource functionality to entries, refactored test harness…
Mar 15, 2011
4654514
fixed basename
pianoman19372 Mar 15, 2011
a85ab51
added find operation for collections.
pianoman19372 Mar 15, 2011
07758c6
removed commented out code from tests
pianoman19372 Mar 15, 2011
fc2ae23
added support for custom_fields collection along with the ability to …
pianoman19372 Mar 29, 2011
a57f591
Added license
Mar 30, 2011
4944a89
Updated LICENSE
russpos Mar 30, 2011
40aac74
Merge branch 'master' of https://github.com/pianoman19372/AWeber-API-…
Apr 1, 2011
3810bc8
updated license agreement
Apr 1, 2011
5c7312d
fixed bug where find fails, in case of no matches
borisvaweber Apr 6, 2011
4ee10b1
fixed bug in the collection->find method
Apr 18, 2011
84ab65e
Added findSubscribers
borisvaweber Jun 8, 2011
d79b28b
Added getParentEntry
borisvaweber Jun 8, 2011
de5c456
Merge pull request #9 from borisvaweber/master
Aug 8, 2011
102be0d
added missing fixtures to fix broken tests.
Aug 25, 2011
66f30b2
modified the client library to raise exceptions when an api request r…
Aug 25, 2011
273a7f7
fixed typo in demo.php
Aug 25, 2011
c223319
updated tests to only mock the actual request and not the request pro…
Aug 29, 2011
da4984a
renamed APIException to AWeberAPIException
Aug 29, 2011
c97e169
added getActivity method to the Subscriber Entry.
Aug 29, 2011
67f6fe5
code review changes.
Aug 29, 2011
c5fb9d8
added automatic json serialization to GET and POST data when arrays a…
Sep 8, 2011
c6c59df
Added duplicate client library check
borisvaweber Sep 27, 2011
205f733
Revert "Added duplicate client library check"
borisvaweber Sep 27, 2011
f7d8b67
Revert "Revert "Added duplicate client library check""
borisvaweber Sep 27, 2011
f993488
Revert "Revert "Revert "Added duplicate client library check"""
borisvaweber Sep 27, 2011
b331a54
added duplicate client library detection with tests. updated changelog.
Oct 10, 2011
8c47cb2
modified AWeberCollection to use the self_link of the AWeberEntry res…
Dec 23, 2011
a86d75e
Add build directory and config files for build targets.
Apr 3, 2012
d9e44c7
Rename test files to conform to phpunit format.
Apr 3, 2012
2aed94a
Add mock_data dependency to mock_adapter.
Apr 3, 2012
b933992
Get AWeberAPITest passing.
Apr 3, 2012
27eba6b
Break out TestAWeberCollectionFind class from AWeberCollectionTest file.
Apr 3, 2012
d452c5c
Break out TestAWeberCreateEntry class into AWeberCreateEntryTest file.
Apr 3, 2012
9683679
Break out TestAWeberCollectionParentEntry into AWeberCollectionParent…
Apr 3, 2012
ac2d513
Convert OAuthApplication tests to phpunit.
Apr 3, 2012
be742a4
Fix phpunit.xml config.
Apr 3, 2012
12ea57e
Convert AWeberEntryTest to use PHPUnit.
Apr 5, 2012
6c7b54a
Add .md extension to README so it gets parsed by github.
Apr 7, 2012
b8a91fc
Remove files used to run tests using simpletest.
Apr 9, 2012
e4365bd
Fix phpunit logging configuration.
Apr 9, 2012
f721e3e
Add testing information to README.
Apr 9, 2012
f6b26ab
Address comment in pull request regarding installation of the tools n…
Apr 11, 2012
7c00b6b
More edits related to the comments.
Apr 12, 2012
3ad444f
Merge pull request #14 from aweber/jenkinize
pianoman19372 Apr 12, 2012
9eb6676
split: removed deprecated function
Apr 18, 2012
016d5d4
Enable phpdoc ant target.
Apr 19, 2012
89eb650
readme: bump version
Apr 19, 2012
24fd036
Merge branch 'enable-phpdoc'
Apr 19, 2012
dd58653
Fix broken build.xml file.
Apr 19, 2012
10037c5
Add missing commands needed to properly setup the user environment fo…
Apr 19, 2012
8c99b09
Merge branch 'enable-phpdoc'
Apr 20, 2012
da5f431
errors: make error messages more helpful
May 8, 2012
17ad619
readme: added more docs
May 8, 2012
f7412c3
utf8_encode: prevent notice when patching
Jul 5, 2012
c631751
Merge branch 'fix_utf8_encode_bug'
Jul 5, 2012
967ef2c
readme: Include TravisCI status link
Aug 14, 2012
d6db9bd
travisci: Add .yml file
Aug 14, 2012
fa7144d
Merge pull request #17 from ethanmcc/use-travis
Aug 15, 2012
732fd87
travis: Use consolidated notification email
Aug 15, 2012
4c4b0e6
Merge pull request #18 from ethanmcc/use-consolidated-email
Aug 15, 2012
bdec39b
fix update on fields with initially null values
Sep 19, 2012
595ce09
Merge branch 'update-on-null-attributes'
Sep 19, 2012
a7d3039
Travis CI image now uses latest master build.
chrismcguire Oct 8, 2012
47f0b9f
Move Subscriber: added last followup message number sent
Dec 7, 2012
7e79bee
Version Bump
Dec 10, 2012
0464c4c
Merge pull request #23 from aweber/move-subscriber-changes
pianoman19372 Dec 10, 2012
05efa07
oauth request: return 0 as response err
Dec 13, 2012
fb767b6
Merge pull request #24 from aweber/empty-data-request
pianoman19372 Dec 13, 2012
1d42a2a
license: happy new year
Jan 3, 2013
2522844
public api upgrade: support version 1.0.17
Jan 3, 2013
235f827
Merge pull request #26 from aweber/broadcast-stats
chrismcguire Jan 3, 2013
28a8ba9
oauth_adapter.php: add curl errors to exceptions.
Feb 7, 2013
4cd110a
Merge pull request #27 from aweber/unreachable-errors
chrismcguire Feb 11, 2013
bb6a987
find subscriber: fixed pagination error
Apr 24, 2013
f967835
Merge pull request #33 from aweber/find_subscriber_query
chrismcguire Apr 26, 2013
d90179f
omit query string adapter->request() url
aweberdang Jul 1, 2013
3973275
fixed undefined index issue with list
aweberdang Jul 2, 2013
3ca7f02
Merge pull request #34 from aweber/fix-pagination-bug
pianoman19372 Jul 9, 2013
c886658
ABSTRACT CURL LIBRARY INTO OBJECT FOR BETTER UNIT TESTING
bkorty Dec 23, 2013
03e9824
FIX SPACING PROBLEMS CAUSED BY MIX OF TABS AND SPACES
bkorty Dec 23, 2013
6401d02
Fix handling of reserved chars when generating oauth signatures
bkorty Dec 26, 2013
1b5aad6
Address Typos in Comments
bkorty Dec 26, 2013
29475b5
Add Unit Tests for Collection Create Method
bkorty Dec 31, 2013
1f249cd
Change custom field name in test
bkorty Dec 31, 2013
43f1513
Fix unsafe array operation.
bkorty Dec 31, 2013
1815ec8
Merge pull request #35 from aweber/fix-oauth-defect-plus-character
pianoman19372 Jan 21, 2014
a697b76
composer: Add composer.json
Feb 4, 2014
45c5e6b
Remove php requirement
Feb 4, 2014
6c2e3c0
Merge pull request #36 from aweber/add-composer-json
Feb 5, 2014
887e9ca
Bump version
Feb 5, 2014
c139021
Merge pull request #37 from aweber/bump-version
Feb 5, 2014
540b2c4
Revert "Merge pull request #36 from aweber/add-composer-json"
Feb 6, 2014
860ef8d
Revert "Merge pull request #37 from aweber/bump-version"
Feb 6, 2014
717864d
Merge pull request #38 from aweber/revert-composer-change
Feb 6, 2014
bfbd13e
oauth_app.py: remove double encoding
Feb 17, 2015
8795e3f
Merge pull request #42 from aweber/utf8-php
vrajmohan Feb 17, 2015
7e07987
bump to 1.1.13
Feb 17, 2015
5ebf6c3
Merge pull request #43 from aweber/bump
vrajmohan Feb 17, 2015
4089a99
Revert "Revert "Merge pull request #36 from aweber/add-composer-json""
Feb 19, 2015
4749c8d
Revert "Revert "Merge pull request #37 from aweber/bump-version""
Feb 19, 2015
509abd4
Merge pull request #44 from aweber/add-composer-packagist
vrajmohan Feb 19, 2015
5cd1fab
Added response for Broadcast entry
Nov 8, 2016
875e06c
Set broadcast type
nvllsvm Nov 8, 2016
6ad5d28
Broadcast entry tests
nvllsvm Nov 8, 2016
3c0fa61
Merge pull request #58 from DanPiston/master
srelsner Nov 9, 2016
bd5d014
Bump Version to v1.1.15
srelsner Nov 9, 2016
b055cdf
Merge pull request #59 from aweber/version-bump
nvllsvm Nov 9, 2016
f5e5904
Ignore development directories
brettsantore Nov 14, 2016
e29e844
add composer dependencies for ant
brettsantore Nov 14, 2016
c7481f1
update test documentation
brettsantore Nov 14, 2016
49cb3b6
Merge pull request #61 from brettsantore/add-composer-dependencies
nvllsvm Dec 16, 2016
c8e20f0
Merge branch 'master' into hotfix-ignore-dev-files
nvllsvm Dec 16, 2016
5319460
Merge pull request #60 from brettsantore/hotfix-ignore-dev-files
nvllsvm Dec 16, 2016
c155e7d
autoload with classmap
nvllsvm Dec 16, 2016
e81acfe
composer.lock in .gitignore
nvllsvm Dec 16, 2016
8a825ae
Merge pull request #62 from nvllsvm/master
srelsner Dec 16, 2016
4d41408
Modifying methods to allow for headers to be passed in the request. …
geoffp-aweber Aug 21, 2017
42a250d
Bumping version and updating README.md
geoffp-aweber Aug 21, 2017
f46031f
Updating README.md with correct dates and missing version
geoffp-aweber Aug 23, 2017
e82483b
Adding the proper phpdocs to the request method
geoffp-aweber Aug 24, 2017
a1d5d4b
Making interface match implementation.
geoffp-aweber Aug 24, 2017
325d125
Fixing broken unit test on the OAuth version number
geoffp-aweber Aug 24, 2017
8d85b61
Merge pull request #64 from geoffp-aweber/master
aremm Aug 24, 2017
ea48066
- Fixing issue with nested objects in the create call
geoffp-aweber Sep 2, 2017
9b28043
- Fixing improper headers being sent with GET requests
geoffp-aweber Sep 5, 2017
25ad1e8
- Adding check for custom fields to not encode as JSON, as request fa…
geoffp-aweber Sep 5, 2017
46d9b87
Updating README.md file
geoffp-aweber Sep 5, 2017
96156e2
Adding test to check the encoding of the request to create subscriber…
geoffp-aweber Sep 5, 2017
88c4423
Updating travis.yml file to update the composer dependencies
geoffp-aweber Sep 5, 2017
872f776
Reverting the upgrade to createMock method as it creates issue with t…
geoffp-aweber Sep 5, 2017
105d9b7
Updating travis configuration to get the PHP 5.3 build
geoffp-aweber Sep 5, 2017
9162391
Refactoring the code to perform the ContentType check once and make i…
geoffp-aweber Sep 8, 2017
614ddb7
Renaming the _type method to _getResourceType to be more descriptive.
geoffp-aweber Sep 12, 2017
7793efc
Putting the _getResourceType method back to the original name of _type
geoffp-aweber Sep 13, 2017
1c3f076
Simplifying the login in ensureContentType and adding the underscore …
geoffp-aweber Sep 13, 2017
0696879
Removing comment in change log
geoffp-aweber Sep 13, 2017
2ee27a5
Merge pull request #65 from geoffp-aweber/master
aremm Sep 13, 2017
fdf0a9d
add deprecation notice to readme
Aug 28, 2019
7be21ae
remove span
Aug 28, 2019
18b4ca9
change h2 to h3
Aug 28, 2019
fa8d00e
Merge pull request #69 from aweber/deprecation_notice
cknave Aug 28, 2019
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
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.DS_Store
Icon?
Thumbs.db
ehthumbs.db
*.bak
*.swm
*.swn
*.swo
*.swp
*~
/vendor
/.idea
cache.properties
build
!build/phpcs.xml
!build/phpmd.xml
!build/phpunit.xml
/composer.lock
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
language: php

sudo: required
php:
- 5.4

script: phpunit --configuration build/phpunit.xml

notifications:
email:
recipients:
- [email protected]
25 changes: 25 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Copyright (c) 2010-2013, AWeber Communications, Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of AWeber Communications, Inc. nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL AWEBER COMMUNICATIONS, INC. BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

7 changes: 0 additions & 7 deletions README

This file was deleted.

169 changes: 169 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
# This client library has been deprecated.
### This library will no longer be supported and does not support OAuth2.
### Please visit our [PHP Examples](https://github.com/aweber/public-api-examples/tree/master/php) as a reference.
----------------

AWeber API PHP Library [![Build Status](https://secure.travis-ci.org/aweber/AWeber-API-PHP-Library.png?branch=master)](http://travis-ci.org/aweber/AWeber-API-PHP-Library)
======================

PHP library for easily integrating with the AWeber API.


Basic Usage:
------------
Refer to demo.php to see a working example of how to authenticate an app and query the API.

For more complete documentation please refer to:
https://labs.aweber.com/docs/php-library-walkthrough


Handling Errors:
----------------
Sometimes errors happen and your application should handle them appropriately.
Whenever an API error occurs an AWeberAPIException will be raised with a detailed
error message and documentation link to explain what is wrong.

You should wrap any calls to the API in a try/except block.

Common Errors:
* Bad request (400 error)
* Your application is not authorized (401 error)
* Your application has been rate limited (403 error)
* Resource not found (404 error)
* API Temporarily unavailable (503 error)

Refer to https://labs.aweber.com/docs/troubleshooting for the complete list

Example Below:

```php
<?php

$consumerKey = '***';
$consumerSecret = '***';
$accessKey = '***';
$accessSecret = '***';

$aweber = new AWeberAPI($consumerKey, $consumerSecret);
$account = $aweber->getAccount($accessKey, $accessSecret);

try {
$resource = $account->loadFromUrl('/accounts/idontexist');
} catch (AWeberAPIException $exc) {
print "<li> $exc->type on $exc->url, refer to $exc->message for more info ...<br>";
}
?>
```


Accessing personally identifiable subscriber data
-------------------------------------------------
In order to view or update the email, name, misc_notes, and ip_address fields of a subscriber, your app must
specifically request access to subscriber data. Refer to our documentation at
https://labs.aweber.com/docs/permissions for more information on how to be able to access personally identifiable
subscriber information.


Changelog:
----------
2017-09-02: v1.1.18
* Fixing issues on the formatting of nested objects on 'application/json' requests
* Fixing issue with extra data being sent in header.
* Fixing issue to allow the creation of custom fields to be sent as form encoded.

2017-08-21: v1.1.17
* Fixing UTF-8 issues on creates

2016-12-16: v1.1.16
* Composer autoload with classmap

2016-11-09: v1.1.15
* Create AWeberEntry for Broadcast Entry endpoint

2015-02-17: v1.1.13
* Remove double encoding in requests to support utf-8

2014-02-05: v1.1.12
* Add composer file.

2013-04-25: v1.1.11
* Fixed a bug in the Collection Find Subscriber method where fetching the next page in the collection had not
included the previous search parameters.

* We've changed how we store collection data internally in AWeberCollection objects to
reduce the amount of memory required for large collections.

To lower memory usage, the AWeberCollection only stores a single page of entries
as you iterate thru the collection.

- foreach and sequential array indexing operations now require less memory.

- Random access of array elements by indexes will fetch pages of the collection
from the API on demand if the collection data is not already in memory.

2013-02-07: v1.1.10
* Updated APIUnreachableException to provide more diagnostic data.

2013-01-03: v1.1.9
* Updated client library to support 1.0.17 of the API. (Broadcast Statistics)

2012-12-13: v1.1.8
* Fixed a bug that resulted in Exceptions being raised when using collections when the collection size is zero.

2012-12-10: v1.1.7
* Added a parameter to the Move Subscriber method for last followup message number sent.
* to support version 1.0.16 of the API. See https://labs.aweber.com/docs/changelog

2012-09-19: v1.1.6
* Fixed a bug that prevented resource attributes from being saved when the initial value of the resource attribute was null.
* used array_key_exists instead of isset for evaluation of associative arrays. Requires PHP >= 4.0.7

2012-07-05: v1.1.5
* Fixed a bug were a utf8_encode notice was raised when updating subscriber custom field values.

2012-05-08: v1.1.4
Some API Developers have reported AWeberOAuthDataMissing exceptions when using the demo.php script.
This error message is not helpful as the typical cause for this exception is an invalid consumer key or secret.

The client library has been refactored to always raise an AWeberAPIException when a 40x/50x http status code
response is returned. This exception will clearly indicate the cause of the error for easier troubleshooting.
* Refactored makeRequest to always raise an AWeberAPIException when a 40x or 50x status is returned.
* Refactored makeRequest to indicate transient networking or firewall connectivity issues.
* Refactored mock adaptor makeRequest for testing to behave the same way as the real makeRequest does.

2012-04-18: v1.1.3

* Removed usage of deprecated split function.

2011-12-23: v1.1.2

* Fixed a bug in the AWeberCollection class to properly set the URL of entries found in collections.

2011-10-10: v1.1.1

* Raise an E_USER_WARNING instead of a fatal error if multiple instances of the client library are installed.

2011-08-29: v1.1.0

* Modified client library to raise an AWeberAPIException on any API errors (HTTP status >= 400)
* Refactored tests for better code coverage
* Refactored move and create methods to return the resource or raise an AWeberAPIException on error.
* Added getActivity method to a subscriber entry.



Running Tests:
--------------
Testing the PHP api library requires installation of a few utilities.

### Requirements ###
[Apache Ant](http://ant.apache.org/) is used to run the build targets in the build.xml file. Get the latest version.

Setup `/etc/php.ini` configuration file. Make sure `include_path` contains the correct directories.(`/usr/lib/php` on MacOS) Set `date.timezone` to your local timezone.

### Execute Tests ###
Once the above requirements are installed, make sure to run `composer install`, this will ensure all the test dependencies are installed.

Run the tests from the base directory using the command: `ant`.

Individual test can be run by specifying ant targets: `ant phpunit`, `ant phpcs`.
Loading