├── LICENSE ├── README.md ├── doc ├── .htaccess ├── classes │ └── phpListRESTApiClient.html ├── css │ ├── bootstrap-combined.no-icons.min.css │ ├── font-awesome.min.css │ ├── jquery.iviewer.css │ ├── phpdocumentor-clean-icons │ │ ├── Read Me.txt │ │ ├── fonts │ │ │ ├── phpdocumentor-clean-icons.dev.svg │ │ │ ├── phpdocumentor-clean-icons.eot │ │ │ ├── phpdocumentor-clean-icons.svg │ │ │ ├── phpdocumentor-clean-icons.ttf │ │ │ └── phpdocumentor-clean-icons.woff │ │ ├── lte-ie7.js │ │ └── style.css │ ├── prism.css │ └── template.css ├── files │ ├── example.html │ ├── example.php.txt │ ├── phpList-api-client.html │ ├── phpList-api-client.php.txt │ ├── phpListRESTApiClient.html │ └── phpListRESTApiClient.php.txt ├── font │ ├── FontAwesome.otf │ ├── fontawesome-webfont.eot │ ├── fontawesome-webfont.svg │ ├── fontawesome-webfont.ttf │ └── fontawesome-webfont.woff ├── graphs │ └── class.html ├── images │ ├── apple-touch-icon-114x114.png │ ├── apple-touch-icon-72x72.png │ ├── apple-touch-icon.png │ ├── custom-icons.svg │ ├── favicon.ico │ ├── hierarchy-item.png │ ├── icon-class-13x13.png │ ├── icon-class.svg │ ├── icon-interface-13x13.png │ ├── icon-interface.svg │ ├── icon-trait-13x13.png │ ├── icon-trait.svg │ └── iviewer │ │ ├── grab.cur │ │ ├── hand.cur │ │ ├── iviewer.rotate_left.png │ │ ├── iviewer.rotate_right.png │ │ ├── iviewer.zoom_fit.png │ │ ├── iviewer.zoom_in.png │ │ ├── iviewer.zoom_out.png │ │ └── iviewer.zoom_zero.png ├── index.html ├── js │ ├── bootstrap.min.js │ ├── html5.js │ ├── jquery-1.11.0.min.js │ ├── jquery.dotdotdot-1.5.9.js │ ├── jquery.dotdotdot-1.5.9.min.js │ ├── jquery.iviewer.js │ ├── jquery.iviewer.min.js │ ├── jquery.mousewheel.js │ ├── jquery.smooth-scroll.js │ ├── prism.min.js │ └── ui │ │ └── 1.10.4 │ │ └── jquery-ui.min.js ├── namespaces │ └── default.html ├── phpdoc-cache-07 │ └── phpdoc-cache-file_1d19d16db26de73856794b92fe2cd5df.dat ├── phpdoc-cache-2b │ └── phpdoc-cache-file_77ccf734f65f7078f22cd565b6e46892.dat ├── phpdoc-cache-2e │ └── phpdoc-cache-settings.dat └── reports │ ├── deprecated.html │ ├── errors.html │ └── markers.html ├── example.php └── phpListRESTApiClient.php /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Michiel Dethmers, phpList Ltd 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # phplist-restapi-client 2 | 3 | Example client code for talking to the phpList RestAPI plugin 4 | 5 | License: MIT 6 | 7 | Updates and contributions welcome 8 | 9 | Current example is in PHP. Examples in other languages will follow. If you have implemented this in other languages please contribute. 10 | -------------------------------------------------------------------------------- /doc/.htaccess: -------------------------------------------------------------------------------- 1 | # Fixes a vulnerability in CentOS: http://stackoverflow.com/questions/20533279/prevent-php-from-parsing-non-php-files-such-as-somefile-php-txt 2 | 3 | RemoveHandler .php 4 | ForceType text/plain 5 | -------------------------------------------------------------------------------- /doc/css/jquery.iviewer.css: -------------------------------------------------------------------------------- 1 | .viewer { 2 | -ms-touch-action: none; 3 | } 4 | 5 | .iviewer_common { 6 | position:absolute; 7 | bottom:10px; 8 | border: 1px solid #000; 9 | height: 28px; 10 | z-index: 5000; 11 | } 12 | 13 | .iviewer_cursor { 14 | cursor: url(../images/iviewer/hand.cur) 6 8, pointer; 15 | } 16 | 17 | .iviewer_drag_cursor { 18 | cursor: url(../images/iviewer/grab.cur) 6 8, pointer; 19 | } 20 | 21 | .iviewer_button { 22 | width: 28px; 23 | cursor: pointer; 24 | background-position: center center; 25 | background-repeat: no-repeat; 26 | } 27 | 28 | .iviewer_zoom_in { 29 | left: 20px; 30 | background: url(../images/iviewer/iviewer.zoom_in.png); 31 | } 32 | 33 | .iviewer_zoom_out { 34 | left: 55px; 35 | background: url(../images/iviewer/iviewer.zoom_out.png); 36 | } 37 | 38 | .iviewer_zoom_zero { 39 | left: 90px; 40 | background: url(../images/iviewer/iviewer.zoom_zero.png); 41 | } 42 | 43 | .iviewer_zoom_fit { 44 | left: 125px; 45 | background: url(../images/iviewer/iviewer.zoom_fit.png); 46 | } 47 | 48 | .iviewer_zoom_status { 49 | left: 160px; 50 | font: 1em/28px Sans; 51 | color: #000; 52 | background-color: #fff; 53 | text-align: center; 54 | width: 60px; 55 | } 56 | 57 | .iviewer_rotate_left { 58 | left: 227px; 59 | background: #fff url(../images/iviewer/iviewer.rotate_left.png) center center no-repeat; 60 | } 61 | 62 | .iviewer_rotate_right { 63 | left: 262px; 64 | background: #fff url(../images/iviewer/iviewer.rotate_right.png) center center no-repeat; 65 | } 66 | -------------------------------------------------------------------------------- /doc/css/phpdocumentor-clean-icons/Read Me.txt: -------------------------------------------------------------------------------- 1 | To modify your generated font, use the *dev.svg* file, located in the *fonts* folder in this package. You can import this dev.svg file to the IcoMoon app. All the tags (class names) and the Unicode points of your glyphs are saved in this file. 2 | 3 | See the documentation for more info on how to use this package: http://icomoon.io/#docs/font-face -------------------------------------------------------------------------------- /doc/css/phpdocumentor-clean-icons/fonts/phpdocumentor-clean-icons.dev.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This is a custom SVG font generated by IcoMoon. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /doc/css/phpdocumentor-clean-icons/fonts/phpdocumentor-clean-icons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michield/phplist-restapi-client/44ddfc79738387db063f5956182884368251ac4a/doc/css/phpdocumentor-clean-icons/fonts/phpdocumentor-clean-icons.eot -------------------------------------------------------------------------------- /doc/css/phpdocumentor-clean-icons/fonts/phpdocumentor-clean-icons.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This is a custom SVG font generated by IcoMoon. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /doc/css/phpdocumentor-clean-icons/fonts/phpdocumentor-clean-icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michield/phplist-restapi-client/44ddfc79738387db063f5956182884368251ac4a/doc/css/phpdocumentor-clean-icons/fonts/phpdocumentor-clean-icons.ttf -------------------------------------------------------------------------------- /doc/css/phpdocumentor-clean-icons/fonts/phpdocumentor-clean-icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michield/phplist-restapi-client/44ddfc79738387db063f5956182884368251ac4a/doc/css/phpdocumentor-clean-icons/fonts/phpdocumentor-clean-icons.woff -------------------------------------------------------------------------------- /doc/css/phpdocumentor-clean-icons/lte-ie7.js: -------------------------------------------------------------------------------- 1 | /* Load this script using conditional IE comments if you need to support IE 7 and IE 6. */ 2 | 3 | window.onload = function() { 4 | function addIcon(el, entity) { 5 | var html = el.innerHTML; 6 | el.innerHTML = '' + entity + '' + html; 7 | } 8 | var icons = { 9 | 'icon-trait' : '', 10 | 'icon-interface' : '', 11 | 'icon-class' : '' 12 | }, 13 | els = document.getElementsByTagName('*'), 14 | i, attr, html, c, el; 15 | for (i = 0; ; i += 1) { 16 | el = els[i]; 17 | if(!el) { 18 | break; 19 | } 20 | attr = el.getAttribute('data-icon'); 21 | if (attr) { 22 | addIcon(el, attr); 23 | } 24 | c = el.className; 25 | c = c.match(/icon-[^\s'"]+/); 26 | if (c && icons[c[0]]) { 27 | addIcon(el, icons[c[0]]); 28 | } 29 | } 30 | }; -------------------------------------------------------------------------------- /doc/css/phpdocumentor-clean-icons/style.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'phpdocumentor-clean-icons'; 3 | src:url('fonts/phpdocumentor-clean-icons.eot'); 4 | src:url('fonts/phpdocumentor-clean-icons.eot?#iefix') format('embedded-opentype'), 5 | url('fonts/phpdocumentor-clean-icons.woff') format('woff'), 6 | url('fonts/phpdocumentor-clean-icons.ttf') format('truetype'), 7 | url('fonts/phpdocumentor-clean-icons.svg#phpdocumentor-clean-icons') format('svg'); 8 | font-weight: normal; 9 | font-style: normal; 10 | } 11 | 12 | /* Use the following CSS code if you want to use data attributes for inserting your icons */ 13 | [data-icon]:before { 14 | font-family: 'phpdocumentor-clean-icons'; 15 | content: attr(data-icon); 16 | speak: none; 17 | font-weight: normal; 18 | font-variant: normal; 19 | text-transform: none; 20 | line-height: 1; 21 | -webkit-font-smoothing: antialiased; 22 | } 23 | 24 | /* Use the following CSS code if you want to have a class per icon */ 25 | /* 26 | Instead of a list of all class selectors, 27 | you can use the generic selector below, but it's slower: 28 | [class*="icon-"] { 29 | */ 30 | .icon-trait, .icon-interface, .icon-class { 31 | font-family: 'phpdocumentor-clean-icons'; 32 | speak: none; 33 | font-style: normal; 34 | font-weight: normal; 35 | font-variant: normal; 36 | text-transform: none; 37 | line-height: 1; 38 | -webkit-font-smoothing: antialiased; 39 | } 40 | .icon-trait:before { 41 | content: "\e000"; 42 | } 43 | .icon-interface:before { 44 | content: "\e001"; 45 | } 46 | .icon-class:before { 47 | content: "\e002"; 48 | } 49 | -------------------------------------------------------------------------------- /doc/css/prism.css: -------------------------------------------------------------------------------- 1 | /** 2 | * prism.js default theme for JavaScript, CSS and HTML 3 | * Based on dabblet (http://dabblet.com) 4 | * @author Lea Verou 5 | */ 6 | 7 | code[class*="language-"], 8 | pre[class*="language-"] { 9 | color: black; 10 | text-shadow: 0 1px white; 11 | font-family: Consolas, Monaco, 'Andale Mono', monospace; 12 | direction: ltr; 13 | text-align: left; 14 | white-space: pre; 15 | word-spacing: normal; 16 | 17 | -moz-tab-size: 4; 18 | -o-tab-size: 4; 19 | tab-size: 4; 20 | 21 | -webkit-hyphens: none; 22 | -moz-hyphens: none; 23 | -ms-hyphens: none; 24 | hyphens: none; 25 | } 26 | 27 | ::-moz-selection { 28 | text-shadow: none; 29 | background: #b3d4fc; 30 | } 31 | 32 | ::selection { 33 | text-shadow: none; 34 | background: #b3d4fc; 35 | } 36 | 37 | @media print { 38 | code[class*="language-"], 39 | pre[class*="language-"] { 40 | text-shadow: none; 41 | } 42 | } 43 | 44 | /* Code blocks */ 45 | pre[class*="language-"] { 46 | padding: 1em; 47 | margin: .5em 0; 48 | overflow: auto; 49 | } 50 | 51 | :not(pre) > code[class*="language-"], 52 | pre[class*="language-"] { 53 | background: #f5f2f0; 54 | } 55 | 56 | /* Inline code */ 57 | :not(pre) > code[class*="language-"] { 58 | padding: .1em; 59 | border-radius: .3em; 60 | } 61 | 62 | .token.comment, 63 | .token.prolog, 64 | .token.doctype, 65 | .token.cdata { 66 | color: slategray; 67 | } 68 | 69 | .token.punctuation { 70 | color: #999; 71 | } 72 | 73 | .namespace { 74 | opacity: .7; 75 | } 76 | 77 | .token.property, 78 | .token.tag, 79 | .token.boolean, 80 | .token.number { 81 | color: #905; 82 | } 83 | 84 | .token.selector, 85 | .token.attr-name, 86 | .token.string { 87 | color: #690; 88 | } 89 | 90 | .token.operator, 91 | .token.entity, 92 | .token.url, 93 | .language-css .token.string, 94 | .style .token.string { 95 | color: #a67f59; 96 | background: hsla(0,0%,100%,.5); 97 | } 98 | 99 | .token.atrule, 100 | .token.attr-value, 101 | .token.keyword { 102 | color: #07a; 103 | } 104 | 105 | 106 | .token.regex, 107 | .token.important { 108 | color: #e90; 109 | } 110 | 111 | .token.important { 112 | font-weight: bold; 113 | } 114 | 115 | .token.entity { 116 | cursor: help; 117 | } 118 | pre[data-line] { 119 | position: relative; 120 | padding: 1em 0 1em 3em; 121 | } 122 | 123 | .line-highlight { 124 | position: absolute; 125 | left: 0; 126 | right: 0; 127 | padding: inherit 0; 128 | margin-top: 1em; /* Same as .prism’s padding-top */ 129 | 130 | background: hsla(24, 20%, 50%,.08); 131 | background: -moz-linear-gradient(left, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0)); 132 | background: -webkit-linear-gradient(left, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0)); 133 | background: -o-linear-gradient(left, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0)); 134 | background: linear-gradient(left, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0)); 135 | 136 | pointer-events: none; 137 | 138 | line-height: inherit; 139 | white-space: pre; 140 | } 141 | 142 | .line-highlight:before, 143 | .line-highlight[data-end]:after { 144 | content: attr(data-start); 145 | position: absolute; 146 | top: .4em; 147 | left: .6em; 148 | min-width: 1em; 149 | padding: 0 .5em; 150 | background-color: hsla(24, 20%, 50%,.4); 151 | color: hsl(24, 20%, 95%); 152 | font: bold 65%/1.5 sans-serif; 153 | text-align: center; 154 | vertical-align: .3em; 155 | border-radius: 999px; 156 | text-shadow: none; 157 | box-shadow: 0 1px white; 158 | } 159 | 160 | .line-highlight[data-end]:after { 161 | content: attr(data-end); 162 | top: auto; 163 | bottom: .4em; 164 | } 165 | pre.line-numbers { 166 | position: relative; 167 | padding-left: 3.8em; 168 | counter-reset: linenumber; 169 | } 170 | 171 | pre.line-numbers > code { 172 | position: relative; 173 | } 174 | 175 | .line-numbers .line-numbers-rows { 176 | position: absolute; 177 | pointer-events: none; 178 | top: 0; 179 | font-size: 100%; 180 | left: -3.8em; 181 | width: 3em; /* works for line-numbers below 1000 lines */ 182 | letter-spacing: -1px; 183 | border-right: 1px solid #999; 184 | 185 | -webkit-user-select: none; 186 | -moz-user-select: none; 187 | -ms-user-select: none; 188 | user-select: none; 189 | 190 | } 191 | 192 | .line-numbers-rows > span { 193 | pointer-events: none; 194 | display: block; 195 | counter-increment: linenumber; 196 | } 197 | 198 | .line-numbers-rows > span:before { 199 | content: counter(linenumber); 200 | color: #999; 201 | display: block; 202 | padding-right: 0.8em; 203 | text-align: right; 204 | } 205 | -------------------------------------------------------------------------------- /doc/css/template.css: -------------------------------------------------------------------------------- 1 | @import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro); 2 | @import url('phpdocumentor-clean-icons/style.css'); 3 | 4 | body { 5 | padding-top: 40px; 6 | background-color: #333333; 7 | } 8 | 9 | a { 10 | color: #6495ed; 11 | } 12 | a.anchor { 13 | height: 40px; 14 | margin-top: -40px; 15 | display: block; 16 | } 17 | 18 | h1, h2, h3, h4, h5, h6, .brand { 19 | font-family: 'Source Sans Pro', sans-serif; 20 | font-weight: normal; 21 | letter-spacing: 0.05em; 22 | } 23 | 24 | h2, h3, .detailsbar h1 { 25 | overflow: hidden; 26 | white-space: nowrap; 27 | margin: 30px 0 20px 0; 28 | } 29 | 30 | h2:after, h3:after, .detailsbar h1:after { 31 | content: ''; 32 | display: inline-block; 33 | vertical-align: middle; 34 | width: 100%; 35 | height: 2px; 36 | margin-left: 1em; 37 | background: silver; 38 | } 39 | 40 | h3 { 41 | margin: 10px 0 20px 0; 42 | } 43 | 44 | h4 { 45 | margin: 20px 0 10px 0; 46 | color: gray; 47 | font-size: 18.5px; 48 | } 49 | 50 | h3.public, h3.protected, h3.private { 51 | padding-left: 10px; 52 | text-overflow: ellipsis; 53 | } 54 | 55 | .table tr:first-of-type th, .table tr:first-of-type td { 56 | border-top: none; 57 | } 58 | .detailsbar { 59 | color: #eeeeee; 60 | background-color: #333333; 61 | font-size: 0.9em; 62 | overflow: hidden; 63 | border-left: 2px solid gray; 64 | } 65 | 66 | .detailsbar h1 { 67 | font-size: 1.5em; 68 | margin-bottom: 20px; 69 | margin-top: 0; 70 | } 71 | 72 | .detailsbar h2 { 73 | font-size: 1.2em; 74 | margin: 0; 75 | padding: 0; 76 | } 77 | 78 | .detailsbar h1:after { 79 | background: gray; 80 | } 81 | .detailsbar h2:after, .detailsbar h3:after { 82 | background: transparent; 83 | } 84 | 85 | .detailsbar dt { 86 | font-variant: small-caps; 87 | text-transform: lowercase; 88 | font-size: 1.1em; 89 | letter-spacing: 0.1em; 90 | color: silver; 91 | } 92 | 93 | .hierarchy div:nth-of-type(2) { margin-left: 11px; } 94 | .hierarchy div:nth-of-type(3) { margin-left: 22px; } 95 | .hierarchy div:nth-of-type(4) { margin-left: 33px; } 96 | .hierarchy div:nth-of-type(5) { margin-left: 44px; } 97 | .hierarchy div:nth-of-type(6) { margin-left: 55px; } 98 | .hierarchy div:nth-of-type(7) { margin-left: 66px; } 99 | .hierarchy div:nth-of-type(8) { margin-left: 77px; } 100 | .hierarchy div:nth-of-type(9) { margin-left: 88px; } 101 | .hierarchy div:before { 102 | content: "\f0da"; 103 | font-family: FontAwesome; 104 | margin-right: 5px; 105 | } 106 | 107 | .row-fluid { 108 | background-color: white; 109 | overflow: hidden; 110 | } 111 | 112 | footer.row-fluid, footer.row-fluid * { 113 | background-color: #333333; 114 | color: white; 115 | } 116 | 117 | footer.row-fluid { 118 | border-top: 2px dashed #555; 119 | margin-top: 2px; 120 | } 121 | 122 | .footer-sections .span4 { 123 | border: 2px solid #555; 124 | text-align: center; 125 | border-radius: 10px; 126 | margin-top: 70px; 127 | margin-bottom: 20px; 128 | background: #373737; 129 | } 130 | 131 | .footer-sections .span4 h1 { 132 | background: transparent; 133 | margin-top: -30px; 134 | margin-bottom: 20px; 135 | font-size: 5em; 136 | } 137 | 138 | .footer-sections .span4 h1 * { 139 | background: transparent; 140 | } 141 | 142 | .footer-sections .span4 div { 143 | border-bottom-right-radius: 6px; 144 | border-bottom-left-radius: 6px; 145 | padding: 10px; 146 | min-height: 40px; 147 | } 148 | .footer-sections .span4 div, .footer-sections .span4 div * { 149 | background-color: #555; 150 | } 151 | .footer-sections .span4 ul { 152 | text-align: left; 153 | list-style: none; 154 | margin: 0; 155 | padding: 0; 156 | } 157 | 158 | .content { 159 | background-color: white; 160 | padding-right: 20px; 161 | } 162 | 163 | .content nav { 164 | text-align: center; 165 | border-bottom: 1px solid silver; 166 | margin: 5px 0 20px 0; 167 | padding-bottom: 5px; 168 | } 169 | 170 | .content > h1 { 171 | padding-bottom: 15px; 172 | } 173 | 174 | .content > h1 small { 175 | display: block; 176 | padding-bottom: 8px; 177 | font-size: 0.6em; 178 | } 179 | 180 | .deprecated { 181 | text-decoration: line-through; 182 | } 183 | 184 | .method { 185 | margin-bottom: 20px; 186 | } 187 | 188 | .method .signature .argument { 189 | color: maroon; 190 | font-weight: bold; 191 | } 192 | 193 | .class #summary section.row-fluid { 194 | overflow: hidden 195 | } 196 | 197 | .class #summary .heading { 198 | font-weight: bold; 199 | text-align: center; 200 | } 201 | 202 | .class #summary section .span4 { 203 | padding: 3px; 204 | overflow: hidden; 205 | margin-bottom: -9999px; 206 | padding-bottom: 9999px; 207 | white-space: nowrap; 208 | text-overflow: ellipsis; 209 | border-left: 5px solid transparent; 210 | } 211 | 212 | .class #summary section.public .span4:first-of-type:before, 213 | .class #summary section.public .span6:first-of-type:before, 214 | h3.public:before { 215 | font-family: FontAwesome; 216 | content: "\f046"; 217 | color: green; 218 | display: inline-block; 219 | width: 1.2em; 220 | } 221 | 222 | .class #summary section .span4:first-of-type, 223 | .class #summary section .span6:first-of-type { 224 | padding-left: 21px; 225 | } 226 | .class #summary section .span4:first-of-type:before, 227 | .class #summary section .span6:first-of-type:before { 228 | margin-left: -21px; 229 | } 230 | .class #summary section.protected .span4:first-of-type:before, 231 | .class #summary section.protected .span6:first-of-type:before, 232 | h3.protected:before { 233 | font-family: FontAwesome; 234 | content: "\f132"; 235 | color: orange; 236 | display: inline-block; 237 | width: 1.2em; 238 | } 239 | 240 | .class #summary section.private .span4:first-of-type:before, 241 | .class #summary section.private .span6:first-of-type:before, 242 | h3.private:before { 243 | font-family: FontAwesome; 244 | content: "\f023"; 245 | color: red; 246 | display: inline-block; 247 | width: 1.2em; 248 | } 249 | 250 | .class #summary section em { 251 | font-size: 0.9em; 252 | color: silver; 253 | } 254 | .class #summary .inherited { 255 | color: gray; 256 | font-style: italic; 257 | } 258 | 259 | .accordion-group { 260 | border: none; 261 | } 262 | 263 | .accordion { 264 | margin-bottom: 0; 265 | } 266 | 267 | .accordion a:hover { 268 | text-decoration: none; 269 | background: #333333; 270 | color: #eeeeee; 271 | } 272 | 273 | .accordion-heading .accordion-toggle:before { 274 | content: "\f078"; 275 | font-family: FontAwesome; 276 | margin-right: 5px; 277 | } 278 | 279 | .accordion-heading .accordion-toggle.collapsed:before { 280 | content: "\f054"; 281 | } 282 | .accordion-heading .accordion-toggle { 283 | float: left; 284 | width: 16px; 285 | height: 16px; 286 | padding: 4px 2px 4px 12px; 287 | } 288 | .accordion-heading a { 289 | display: block; 290 | padding: 4px 12px; 291 | } 292 | 293 | .accordion-inner a { 294 | display: block; 295 | padding: 4px 12px; 296 | } 297 | 298 | .accordion-inner > ul a:before { 299 | font-family: 'phpdocumentor-clean-icons'; 300 | content: "\e001"; 301 | margin-right: 5px; 302 | } 303 | 304 | .accordion-inner li.class a:before { 305 | content: "\e002"; 306 | } 307 | 308 | .accordion-inner li.interface a:before { 309 | content: "\e001"; 310 | } 311 | 312 | .accordion-inner li.trait a:before { 313 | content: "\e000"; 314 | } 315 | 316 | .accordion-inner { 317 | padding: 4px 0 4px 12px; 318 | } 319 | .accordion-inner ul { 320 | list-style: none; 321 | padding: 0; 322 | margin: 0; 323 | } 324 | 325 | .row-fluid .span2 { 326 | width: 16.5%; 327 | } 328 | 329 | body .modal { 330 | width: 90%; /* desired relative width */ 331 | left: 5%; /* (100%-width)/2 */ 332 | /* place center */ 333 | margin-left:auto; 334 | margin-right:auto; 335 | } 336 | 337 | .side-nav.nav-list li a { 338 | overflow: hidden; 339 | white-space: nowrap; 340 | text-overflow: ellipsis; 341 | } 342 | 343 | @media (min-width: 767px) { 344 | .sidebar { 345 | position: fixed; 346 | top: 40px; 347 | bottom: 0; 348 | background-color: #f3f3f3; 349 | left: 0; 350 | border-right: 1px solid #e9e9e9; 351 | overflow-y: scroll; 352 | overflow-x: hidden; 353 | padding-top: 10px; 354 | } 355 | 356 | .sidebar::-webkit-scrollbar { 357 | width: 10px; 358 | } 359 | 360 | .sidebar::-webkit-scrollbar-thumb { 361 | background: #cccccc; 362 | background-clip: padding-box; 363 | border: 3px solid #f3f3f3; 364 | border-radius: 5px; 365 | } 366 | 367 | .sidebar::-webkit-scrollbar-button { 368 | display: none; 369 | } 370 | 371 | .sidebar::-webkit-scrollbar-track { 372 | background: #f3f3f3; 373 | } 374 | } 375 | 376 | @media (max-width: 979px) { 377 | body { 378 | padding-top: 0; 379 | } 380 | } 381 | 382 | @media (max-width: 767px) { 383 | .class #summary .heading { 384 | display: none; 385 | } 386 | 387 | .detailsbar h1 { 388 | display: none; 389 | } 390 | 391 | body { 392 | background-color: white; 393 | } 394 | 395 | footer.row-fluid, footer.row-fluid * { 396 | background-color: white; 397 | } 398 | 399 | .footer-sections .span4 h1 { 400 | color: #ccccd9; 401 | margin-top: 0; 402 | } 403 | 404 | .detailsbar { 405 | background-color: white; 406 | color: #333; 407 | border: none; 408 | } 409 | 410 | .row-fluid .span2 { 411 | width: 100%; 412 | } 413 | } 414 | 415 | @media (min-width: 767px) { 416 | .detailsbar { 417 | min-height: 100%; 418 | margin-bottom: -99999px; 419 | padding-bottom: 99999px; 420 | padding-left: 20px; 421 | padding-top: 10px; 422 | } 423 | } 424 | 425 | @media (min-width: 1200px) { 426 | .row-fluid .span2 { 427 | width: 16.5%; 428 | } 429 | } 430 | -------------------------------------------------------------------------------- /doc/files/example.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | API Documentation 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 132 | 133 |
134 |
135 | 155 |
156 |
157 |
158 |
159 |
160 | 162 | 163 | 164 |

example.php

165 |

166 | 167 | 168 | 169 | 170 |
171 | 172 | 185 |
186 | 187 | 188 | 189 |
190 |
191 | 192 | 201 | 202 | 243 |
244 | 245 | 246 | 247 | -------------------------------------------------------------------------------- /doc/files/example.php.txt: -------------------------------------------------------------------------------- 1 | tmpPath = '/var/tmp'; 20 | 21 | $subscriberEmail = 'phplistTest@mailinator.com'; 22 | 23 | if ($phpList->login()) { 24 | $newListID = $phpList->listAdd('list '.rand(0, 100), 'This is a list made with the example code'); 25 | print 'Our new list has ID '.$newListID.PHP_EOL; 26 | 27 | $subscriberID = $phpList->subscriberFindByEmail($subscriberEmail); 28 | 29 | if (!empty($subscriberID)) { 30 | $phpList->listSubscriberAdd($newListID, $subscriberID); 31 | print "Subscriber $subscriberID has been added to the list".PHP_EOL; 32 | } else { 33 | $subscriberID = $phpList->subscribe($subscriberEmail, $newListID); 34 | print "Subscriber has been subscribed to the list with ID $subscriberID".PHP_EOL; 35 | } 36 | 37 | $lists = $phpList->listsSubscriber($subscriberID); 38 | print 'The subscriber is now member of '.PHP_EOL; 39 | foreach ($lists as $list) { 40 | print "\t".$list->id.' '.$list->name.PHP_EOL; 41 | } 42 | 43 | print 'Removing subscriber from the list'.PHP_EOL; 44 | $lists = $phpList->listSubscriberDelete($newListID, $subscriberID); 45 | print 'The subscriber is now member of '.PHP_EOL; 46 | foreach ($lists as $list) { 47 | print "\t".$list->id.' '.$list->name.PHP_EOL; 48 | } 49 | 50 | print 'And adding the subscriber to the list again'.PHP_EOL; 51 | $lists = $phpList->listSubscriberAdd($newListID, $subscriberID); 52 | print 'The subscriber is now member of '.PHP_EOL; 53 | foreach ($lists as $list) { 54 | print "\t".$list->id.' '.$list->name.PHP_EOL; 55 | } 56 | } 57 | 58 | -------------------------------------------------------------------------------- /doc/files/phpList-api-client.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | API Documentation 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 132 | 133 |
134 |
135 | 155 |
156 |
157 |
158 |
159 |
160 | 162 | 163 | 164 |

phpList-api-client.php

165 |

166 | 167 | 168 | 169 | 170 |

Classes

171 | 172 | 173 | 174 | 175 | 176 |
phpListRESTApiClientClass phpListApiClient.
177 |
178 | 179 | 192 |
193 | 194 | 195 | 196 |
197 |
198 | 199 | 208 | 209 | 250 |
251 | 252 | 253 | 254 | -------------------------------------------------------------------------------- /doc/files/phpList-api-client.php.txt: -------------------------------------------------------------------------------- 1 | remoteProcessingSecret)) { 49 | $post_params['secret'] = $this->remoteProcessingSecret; 50 | } 51 | $post_params = http_build_query($post_params); 52 | $c = curl_init(); 53 | curl_setopt($c, CURLOPT_URL, $this->url); 54 | curl_setopt($c, CURLOPT_HEADER, 0); 55 | curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); 56 | curl_setopt($c, CURLOPT_POST, 1); 57 | curl_setopt($c, CURLOPT_POSTFIELDS, $post_params); 58 | curl_setopt($c, CURLOPT_COOKIEFILE, $this->tmpPath.'/phpList_RESTAPI_cookiejar.txt'); 59 | curl_setopt($c, CURLOPT_COOKIEJAR, $this->tmpPath.'/phpList_RESTAPI_cookiejar.txt'); 60 | curl_setopt($c, CURLOPT_HTTPHEADER, array('Connection: Keep-Alive', 'Keep-Alive: 60')); 61 | 62 | // Execute the call 63 | $result = curl_exec($c); 64 | 65 | // Check if decoding of result is required 66 | if ($decode === true) { 67 | $result = json_decode($result); 68 | } 69 | 70 | return $result; 71 | } 72 | 73 | /** 74 | * Use a real login to test login api call. 75 | * 76 | * @param none 77 | * @return bool true if user exists and login successful 78 | */ 79 | public function login() 80 | { 81 | // Set the username and pwd to login with 82 | $post_params = array( 83 | 'login' => $this->loginName, 84 | 'password' => $this->password, 85 | ); 86 | 87 | // Execute the login with the credentials as params 88 | $result = $this->callApi('login', $post_params); 89 | 90 | return $result->status == 'success'; 91 | } 92 | 93 | /** 94 | * Create a list. 95 | * 96 | * @param string $listName Name of the list 97 | * @param string $listDescription Description of the list 98 | * @return integer ListId of the list created 99 | */ 100 | public function listAdd($listName, $listDescription) 101 | { 102 | // Create minimal params for api call 103 | $post_params = array( 104 | 'name' => $listName, 105 | 'description' => $listDescription, 106 | 'listorder' => '0', 107 | 'active' => '1', 108 | ); 109 | 110 | // Execute the api call 111 | $result = $this->callAPI('listAdd', $post_params); 112 | 113 | // get the ID of the list we just created 114 | $listId = $result->data->id; 115 | 116 | return $listId; 117 | } 118 | 119 | /** 120 | * find a subscriber by email address 121 | * 122 | * @param string $emailAddress Email address to search 123 | * @return bool true if found false if not found 124 | */ 125 | 126 | public function subscriberFindByEmail($emailAddress) 127 | { 128 | $params = array( 129 | 'email' => $emailAddress, 130 | ); 131 | $result = $this->callAPI('subscriberGetByEmail', $params); 132 | 133 | if (!empty($result->data->id)) { 134 | return $result->data->id; 135 | } else { 136 | return false; 137 | } 138 | } 139 | 140 | /** 141 | * Add a subscriber. 142 | * 143 | * This is the main method to use to add a subscriber. It will add the subscriber as 144 | * a non-confirmed subscriber in phpList and it will send the Request-for-confirmation 145 | * email as set up in phpList. 146 | * 147 | * The lists parameter will set the lists the subscriber will be added to. This has 148 | * to be comma-separated list-IDs, eg "1,2,3,4". 149 | * 150 | * @param string $emailAddress email address of the subscriber to add 151 | * @param string $lists comma-separated list of IDs of the lists to add the subscriber to 152 | * @return integer $subscriberId if added, or false if failed 153 | */ 154 | public function subscribe($emailAddress, $lists) 155 | { 156 | // Set the user details as parameters 157 | $post_params = array( 158 | 'email' => $emailAddress, 159 | 'foreignkey' => '', 160 | 'htmlemail' => 1, 161 | 'subscribepage' => 0, 162 | 'lists' => $lists, 163 | ); 164 | 165 | // Execute the api call 166 | $result = $this->callAPI('subscribed', $post_params); 167 | 168 | if (!empty($result->data->id)) { 169 | $subscriberId = $result->data->id; 170 | 171 | return $subscriberId; 172 | } else { 173 | return false; 174 | } 175 | } 176 | 177 | /** 178 | * test getting subscriber by ID. 179 | * 180 | * @depends testSubscriberAdd 181 | * @depends testSubscriberUpdate 182 | */ 183 | public function subscriberGet($subscriberId) 184 | { 185 | $post_params = array( 186 | 'id' => $subscriberId, 187 | ); 188 | 189 | // Execute the api call 190 | $result = $this->callAPI('subscriberGet', $post_params); 191 | if (!empty($result->data->id)) { 192 | $fetchedSubscriberId = $result->data->id; 193 | $this->assertEquals($fetchedSubscriberId, $subscriberId); 194 | 195 | return $result->data; 196 | } else { 197 | return false; 198 | } 199 | } 200 | 201 | /** 202 | * Get subscriber by Foreign Key. 203 | */ 204 | public function subscriberGetByFK($foreignKey) 205 | { 206 | $post_params = array( 207 | 'foreignkey' => $foreignKey, 208 | ); 209 | 210 | $result = $this->callAPI('subscriberGetByForeignkey', $post_params); 211 | if (!empty($result->data->id)) { 212 | $fetchedFK = $result->data->foreignkey; 213 | $this->assertEquals($fetchedFK, $foreignKey); 214 | 215 | return $result->data; 216 | } else { 217 | return false; 218 | } 219 | } 220 | 221 | /** 222 | * Counting the total number of subscribers. 223 | */ 224 | public function subscriberCount() 225 | { 226 | $post_params = array( 227 | ); 228 | 229 | $result = $this->callAPI('subscribersCount', $post_params); 230 | 231 | return $result->data->total; 232 | } 233 | 234 | /** 235 | * Add a subscriber to an existing list. 236 | */ 237 | public function listSubscriberAdd($listId, $subscriberId) 238 | { 239 | // Set list and subscriber vars 240 | $post_params = array( 241 | 'list_id' => $listId, 242 | 'subscriber_id' => $subscriberId, 243 | ); 244 | 245 | $result = $this->callAPI('listSubscriberAdd', $post_params); 246 | 247 | return $result; 248 | } 249 | 250 | /** 251 | * Verify the lists a subscriber is member of. 252 | */ 253 | public function listsSubscriber($subscriberId) 254 | { 255 | $post_params = array( 256 | 'subscriber_id' => $subscriberId, 257 | ); 258 | 259 | $result = $this->callAPI('listsSubscriber', $post_params); 260 | 261 | return $result->data; 262 | } 263 | 264 | /** 265 | * Remove a Subscriber from list. 266 | */ 267 | public function listSubscriberDelete($listId, $subscriberId) 268 | { 269 | // Set list and subscriber vars 270 | $post_params = array( 271 | 'list_id' => $listId, 272 | 'subscriber_id' => $subscriberId, 273 | ); 274 | 275 | $result = $this->callAPI('listSubscriberDelete', $post_params); 276 | 277 | return $result; 278 | } 279 | } 280 | 281 | -------------------------------------------------------------------------------- /doc/files/phpListRESTApiClient.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | API Documentation 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 132 | 133 |
134 |
135 | 155 |
156 |
157 |
158 |
159 |
160 | 162 | 163 | 164 |

phpListRESTApiClient.php

165 |

Class phpListRESTApiClient.

166 |

License: MIT, https://opensource.org/licenses/MIT

167 | 168 | 169 | 170 |

Classes

171 | 172 | 173 | 174 | 175 | 176 |
phpListRESTApiClientexample PHP client class to access the phpList Rest API.
177 |
178 | 179 | 192 |
193 | 194 | 195 | 196 |
197 |
198 | 199 | 208 | 209 | 250 |
251 | 252 | 253 | 254 | -------------------------------------------------------------------------------- /doc/files/phpListRESTApiClient.php.txt: -------------------------------------------------------------------------------- 1 | url = $url; 68 | $this->loginName = $loginName; 69 | $this->password = $password; 70 | } 71 | 72 | /** 73 | * Make a call to the API using cURL. 74 | * 75 | * @param string $command The command to run 76 | * @param array $post_params Array for parameters for the API call 77 | * @param bool $decode json_decode the result (defaults to true) 78 | * 79 | * @return string result of the CURL execution 80 | */ 81 | private function callApi($command, $post_params, $decode = true) 82 | { 83 | $post_params['cmd'] = $command; 84 | 85 | // optionally add the secret to a call, if provided 86 | if (!empty($this->remoteProcessingSecret)) { 87 | $post_params['secret'] = $this->remoteProcessingSecret; 88 | } 89 | $post_params = http_build_query($post_params); 90 | $c = curl_init(); 91 | curl_setopt($c, CURLOPT_URL, $this->url); 92 | curl_setopt($c, CURLOPT_HEADER, 0); 93 | curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); 94 | curl_setopt($c, CURLOPT_POST, 1); 95 | curl_setopt($c, CURLOPT_POSTFIELDS, $post_params); 96 | curl_setopt($c, CURLOPT_COOKIEFILE, $this->tmpPath.'/phpList_RESTAPI_cookiejar.txt'); 97 | curl_setopt($c, CURLOPT_COOKIEJAR, $this->tmpPath.'/phpList_RESTAPI_cookiejar.txt'); 98 | curl_setopt($c, CURLOPT_HTTPHEADER, array('Connection: Keep-Alive', 'Keep-Alive: 60')); 99 | 100 | // Execute the call 101 | $result = curl_exec($c); 102 | // Check if decoding of result is required 103 | if ($decode === true) { 104 | $result = json_decode($result); 105 | } 106 | 107 | return $result; 108 | } 109 | 110 | /** 111 | * Use a real login to test login api call. 112 | * 113 | * @param none 114 | * 115 | * @return bool true if user exists and login successful 116 | */ 117 | public function login() 118 | { 119 | // Set the username and pwd to login with 120 | $post_params = array( 121 | 'login' => $this->loginName, 122 | 'password' => $this->password, 123 | ); 124 | 125 | // Execute the login with the credentials as params 126 | $result = $this->callApi('login', $post_params); 127 | return $result->status == 'success'; 128 | } 129 | 130 | /** 131 | * Create a list. 132 | * 133 | * @param string $listName Name of the list 134 | * @param string $listDescription Description of the list 135 | * 136 | * @return int ListId of the list created 137 | */ 138 | public function listAdd($listName, $listDescription) 139 | { 140 | // Create minimal params for api call 141 | $post_params = array( 142 | 'name' => $listName, 143 | 'description' => $listDescription, 144 | 'listorder' => '0', 145 | 'active' => '1', 146 | ); 147 | 148 | // Execute the api call 149 | $result = $this->callAPI('listAdd', $post_params); 150 | 151 | // get the ID of the list we just created 152 | $listId = $result->data->id; 153 | 154 | return $listId; 155 | } 156 | 157 | /** 158 | * Find a subscriber by email address. 159 | * 160 | * @param string $emailAddress Email address to search 161 | * 162 | * @return int $subscriberID if found false if not found 163 | */ 164 | public function subscriberFindByEmail($emailAddress) 165 | { 166 | $params = array( 167 | 'email' => $emailAddress, 168 | ); 169 | $result = $this->callAPI('subscriberGetByEmail', $params); 170 | 171 | if (!empty($result->data->id)) { 172 | return $result->data->id; 173 | } else { 174 | return false; 175 | } 176 | } 177 | 178 | /** 179 | * Add a subscriber. 180 | * 181 | * This is the main method to use to add a subscriber. It will add the subscriber as 182 | * a non-confirmed subscriber in phpList and it will send the Request-for-confirmation 183 | * email as set up in phpList. 184 | * 185 | * The lists parameter will set the lists the subscriber will be added to. This has 186 | * to be comma-separated list-IDs, eg "1,2,3,4". 187 | * 188 | * @param string $emailAddress email address of the subscriber to add 189 | * @param string $lists comma-separated list of IDs of the lists to add the subscriber to 190 | * 191 | * @return int $subscriberId if added, or false if failed 192 | */ 193 | public function subscribe($emailAddress, $lists) 194 | { 195 | // Set the user details as parameters 196 | $post_params = array( 197 | 'email' => $emailAddress, 198 | 'foreignkey' => '', 199 | 'htmlemail' => 1, 200 | 'subscribepage' => 0, 201 | 'lists' => $lists, 202 | ); 203 | 204 | // Execute the api call 205 | $result = $this->callAPI('subscribe', $post_params); 206 | 207 | if (!empty($result->data->id)) { 208 | $subscriberId = $result->data->id; 209 | 210 | return $subscriberId; 211 | } else { 212 | return false; 213 | } 214 | } 215 | 216 | /** 217 | * Fetch subscriber by ID. 218 | * 219 | * @param int $subscriberID ID of the subscriber 220 | * 221 | * @return the subscriber 222 | */ 223 | public function subscriberGet($subscriberId) 224 | { 225 | $post_params = array( 226 | 'id' => $subscriberId, 227 | ); 228 | 229 | // Execute the api call 230 | $result = $this->callAPI('subscriberGet', $post_params); 231 | if (!empty($result->data->id)) { 232 | $fetchedSubscriberId = $result->data->id; 233 | $this->assertEquals($fetchedSubscriberId, $subscriberId); 234 | 235 | return $result->data; 236 | } else { 237 | return false; 238 | } 239 | } 240 | 241 | /** 242 | * Find a subscriber by Foreign Key. 243 | * 244 | * @param string $foreignKey Foreign Key to search 245 | * 246 | * @return int $subscriberID if found false if not found 247 | */ 248 | public function subscriberGetByForeignkey($foreignKey) 249 | { 250 | $post_params = array( 251 | 'foreignkey' => $foreignKey, 252 | ); 253 | 254 | $result = $this->callAPI('subscriberGetByForeignkey', $post_params); 255 | if (!empty($result->data->id)) { 256 | return $result->data->id; 257 | } else { 258 | return false; 259 | } 260 | } 261 | 262 | /** 263 | * Get the total number of subscribers. 264 | * 265 | * @param none 266 | * 267 | * @return int total number of subscribers in the system 268 | */ 269 | public function subscriberCount() 270 | { 271 | $post_params = array( 272 | ); 273 | 274 | $result = $this->callAPI('subscribersCount', $post_params); 275 | 276 | return $result->data->total; 277 | } 278 | 279 | /** 280 | * Add a subscriber to an existing list. 281 | * 282 | * @param int $listId ID of the list 283 | * @param int $subscriberId ID of the subscriber 284 | * 285 | * @return the lists this subscriber is member of 286 | */ 287 | public function listSubscriberAdd($listId, $subscriberId) 288 | { 289 | // Set list and subscriber vars 290 | $post_params = array( 291 | 'list_id' => $listId, 292 | 'subscriber_id' => $subscriberId, 293 | ); 294 | 295 | $result = $this->callAPI('listSubscriberAdd', $post_params); 296 | 297 | return $result->data; 298 | } 299 | 300 | /** 301 | * Get the lists a subscriber is member of. 302 | * 303 | * @param int $subscriberId ID of the subscriber 304 | * 305 | * @return the lists this subcriber is member of 306 | */ 307 | public function listsSubscriber($subscriberId) 308 | { 309 | $post_params = array( 310 | 'subscriber_id' => $subscriberId, 311 | ); 312 | 313 | $result = $this->callAPI('listsSubscriber', $post_params); 314 | 315 | return $result->data; 316 | } 317 | 318 | /** 319 | * Remove a Subscriber from a list. 320 | * 321 | * @param int $listId ID of the list to remove 322 | * @param int $subscriberId ID of the subscriber 323 | * 324 | * @return the lists this subcriber is member of 325 | */ 326 | public function listSubscriberDelete($listId, $subscriberId) 327 | { 328 | // Set list and subscriber vars 329 | $post_params = array( 330 | 'list_id' => $listId, 331 | 'subscriber_id' => $subscriberId, 332 | ); 333 | 334 | $result = $this->callAPI('listSubscriberDelete', $post_params); 335 | 336 | return $result->data; 337 | } 338 | } 339 | 340 | -------------------------------------------------------------------------------- /doc/font/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michield/phplist-restapi-client/44ddfc79738387db063f5956182884368251ac4a/doc/font/FontAwesome.otf -------------------------------------------------------------------------------- /doc/font/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michield/phplist-restapi-client/44ddfc79738387db063f5956182884368251ac4a/doc/font/fontawesome-webfont.eot -------------------------------------------------------------------------------- /doc/font/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michield/phplist-restapi-client/44ddfc79738387db063f5956182884368251ac4a/doc/font/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /doc/font/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michield/phplist-restapi-client/44ddfc79738387db063f5956182884368251ac4a/doc/font/fontawesome-webfont.woff -------------------------------------------------------------------------------- /doc/graphs/class.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | API Documentation 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 24 | 25 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 109 | 110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 | 119 | 160 |
161 | 162 | 163 | 164 | -------------------------------------------------------------------------------- /doc/images/apple-touch-icon-114x114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michield/phplist-restapi-client/44ddfc79738387db063f5956182884368251ac4a/doc/images/apple-touch-icon-114x114.png -------------------------------------------------------------------------------- /doc/images/apple-touch-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michield/phplist-restapi-client/44ddfc79738387db063f5956182884368251ac4a/doc/images/apple-touch-icon-72x72.png -------------------------------------------------------------------------------- /doc/images/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michield/phplist-restapi-client/44ddfc79738387db063f5956182884368251ac4a/doc/images/apple-touch-icon.png -------------------------------------------------------------------------------- /doc/images/custom-icons.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 20 | 43 | 45 | 46 | 48 | image/svg+xml 49 | 51 | 52 | 53 | 54 | 55 | 61 | 67 | 68 | 84 | 100 | 106 | 109 | 114 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /doc/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michield/phplist-restapi-client/44ddfc79738387db063f5956182884368251ac4a/doc/images/favicon.ico -------------------------------------------------------------------------------- /doc/images/hierarchy-item.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michield/phplist-restapi-client/44ddfc79738387db063f5956182884368251ac4a/doc/images/hierarchy-item.png -------------------------------------------------------------------------------- /doc/images/icon-class-13x13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michield/phplist-restapi-client/44ddfc79738387db063f5956182884368251ac4a/doc/images/icon-class-13x13.png -------------------------------------------------------------------------------- /doc/images/icon-class.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 31 | 36 | 37 | 40 | 43 | 47 | 48 | 49 | 63 | 77 | 78 | -------------------------------------------------------------------------------- /doc/images/icon-interface-13x13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michield/phplist-restapi-client/44ddfc79738387db063f5956182884368251ac4a/doc/images/icon-interface-13x13.png -------------------------------------------------------------------------------- /doc/images/icon-interface.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 31 | 36 | 37 | 49 | 52 | 55 | 59 | 60 | 61 | 73 | 74 | -------------------------------------------------------------------------------- /doc/images/icon-trait-13x13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michield/phplist-restapi-client/44ddfc79738387db063f5956182884368251ac4a/doc/images/icon-trait-13x13.png -------------------------------------------------------------------------------- /doc/images/icon-trait.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 31 | 36 | 37 | 49 | 61 | 64 | 67 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /doc/images/iviewer/grab.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michield/phplist-restapi-client/44ddfc79738387db063f5956182884368251ac4a/doc/images/iviewer/grab.cur -------------------------------------------------------------------------------- /doc/images/iviewer/hand.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michield/phplist-restapi-client/44ddfc79738387db063f5956182884368251ac4a/doc/images/iviewer/hand.cur -------------------------------------------------------------------------------- /doc/images/iviewer/iviewer.rotate_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michield/phplist-restapi-client/44ddfc79738387db063f5956182884368251ac4a/doc/images/iviewer/iviewer.rotate_left.png -------------------------------------------------------------------------------- /doc/images/iviewer/iviewer.rotate_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michield/phplist-restapi-client/44ddfc79738387db063f5956182884368251ac4a/doc/images/iviewer/iviewer.rotate_right.png -------------------------------------------------------------------------------- /doc/images/iviewer/iviewer.zoom_fit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michield/phplist-restapi-client/44ddfc79738387db063f5956182884368251ac4a/doc/images/iviewer/iviewer.zoom_fit.png -------------------------------------------------------------------------------- /doc/images/iviewer/iviewer.zoom_in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michield/phplist-restapi-client/44ddfc79738387db063f5956182884368251ac4a/doc/images/iviewer/iviewer.zoom_in.png -------------------------------------------------------------------------------- /doc/images/iviewer/iviewer.zoom_out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michield/phplist-restapi-client/44ddfc79738387db063f5956182884368251ac4a/doc/images/iviewer/iviewer.zoom_out.png -------------------------------------------------------------------------------- /doc/images/iviewer/iviewer.zoom_zero.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michield/phplist-restapi-client/44ddfc79738387db063f5956182884368251ac4a/doc/images/iviewer/iviewer.zoom_zero.png -------------------------------------------------------------------------------- /doc/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | API Documentation 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 84 | 85 |
86 |
87 | 107 |
108 |
109 |
110 |
111 |
112 | 115 |

\

116 | 117 | 118 | 119 | 120 |

Classes

121 | 122 | 123 | 124 | 125 | 126 |
phpListRESTApiClientexample PHP client class to access the phpList Rest API.
127 |
128 | 129 | 137 |
138 | 139 | 140 | 141 |
142 |
143 | 144 | 185 |
186 | 187 | 188 | 189 | -------------------------------------------------------------------------------- /doc/js/html5.js: -------------------------------------------------------------------------------- 1 | /* 2 | HTML5 Shiv v3.7.0 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed 3 | */ 4 | (function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag(); 5 | a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/[\w\-]+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x"; 6 | c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode|| 7 | "undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:"3.7.0",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f); 8 | if(g)return a.createDocumentFragment();for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d 1 ) 33 | { 34 | return this.each( 35 | function() 36 | { 37 | $(this).dotdotdot( o ); 38 | } 39 | ); 40 | } 41 | 42 | 43 | var $dot = this; 44 | 45 | if ( $dot.data( 'dotdotdot' ) ) 46 | { 47 | $dot.trigger( 'destroy.dot' ); 48 | } 49 | 50 | $dot.data( 'dotdotdot-style', $dot.attr( 'style' ) ); 51 | $dot.css( 'word-wrap', 'break-word' ); 52 | 53 | $dot.bind_events = function() 54 | { 55 | $dot.bind( 56 | 'update.dot', 57 | function( e, c ) 58 | { 59 | e.preventDefault(); 60 | e.stopPropagation(); 61 | 62 | opts.maxHeight = ( typeof opts.height == 'number' ) 63 | ? opts.height 64 | : getTrueInnerHeight( $dot ); 65 | 66 | opts.maxHeight += opts.tolerance; 67 | 68 | if ( typeof c != 'undefined' ) 69 | { 70 | if ( typeof c == 'string' || c instanceof HTMLElement ) 71 | { 72 | c = $('
').append( c ).contents(); 73 | } 74 | if ( c instanceof $ ) 75 | { 76 | orgContent = c; 77 | } 78 | } 79 | 80 | $inr = $dot.wrapInner( '
' ).children(); 81 | $inr.empty() 82 | .append( orgContent.clone( true ) ) 83 | .css({ 84 | 'height' : 'auto', 85 | 'width' : 'auto', 86 | 'border' : 'none', 87 | 'padding' : 0, 88 | 'margin' : 0 89 | }); 90 | 91 | var after = false, 92 | trunc = false; 93 | 94 | if ( conf.afterElement ) 95 | { 96 | after = conf.afterElement.clone( true ); 97 | conf.afterElement.remove(); 98 | } 99 | if ( test( $inr, opts ) ) 100 | { 101 | if ( opts.wrap == 'children' ) 102 | { 103 | trunc = children( $inr, opts, after ); 104 | } 105 | else 106 | { 107 | trunc = ellipsis( $inr, $dot, $inr, opts, after ); 108 | } 109 | } 110 | $inr.replaceWith( $inr.contents() ); 111 | $inr = null; 112 | 113 | if ( $.isFunction( opts.callback ) ) 114 | { 115 | opts.callback.call( $dot[ 0 ], trunc, orgContent ); 116 | } 117 | 118 | conf.isTruncated = trunc; 119 | return trunc; 120 | } 121 | 122 | ).bind( 123 | 'isTruncated.dot', 124 | function( e, fn ) 125 | { 126 | e.preventDefault(); 127 | e.stopPropagation(); 128 | 129 | if ( typeof fn == 'function' ) 130 | { 131 | fn.call( $dot[ 0 ], conf.isTruncated ); 132 | } 133 | return conf.isTruncated; 134 | } 135 | 136 | ).bind( 137 | 'originalContent.dot', 138 | function( e, fn ) 139 | { 140 | e.preventDefault(); 141 | e.stopPropagation(); 142 | 143 | if ( typeof fn == 'function' ) 144 | { 145 | fn.call( $dot[ 0 ], orgContent ); 146 | } 147 | return orgContent; 148 | } 149 | 150 | ).bind( 151 | 'destroy.dot', 152 | function( e ) 153 | { 154 | e.preventDefault(); 155 | e.stopPropagation(); 156 | 157 | $dot.unwatch() 158 | .unbind_events() 159 | .empty() 160 | .append( orgContent ) 161 | .attr( 'style', $dot.data( 'dotdotdot-style' ) ) 162 | .data( 'dotdotdot', false ); 163 | } 164 | ); 165 | return $dot; 166 | }; // /bind_events 167 | 168 | $dot.unbind_events = function() 169 | { 170 | $dot.unbind('.dot'); 171 | return $dot; 172 | }; // /unbind_events 173 | 174 | $dot.watch = function() 175 | { 176 | $dot.unwatch(); 177 | if ( opts.watch == 'window' ) 178 | { 179 | var $window = $(window), 180 | _wWidth = $window.width(), 181 | _wHeight = $window.height(); 182 | 183 | $window.bind( 184 | 'resize.dot' + conf.dotId, 185 | function() 186 | { 187 | if ( _wWidth != $window.width() || _wHeight != $window.height() || !opts.windowResizeFix ) 188 | { 189 | _wWidth = $window.width(); 190 | _wHeight = $window.height(); 191 | 192 | if ( watchInt ) 193 | { 194 | clearInterval( watchInt ); 195 | } 196 | watchInt = setTimeout( 197 | function() 198 | { 199 | $dot.trigger( 'update.dot' ); 200 | }, 10 201 | ); 202 | } 203 | } 204 | ); 205 | } 206 | else 207 | { 208 | watchOrg = getSizes( $dot ); 209 | watchInt = setInterval( 210 | function() 211 | { 212 | var watchNew = getSizes( $dot ); 213 | if ( watchOrg.width != watchNew.width || 214 | watchOrg.height != watchNew.height ) 215 | { 216 | $dot.trigger( 'update.dot' ); 217 | watchOrg = getSizes( $dot ); 218 | } 219 | }, 100 220 | ); 221 | } 222 | return $dot; 223 | }; 224 | $dot.unwatch = function() 225 | { 226 | $(window).unbind( 'resize.dot' + conf.dotId ); 227 | if ( watchInt ) 228 | { 229 | clearInterval( watchInt ); 230 | } 231 | return $dot; 232 | }; 233 | 234 | var orgContent = $dot.contents(), 235 | opts = $.extend( true, {}, $.fn.dotdotdot.defaults, o ), 236 | conf = {}, 237 | watchOrg = {}, 238 | watchInt = null, 239 | $inr = null; 240 | 241 | conf.afterElement = getElement( opts.after, $dot ); 242 | conf.isTruncated = false; 243 | conf.dotId = dotId++; 244 | 245 | 246 | $dot.data( 'dotdotdot', true ) 247 | .bind_events() 248 | .trigger( 'update.dot' ); 249 | 250 | if ( opts.watch ) 251 | { 252 | $dot.watch(); 253 | } 254 | 255 | return $dot; 256 | }; 257 | 258 | 259 | // public 260 | $.fn.dotdotdot.defaults = { 261 | 'ellipsis' : '... ', 262 | 'wrap' : 'word', 263 | 'lastCharacter': { 264 | 'remove' : [ ' ', ',', ';', '.', '!', '?' ], 265 | 'noEllipsis' : [] 266 | }, 267 | 'tolerance' : 0, 268 | 'callback' : null, 269 | 'after' : null, 270 | 'height' : null, 271 | 'watch' : false, 272 | 'windowResizeFix': true, 273 | 'debug' : false 274 | }; 275 | 276 | 277 | // private 278 | var dotId = 1; 279 | 280 | function children( $elem, o, after ) 281 | { 282 | var $elements = $elem.children(), 283 | isTruncated = false; 284 | 285 | $elem.empty(); 286 | 287 | for ( var a = 0, l = $elements.length; a < l; a++ ) 288 | { 289 | var $e = $elements.eq( a ); 290 | $elem.append( $e ); 291 | if ( after ) 292 | { 293 | $elem.append( after ); 294 | } 295 | if ( test( $elem, o ) ) 296 | { 297 | $e.remove(); 298 | isTruncated = true; 299 | break; 300 | } 301 | else 302 | { 303 | if ( after ) 304 | { 305 | after.remove(); 306 | } 307 | } 308 | } 309 | return isTruncated; 310 | } 311 | function ellipsis( $elem, $d, $i, o, after ) 312 | { 313 | var $elements = $elem.contents(), 314 | isTruncated = false; 315 | 316 | $elem.empty(); 317 | 318 | var notx = 'table, thead, tbody, tfoot, tr, col, colgroup, object, embed, param, ol, ul, dl, select, optgroup, option, textarea, script, style'; 319 | for ( var a = 0, l = $elements.length; a < l; a++ ) 320 | { 321 | 322 | if ( isTruncated ) 323 | { 324 | break; 325 | } 326 | 327 | var e = $elements[ a ], 328 | $e = $(e); 329 | 330 | if ( typeof e == 'undefined' ) 331 | { 332 | continue; 333 | } 334 | 335 | $elem.append( $e ); 336 | if ( after ) 337 | { 338 | $elem[ ( $elem.is( notx ) ) ? 'after' : 'append' ]( after ); 339 | } 340 | if ( e.nodeType == 3 ) 341 | { 342 | if ( test( $i, o ) ) 343 | { 344 | isTruncated = ellipsisElement( $e, $d, $i, o, after ); 345 | } 346 | } 347 | else 348 | { 349 | isTruncated = ellipsis( $e, $d, $i, o, after ); 350 | } 351 | 352 | if ( !isTruncated ) 353 | { 354 | if ( after ) 355 | { 356 | after.remove(); 357 | } 358 | } 359 | } 360 | return isTruncated; 361 | } 362 | function ellipsisElement( $e, $d, $i, o, after ) 363 | { 364 | var isTruncated = false, 365 | e = $e[ 0 ]; 366 | 367 | if ( typeof e == 'undefined' ) 368 | { 369 | return false; 370 | } 371 | 372 | var seporator = ( o.wrap == 'letter' ) ? '' : ' ', 373 | textArr = getTextContent( e ).split( seporator ), 374 | position = -1, 375 | midPos = -1, 376 | startPos = 0, 377 | endPos = textArr.length - 1; 378 | 379 | while ( startPos <= endPos ) 380 | { 381 | var m = Math.floor( ( startPos + endPos ) / 2 ); 382 | if ( m == midPos ) 383 | { 384 | break; 385 | } 386 | midPos = m; 387 | 388 | setTextContent( e, textArr.slice( 0, midPos + 1 ).join( seporator ) + o.ellipsis ); 389 | 390 | if ( !test( $i, o ) ) 391 | { 392 | position = midPos; 393 | startPos = midPos; 394 | } 395 | else 396 | { 397 | endPos = midPos; 398 | } 399 | } 400 | 401 | if ( position != -1 && !( textArr.length == 1 && textArr[ 0 ].length == 0 ) ) 402 | { 403 | var txt = addEllipsis( textArr.slice( 0, position + 1 ).join( seporator ), o ); 404 | isTruncated = true; 405 | setTextContent( e, txt ); 406 | } 407 | else 408 | { 409 | var $w = $e.parent(); 410 | $e.remove(); 411 | 412 | var afterLength = ( after ) ? after.length : 0 ; 413 | 414 | if ( $w.contents().size() > afterLength ) 415 | { 416 | var $n = $w.contents().eq( -1 - afterLength ); 417 | isTruncated = ellipsisElement( $n, $d, $i, o, after ); 418 | } 419 | else 420 | { 421 | var $p = $w.prev() 422 | var e = $p.contents().eq( -1 )[ 0 ]; 423 | 424 | if ( typeof e != 'undefined' ) 425 | { 426 | var txt = addEllipsis( getTextContent( e ), o ); 427 | setTextContent( e, txt ); 428 | if ( after ) 429 | { 430 | $p.append( after ); 431 | } 432 | $w.remove(); 433 | isTruncated = true; 434 | } 435 | 436 | } 437 | } 438 | 439 | return isTruncated; 440 | } 441 | function test( $i, o ) 442 | { 443 | return $i.innerHeight() > o.maxHeight; 444 | } 445 | function addEllipsis( txt, o ) 446 | { 447 | while( $.inArray( txt.slice( -1 ), o.lastCharacter.remove ) > -1 ) 448 | { 449 | txt = txt.slice( 0, -1 ); 450 | } 451 | if ( $.inArray( txt.slice( -1 ), o.lastCharacter.noEllipsis ) < 0 ) 452 | { 453 | txt += o.ellipsis; 454 | } 455 | return txt; 456 | } 457 | function getSizes( $d ) 458 | { 459 | return { 460 | 'width' : $d.innerWidth(), 461 | 'height': $d.innerHeight() 462 | }; 463 | } 464 | function setTextContent( e, content ) 465 | { 466 | if ( e.innerText ) 467 | { 468 | e.innerText = content; 469 | } 470 | else if ( e.nodeValue ) 471 | { 472 | e.nodeValue = content; 473 | } 474 | else if (e.textContent) 475 | { 476 | e.textContent = content; 477 | } 478 | 479 | } 480 | function getTextContent( e ) 481 | { 482 | if ( e.innerText ) 483 | { 484 | return e.innerText; 485 | } 486 | else if ( e.nodeValue ) 487 | { 488 | return e.nodeValue; 489 | } 490 | else if ( e.textContent ) 491 | { 492 | return e.textContent; 493 | } 494 | else 495 | { 496 | return ""; 497 | } 498 | } 499 | function getElement( e, $i ) 500 | { 501 | if ( typeof e == 'undefined' ) 502 | { 503 | return false; 504 | } 505 | if ( !e ) 506 | { 507 | return false; 508 | } 509 | if ( typeof e == 'string' ) 510 | { 511 | e = $(e, $i); 512 | return ( e.length ) 513 | ? e 514 | : false; 515 | } 516 | if ( typeof e == 'object' ) 517 | { 518 | return ( typeof e.jquery == 'undefined' ) 519 | ? false 520 | : e; 521 | } 522 | return false; 523 | } 524 | function getTrueInnerHeight( $el ) 525 | { 526 | var h = $el.innerHeight(), 527 | a = [ 'paddingTop', 'paddingBottom' ]; 528 | 529 | for ( var z = 0, l = a.length; z < l; z++ ) { 530 | var m = parseInt( $el.css( a[ z ] ), 10 ); 531 | if ( isNaN( m ) ) 532 | { 533 | m = 0; 534 | } 535 | h -= m; 536 | } 537 | return h; 538 | } 539 | function debug( d, m ) 540 | { 541 | if ( !d ) 542 | { 543 | return false; 544 | } 545 | if ( typeof m == 'string' ) 546 | { 547 | m = 'dotdotdot: ' + m; 548 | } 549 | else 550 | { 551 | m = [ 'dotdotdot:', m ]; 552 | } 553 | 554 | if ( typeof window.console != 'undefined' ) 555 | { 556 | if ( typeof window.console.log != 'undefined' ) 557 | { 558 | window.console.log( m ); 559 | } 560 | } 561 | return false; 562 | } 563 | 564 | 565 | // override jQuery.html 566 | var _orgHtml = $.fn.html; 567 | $.fn.html = function( str ) { 568 | if ( typeof str != 'undefined' ) 569 | { 570 | if ( this.data( 'dotdotdot' ) ) 571 | { 572 | if ( typeof str != 'function' ) 573 | { 574 | return this.trigger( 'update', [ str ] ); 575 | } 576 | } 577 | return _orgHtml.call( this, str ); 578 | } 579 | return _orgHtml.call( this ); 580 | }; 581 | 582 | 583 | // override jQuery.text 584 | var _orgText = $.fn.text; 585 | $.fn.text = function( str ) { 586 | if ( typeof str != 'undefined' ) 587 | { 588 | if ( this.data( 'dotdotdot' ) ) 589 | { 590 | var temp = $( '
' ); 591 | temp.text( str ); 592 | str = temp.html(); 593 | temp.remove(); 594 | return this.trigger( 'update', [ str ] ); 595 | } 596 | return _orgText.call( this, str ); 597 | } 598 | return _orgText.call( this ); 599 | }; 600 | 601 | 602 | })( jQuery ); 603 | -------------------------------------------------------------------------------- /doc/js/jquery.dotdotdot-1.5.9.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery dotdotdot 1.5.9 3 | * 4 | * Copyright (c) 2013 Fred Heusschen 5 | * www.frebsite.nl 6 | * 7 | * Plugin website: 8 | * dotdotdot.frebsite.nl 9 | * 10 | * Dual licensed under the MIT and GPL licenses. 11 | * http://en.wikipedia.org/wiki/MIT_License 12 | * http://en.wikipedia.org/wiki/GNU_General_Public_License 13 | */ 14 | 15 | (function(a){function c(a,b,c){var d=a.children(),e=!1;a.empty();for(var g=0,h=d.length;h>g;g++){var i=d.eq(g);if(a.append(i),c&&a.append(c),f(a,b)){i.remove(),e=!0;break}c&&c.remove()}return e}function d(b,c,g,h,i){var j=b.contents(),k=!1;b.empty();for(var l="table, thead, tbody, tfoot, tr, col, colgroup, object, embed, param, ol, ul, dl, select, optgroup, option, textarea, script, style",m=0,n=j.length;n>m&&!k;m++){var o=j[m],p=a(o);void 0!==o&&(b.append(p),i&&b[b.is(l)?"after":"append"](i),3==o.nodeType?f(g,h)&&(k=e(p,c,g,h,i)):k=d(p,c,g,h,i),k||i&&i.remove())}return k}function e(a,b,c,d,h){var k=!1,l=a[0];if(l===void 0)return!1;for(var m="letter"==d.wrap?"":" ",n=j(l).split(m),o=-1,p=-1,q=0,r=n.length-1;r>=q;){var s=Math.floor((q+r)/2);if(s==p)break;p=s,i(l,n.slice(0,p+1).join(m)+d.ellipsis),f(c,d)?r=p:(o=p,q=p)}if(-1==o||1==n.length&&0==n[0].length){var u=a.parent();a.remove();var v=h?h.length:0;if(u.contents().size()>v){var w=u.contents().eq(-1-v);k=e(w,b,c,d,h)}else{var x=u.prev(),l=x.contents().eq(-1)[0];if(l!==void 0){var t=g(j(l),d);i(l,t),h&&x.append(h),u.remove(),k=!0}}}else{var t=g(n.slice(0,o+1).join(m),d);k=!0,i(l,t)}return k}function f(a,b){return a.innerHeight()>b.maxHeight}function g(b,c){for(;a.inArray(b.slice(-1),c.lastCharacter.remove)>-1;)b=b.slice(0,-1);return 0>a.inArray(b.slice(-1),c.lastCharacter.noEllipsis)&&(b+=c.ellipsis),b}function h(a){return{width:a.innerWidth(),height:a.innerHeight()}}function i(a,b){a.innerText?a.innerText=b:a.nodeValue?a.nodeValue=b:a.textContent&&(a.textContent=b)}function j(a){return a.innerText?a.innerText:a.nodeValue?a.nodeValue:a.textContent?a.textContent:""}function k(b,c){return b===void 0?!1:b?"string"==typeof b?(b=a(b,c),b.length?b:!1):"object"==typeof b?b.jquery===void 0?!1:b:!1:!1}function l(a){for(var b=a.innerHeight(),c=["paddingTop","paddingBottom"],d=0,e=c.length;e>d;d++){var f=parseInt(a.css(c[d]),10);isNaN(f)&&(f=0),b-=f}return b}function m(a,b){return a?(b="string"==typeof b?"dotdotdot: "+b:["dotdotdot:",b],window.console!==void 0&&window.console.log!==void 0&&window.console.log(b),!1):!1}if(!a.fn.dotdotdot){a.fn.dotdotdot=function(e){if(0==this.length)return e&&e.debug===!1||m(!0,'No element found for "'+this.selector+'".'),this;if(this.length>1)return this.each(function(){a(this).dotdotdot(e)});var g=this;g.data("dotdotdot")&&g.trigger("destroy.dot"),g.data("dotdotdot-style",g.attr("style")),g.css("word-wrap","break-word"),g.bind_events=function(){return g.bind("update.dot",function(b,e){b.preventDefault(),b.stopPropagation(),j.maxHeight="number"==typeof j.height?j.height:l(g),j.maxHeight+=j.tolerance,e!==void 0&&(("string"==typeof e||e instanceof HTMLElement)&&(e=a("
").append(e).contents()),e instanceof a&&(i=e)),q=g.wrapInner('
').children(),q.empty().append(i.clone(!0)).css({height:"auto",width:"auto",border:"none",padding:0,margin:0});var h=!1,k=!1;return n.afterElement&&(h=n.afterElement.clone(!0),n.afterElement.remove()),f(q,j)&&(k="children"==j.wrap?c(q,j,h):d(q,g,q,j,h)),q.replaceWith(q.contents()),q=null,a.isFunction(j.callback)&&j.callback.call(g[0],k,i),n.isTruncated=k,k}).bind("isTruncated.dot",function(a,b){return a.preventDefault(),a.stopPropagation(),"function"==typeof b&&b.call(g[0],n.isTruncated),n.isTruncated}).bind("originalContent.dot",function(a,b){return a.preventDefault(),a.stopPropagation(),"function"==typeof b&&b.call(g[0],i),i}).bind("destroy.dot",function(a){a.preventDefault(),a.stopPropagation(),g.unwatch().unbind_events().empty().append(i).attr("style",g.data("dotdotdot-style")).data("dotdotdot",!1)}),g},g.unbind_events=function(){return g.unbind(".dot"),g},g.watch=function(){if(g.unwatch(),"window"==j.watch){var b=a(window),c=b.width(),d=b.height();b.bind("resize.dot"+n.dotId,function(){c==b.width()&&d==b.height()&&j.windowResizeFix||(c=b.width(),d=b.height(),p&&clearInterval(p),p=setTimeout(function(){g.trigger("update.dot")},10))})}else o=h(g),p=setInterval(function(){var a=h(g);(o.width!=a.width||o.height!=a.height)&&(g.trigger("update.dot"),o=h(g))},100);return g},g.unwatch=function(){return a(window).unbind("resize.dot"+n.dotId),p&&clearInterval(p),g};var i=g.contents(),j=a.extend(!0,{},a.fn.dotdotdot.defaults,e),n={},o={},p=null,q=null;return n.afterElement=k(j.after,g),n.isTruncated=!1,n.dotId=b++,g.data("dotdotdot",!0).bind_events().trigger("update.dot"),j.watch&&g.watch(),g},a.fn.dotdotdot.defaults={ellipsis:"... ",wrap:"word",lastCharacter:{remove:[" ",",",";",".","!","?"],noEllipsis:[]},tolerance:0,callback:null,after:null,height:null,watch:!1,windowResizeFix:!0,debug:!1};var b=1,n=a.fn.html;a.fn.html=function(a){return a!==void 0?this.data("dotdotdot")&&"function"!=typeof a?this.trigger("update",[a]):n.call(this,a):n.call(this)};var o=a.fn.text;a.fn.text=function(b){if(b!==void 0){if(this.data("dotdotdot")){var c=a("
");return c.text(b),b=c.html(),c.remove(),this.trigger("update",[b])}return o.call(this,b)}return o.call(this)}}})(jQuery); -------------------------------------------------------------------------------- /doc/js/jquery.mousewheel.js: -------------------------------------------------------------------------------- 1 | /*! Copyright (c) 2013 Brandon Aaron (http://brandon.aaron.sh) 2 | * Licensed under the MIT License (LICENSE.txt). 3 | * 4 | * Version: 3.1.9 5 | * 6 | * Requires: jQuery 1.2.2+ 7 | */ 8 | 9 | (function (factory) { 10 | if ( typeof define === 'function' && define.amd ) { 11 | // AMD. Register as an anonymous module. 12 | define(['jquery'], factory); 13 | } else if (typeof exports === 'object') { 14 | // Node/CommonJS style for Browserify 15 | module.exports = factory; 16 | } else { 17 | // Browser globals 18 | factory(jQuery); 19 | } 20 | }(function ($) { 21 | 22 | var toFix = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'], 23 | toBind = ( 'onwheel' in document || document.documentMode >= 9 ) ? 24 | ['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'], 25 | slice = Array.prototype.slice, 26 | nullLowestDeltaTimeout, lowestDelta; 27 | 28 | if ( $.event.fixHooks ) { 29 | for ( var i = toFix.length; i; ) { 30 | $.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks; 31 | } 32 | } 33 | 34 | var special = $.event.special.mousewheel = { 35 | version: '3.1.9', 36 | 37 | setup: function() { 38 | if ( this.addEventListener ) { 39 | for ( var i = toBind.length; i; ) { 40 | this.addEventListener( toBind[--i], handler, false ); 41 | } 42 | } else { 43 | this.onmousewheel = handler; 44 | } 45 | // Store the line height and page height for this particular element 46 | $.data(this, 'mousewheel-line-height', special.getLineHeight(this)); 47 | $.data(this, 'mousewheel-page-height', special.getPageHeight(this)); 48 | }, 49 | 50 | teardown: function() { 51 | if ( this.removeEventListener ) { 52 | for ( var i = toBind.length; i; ) { 53 | this.removeEventListener( toBind[--i], handler, false ); 54 | } 55 | } else { 56 | this.onmousewheel = null; 57 | } 58 | }, 59 | 60 | getLineHeight: function(elem) { 61 | return parseInt($(elem)['offsetParent' in $.fn ? 'offsetParent' : 'parent']().css('fontSize'), 10); 62 | }, 63 | 64 | getPageHeight: function(elem) { 65 | return $(elem).height(); 66 | }, 67 | 68 | settings: { 69 | adjustOldDeltas: true 70 | } 71 | }; 72 | 73 | $.fn.extend({ 74 | mousewheel: function(fn) { 75 | return fn ? this.bind('mousewheel', fn) : this.trigger('mousewheel'); 76 | }, 77 | 78 | unmousewheel: function(fn) { 79 | return this.unbind('mousewheel', fn); 80 | } 81 | }); 82 | 83 | 84 | function handler(event) { 85 | var orgEvent = event || window.event, 86 | args = slice.call(arguments, 1), 87 | delta = 0, 88 | deltaX = 0, 89 | deltaY = 0, 90 | absDelta = 0; 91 | event = $.event.fix(orgEvent); 92 | event.type = 'mousewheel'; 93 | 94 | // Old school scrollwheel delta 95 | if ( 'detail' in orgEvent ) { deltaY = orgEvent.detail * -1; } 96 | if ( 'wheelDelta' in orgEvent ) { deltaY = orgEvent.wheelDelta; } 97 | if ( 'wheelDeltaY' in orgEvent ) { deltaY = orgEvent.wheelDeltaY; } 98 | if ( 'wheelDeltaX' in orgEvent ) { deltaX = orgEvent.wheelDeltaX * -1; } 99 | 100 | // Firefox < 17 horizontal scrolling related to DOMMouseScroll event 101 | if ( 'axis' in orgEvent && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) { 102 | deltaX = deltaY * -1; 103 | deltaY = 0; 104 | } 105 | 106 | // Set delta to be deltaY or deltaX if deltaY is 0 for backwards compatabilitiy 107 | delta = deltaY === 0 ? deltaX : deltaY; 108 | 109 | // New school wheel delta (wheel event) 110 | if ( 'deltaY' in orgEvent ) { 111 | deltaY = orgEvent.deltaY * -1; 112 | delta = deltaY; 113 | } 114 | if ( 'deltaX' in orgEvent ) { 115 | deltaX = orgEvent.deltaX; 116 | if ( deltaY === 0 ) { delta = deltaX * -1; } 117 | } 118 | 119 | // No change actually happened, no reason to go any further 120 | if ( deltaY === 0 && deltaX === 0 ) { return; } 121 | 122 | // Need to convert lines and pages to pixels if we aren't already in pixels 123 | // There are three delta modes: 124 | // * deltaMode 0 is by pixels, nothing to do 125 | // * deltaMode 1 is by lines 126 | // * deltaMode 2 is by pages 127 | if ( orgEvent.deltaMode === 1 ) { 128 | var lineHeight = $.data(this, 'mousewheel-line-height'); 129 | delta *= lineHeight; 130 | deltaY *= lineHeight; 131 | deltaX *= lineHeight; 132 | } else if ( orgEvent.deltaMode === 2 ) { 133 | var pageHeight = $.data(this, 'mousewheel-page-height'); 134 | delta *= pageHeight; 135 | deltaY *= pageHeight; 136 | deltaX *= pageHeight; 137 | } 138 | 139 | // Store lowest absolute delta to normalize the delta values 140 | absDelta = Math.max( Math.abs(deltaY), Math.abs(deltaX) ); 141 | 142 | if ( !lowestDelta || absDelta < lowestDelta ) { 143 | lowestDelta = absDelta; 144 | 145 | // Adjust older deltas if necessary 146 | if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) { 147 | lowestDelta /= 40; 148 | } 149 | } 150 | 151 | // Adjust older deltas if necessary 152 | if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) { 153 | // Divide all the things by 40! 154 | delta /= 40; 155 | deltaX /= 40; 156 | deltaY /= 40; 157 | } 158 | 159 | // Get a whole, normalized value for the deltas 160 | delta = Math[ delta >= 1 ? 'floor' : 'ceil' ](delta / lowestDelta); 161 | deltaX = Math[ deltaX >= 1 ? 'floor' : 'ceil' ](deltaX / lowestDelta); 162 | deltaY = Math[ deltaY >= 1 ? 'floor' : 'ceil' ](deltaY / lowestDelta); 163 | 164 | // Add information to the event object 165 | event.deltaX = deltaX; 166 | event.deltaY = deltaY; 167 | event.deltaFactor = lowestDelta; 168 | // Go ahead and set deltaMode to 0 since we converted to pixels 169 | // Although this is a little odd since we overwrite the deltaX/Y 170 | // properties with normalized deltas. 171 | event.deltaMode = 0; 172 | 173 | // Add event and delta to the front of the arguments 174 | args.unshift(event, delta, deltaX, deltaY); 175 | 176 | // Clearout lowestDelta after sometime to better 177 | // handle multiple device types that give different 178 | // a different lowestDelta 179 | // Ex: trackpad = 3 and mouse wheel = 120 180 | if (nullLowestDeltaTimeout) { clearTimeout(nullLowestDeltaTimeout); } 181 | nullLowestDeltaTimeout = setTimeout(nullLowestDelta, 200); 182 | 183 | return ($.event.dispatch || $.event.handle).apply(this, args); 184 | } 185 | 186 | function nullLowestDelta() { 187 | lowestDelta = null; 188 | } 189 | 190 | function shouldAdjustOldDeltas(orgEvent, absDelta) { 191 | // If this is an older event and the delta is divisable by 120, 192 | // then we are assuming that the browser is treating this as an 193 | // older mouse wheel event and that we should divide the deltas 194 | // by 40 to try and get a more usable deltaFactor. 195 | // Side note, this actually impacts the reported scroll distance 196 | // in older browsers and can cause scrolling to be slower than native. 197 | // Turn this off by setting $.event.special.mousewheel.settings.adjustOldDeltas to false. 198 | return special.settings.adjustOldDeltas && orgEvent.type === 'mousewheel' && absDelta % 120 === 0; 199 | } 200 | 201 | })); 202 | -------------------------------------------------------------------------------- /doc/js/jquery.smooth-scroll.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | function filterPath(string) { 3 | return string 4 | .replace(/^\//,'') 5 | .replace(/(index|default).[a-zA-Z]{3,4}$/,'') 6 | .replace(/\/$/,''); 7 | } 8 | var locationPath = filterPath(location.pathname); 9 | 10 | $('a[href*=#]').each(function() { 11 | var thisPath = filterPath(this.pathname) || locationPath; 12 | if ( locationPath == thisPath 13 | && (location.hostname == this.hostname || !this.hostname) 14 | && this.hash.replace(/#/,'') ) { 15 | var $target = $(this.hash), target = this.hash; 16 | if (target) { 17 | $(this).click(function(event) { 18 | if (!$(this.hash).offset()) { 19 | return; 20 | } 21 | 22 | event.preventDefault(); 23 | position = $(this.hash).offset().top; 24 | 25 | $('html,body').animate({scrollTop: position}, 400, function() { 26 | location.hash = target; 27 | }); 28 | }); 29 | } 30 | } 31 | }); 32 | }); 33 | -------------------------------------------------------------------------------- /doc/js/prism.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Prism: Lightweight, robust, elegant syntax highlighting 3 | * MIT license http://www.opensource.org/licenses/mit-license.php/ 4 | * @author Lea Verou http://lea.verou.me 5 | */(function(){var e=/\blang(?:uage)?-(?!\*)(\w+)\b/i,t=self.Prism={util:{type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},clone:function(e){var n=t.util.type(e);switch(n){case"Object":var r={};for(var i in e)e.hasOwnProperty(i)&&(r[i]=t.util.clone(e[i]));return r;case"Array":return e.slice()}return e}},languages:{extend:function(e,n){var r=t.util.clone(t.languages[e]);for(var i in n)r[i]=n[i];return r},insertBefore:function(e,n,r,i){i=i||t.languages;var s=i[e],o={};for(var u in s)if(s.hasOwnProperty(u)){if(u==n)for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);o[u]=s[u]}return i[e]=o},DFS:function(e,n){for(var r in e){n.call(e,r,e[r]);t.util.type(e)==="Object"&&t.languages.DFS(e[r],n)}}},highlightAll:function(e,n){var r=document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code');for(var i=0,s;s=r[i++];)t.highlightElement(s,e===!0,n)},highlightElement:function(r,i,s){var o,u,a=r;while(a&&!e.test(a.className))a=a.parentNode;if(a){o=(a.className.match(e)||[,""])[1];u=t.languages[o]}if(!u)return;r.className=r.className.replace(e,"").replace(/\s+/g," ")+" language-"+o;a=r.parentNode;/pre/i.test(a.nodeName)&&(a.className=a.className.replace(e,"").replace(/\s+/g," ")+" language-"+o);var f=r.textContent;if(!f)return;f=f.replace(/&/g,"&").replace(/e.length)break e;if(p instanceof i)continue;a.lastIndex=0;var d=a.exec(p);if(d){l&&(c=d[1].length);var v=d.index-1+c,d=d[0].slice(c),m=d.length,g=v+m,y=p.slice(0,v+1),b=p.slice(g+1),w=[h,1];y&&w.push(y);var E=new i(u,f?t.tokenize(d,f):d);w.push(E);b&&w.push(b);Array.prototype.splice.apply(s,w)}}}return s},hooks:{all:{},add:function(e,n){var r=t.hooks.all;r[e]=r[e]||[];r[e].push(n)},run:function(e,n){var r=t.hooks.all[e];if(!r||!r.length)return;for(var i=0,s;s=r[i++];)s(n)}}},n=t.Token=function(e,t){this.type=e;this.content=t};n.stringify=function(e,r,i){if(typeof e=="string")return e;if(Object.prototype.toString.call(e)=="[object Array]")return e.map(function(t){return n.stringify(t,r,e)}).join("");var s={type:e.type,content:n.stringify(e.content,r,i),tag:"span",classes:["token",e.type],attributes:{},language:r,parent:i};s.type=="comment"&&(s.attributes.spellcheck="true");t.hooks.run("wrap",s);var o="";for(var u in s.attributes)o+=u+'="'+(s.attributes[u]||"")+'"';return"<"+s.tag+' class="'+s.classes.join(" ")+'" '+o+">"+s.content+""};if(!self.document){self.addEventListener("message",function(e){var n=JSON.parse(e.data),r=n.language,i=n.code;self.postMessage(JSON.stringify(t.tokenize(i,t.languages[r])));self.close()},!1);return}var r=document.getElementsByTagName("script");r=r[r.length-1];if(r){t.filename=r.src;document.addEventListener&&!r.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",t.highlightAll)}})();; 6 | Prism.languages.markup={comment:/<!--[\w\W]*?-->/g,prolog:/<\?.+?\?>/,doctype:/<!DOCTYPE.+?>/,cdata:/<!\[CDATA\[[\w\W]*?]]>/i,tag:{pattern:/<\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|\w+))?\s*)*\/?>/gi,inside:{tag:{pattern:/^<\/?[\w:-]+/i,inside:{punctuation:/^<\/?/,namespace:/^[\w-]+?:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/gi,inside:{punctuation:/=|>|"/g}},punctuation:/\/?>/g,"attr-name":{pattern:/[\w:-]+/g,inside:{namespace:/^[\w-]+?:/}}}},entity:/&#?[\da-z]{1,8};/gi};Prism.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&/,"&"))});; 7 | Prism.languages.css={comment:/\/\*[\w\W]*?\*\//g,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*{))/gi,inside:{punctuation:/[;:]/g}},url:/url\((["']?).*?\1\)/gi,selector:/[^\{\}\s][^\{\};]*(?=\s*\{)/g,property:/(\b|\B)[\w-]+(?=\s*:)/ig,string:/("|')(\\?.)*?\1/g,important:/\B!important\b/gi,ignore:/&(lt|gt|amp);/gi,punctuation:/[\{\};:]/g};Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{style:{pattern:/(<|<)style[\w\W]*?(>|>)[\w\W]*?(<|<)\/style(>|>)/ig,inside:{tag:{pattern:/(<|<)style[\w\W]*?(>|>)|(<|<)\/style(>|>)/ig,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.css}}});; 8 | Prism.languages.css.selector={pattern:/[^\{\}\s][^\{\}]*(?=\s*\{)/g,inside:{"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/g,"pseudo-class":/:[-\w]+(?:\(.*\))?/g,"class":/\.[-:\.\w]+/g,id:/#[-:\.\w]+/g}};Prism.languages.insertBefore("css","ignore",{hexcode:/#[\da-f]{3,6}/gi,entity:/\\[\da-f]{1,8}/gi,number:/[\d%\.]+/g,"function":/(attr|calc|cross-fade|cycle|element|hsla?|image|lang|linear-gradient|matrix3d|matrix|perspective|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|rgba?|rotatex|rotatey|rotatez|rotate3d|rotate|scalex|scaley|scalez|scale3d|scale|skewx|skewy|skew|steps|translatex|translatey|translatez|translate3d|translate|url|var)/ig});; 9 | Prism.languages.clike={comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|(^|[^:])\/\/.*?(\r?\n|$))/g,lookbehind:!0},string:/("|')(\\?.)*?\1/g,"class-name":{pattern:/((?:(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/ig,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|catch|finally|null|break|continue)\b/g,"boolean":/\b(true|false)\b/g,"function":{pattern:/[a-z0-9_]+\(/ig,inside:{punctuation:/\(/}}, number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/g,operator:/[-+]{1,2}|!|<=?|>=?|={1,3}|(&){1,2}|\|?\||\?|\*|\/|\~|\^|\%/g,ignore:/&(lt|gt|amp);/gi,punctuation:/[{}[\];(),.:]/g};; 10 | Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(var|let|if|else|while|do|for|return|in|instanceof|function|new|with|typeof|try|catch|finally|null|break|continue)\b/g,number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?|NaN|-?Infinity)\b/g});Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/g,lookbehind:!0}});Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/(<|<)script[\w\W]*?(>|>)[\w\W]*?(<|<)\/script(>|>)/ig,inside:{tag:{pattern:/(<|<)script[\w\W]*?(>|>)|(<|<)\/script(>|>)/ig,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.javascript}}});; 11 | Prism.languages.php=Prism.languages.extend("clike",{keyword:/\b(and|or|xor|array|as|break|case|cfunction|class|const|continue|declare|default|die|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|for|foreach|function|include|include_once|global|if|new|return|static|switch|use|require|require_once|var|while|abstract|interface|public|implements|extends|private|protected|parent|static|throw|null|echo|print|trait|namespace|use|final|yield|goto|instanceof|finally|try|catch)\b/ig, constant:/\b[A-Z0-9_]{2,}\b/g});Prism.languages.insertBefore("php","keyword",{delimiter:/(\?>|<\?php|<\?)/ig,variable:/(\$\w+)\b/ig,"package":{pattern:/(\\|namespace\s+|use\s+)[\w\\]+/g,lookbehind:!0,inside:{punctuation:/\\/}}});Prism.languages.insertBefore("php","operator",{property:{pattern:/(->)[\w]+/g,lookbehind:!0}}); Prism.languages.markup&&(Prism.hooks.add("before-highlight",function(a){"php"===a.language&&(a.tokenStack=[],a.code=a.code.replace(/(?:<\?php|<\?|<\?php|<\?)[\w\W]*?(?:\?>|\?>)/ig,function(b){a.tokenStack.push(b);return"{{{PHP"+a.tokenStack.length+"}}}"}))}),Prism.hooks.add("after-highlight",function(a){if("php"===a.language){for(var b=0,c;c=a.tokenStack[b];b++)a.highlightedCode=a.highlightedCode.replace("{{{PHP"+(b+1)+"}}}",Prism.highlight(c,a.grammar,"php"));a.element.innerHTML=a.highlightedCode}}), Prism.hooks.add("wrap",function(a){"php"===a.language&&"markup"===a.type&&(a.content=a.content.replace(/(\{\{\{PHP[0-9]+\}\}\})/g,'$1'))}),Prism.languages.insertBefore("php","comment",{markup:{pattern:/(<|<)[^?]\/?(.*?)(>|>)/g,inside:Prism.languages.markup},php:/\{\{\{PHP[0-9]+\}\}\}/g}));; 12 | Prism.languages.insertBefore("php","variable",{"this":/\$this/g,global:/\$_?(GLOBALS|SERVER|GET|POST|FILES|REQUEST|SESSION|ENV|COOKIE|HTTP_RAW_POST_DATA|argc|argv|php_errormsg|http_response_header)/g,scope:{pattern:/\b[\w\\]+::/g,inside:{keyword:/(static|self|parent)/,punctuation:/(::|\\)/}}});; 13 | (function(){function e(e,t){return Array.prototype.slice.call((t||document).querySelectorAll(e))}function n(e,t,n){var r=t.replace(/\s+/g,"").split(","),i=+e.getAttribute("data-line-offset")||0,s=parseFloat(getComputedStyle(e).lineHeight);for(var o=0,u;u=r[o++];){u=u.split("-");var a=+u[0],f=+u[1]||a,l=document.createElement("div");l.textContent=Array(f-a+2).join(" \r\n");l.className=(n||"")+" line-highlight";l.setAttribute("data-start",a);f>a&&l.setAttribute("data-end",f);l.style.top=(a-i-1)*s+"px";(e.querySelector("code")||e).appendChild(l)}}function r(){var t=location.hash.slice(1);e(".temporary.line-highlight").forEach(function(e){e.parentNode.removeChild(e)});var r=(t.match(/\.([\d,-]+)$/)||[,""])[1];if(!r||document.getElementById(t))return;var i=t.slice(0,t.lastIndexOf(".")),s=document.getElementById(i);if(!s)return;s.hasAttribute("data-line")||s.setAttribute("data-line","");n(s,r,"temporary ");document.querySelector(".temporary.line-highlight").scrollIntoView()}if(!window.Prism)return;var t=crlf=/\r?\n|\r/g,i=0;Prism.hooks.add("after-highlight",function(t){var s=t.element.parentNode,o=s&&s.getAttribute("data-line");if(!s||!o||!/pre/i.test(s.nodeName))return;clearTimeout(i);e(".line-highlight",s).forEach(function(e){e.parentNode.removeChild(e)});n(s,o);i=setTimeout(r,1)});addEventListener("hashchange",r)})();; 14 | Prism.hooks.add("after-highlight",function(e){var t=e.element.parentNode;if(!t||!/pre/i.test(t.nodeName)||t.className.indexOf("line-numbers")===-1){return}var n=1+e.code.split("\n").length;var r;lines=new Array(n);lines=lines.join("");r=document.createElement("span");r.className="line-numbers-rows";r.innerHTML=lines;if(t.hasAttribute("data-start")){t.style.counterReset="linenumber "+(parseInt(t.getAttribute("data-start"),10)-1)}e.element.appendChild(r)}) 15 | ; 16 | (function(){if(!self.Prism||!self.document||!document.querySelector)return;var e={js:"javascript",html:"markup",svg:"markup"};Array.prototype.slice.call(document.querySelectorAll("pre[data-src]")).forEach(function(t){var n=t.getAttribute("data-src"),r=(n.match(/\.(\w+)$/)||[,""])[1],i=e[r]||r,s=document.createElement("code");s.className="language-"+i;t.textContent="";s.textContent="Loading…";t.appendChild(s);var o=new XMLHttpRequest;o.open("GET",n,!0);o.onreadystatechange=function(){if(o.readyState==4)if(o.status<400&&o.responseText){s.textContent=o.responseText;Prism.highlightElement(s)}else o.status>=400?s.textContent="✖ Error "+o.status+" while fetching file: "+o.statusText:s.textContent="✖ Error: File does not exist or is empty"};o.send(null)})})();; 17 | -------------------------------------------------------------------------------- /doc/namespaces/default.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | API Documentation 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 84 | 85 |
86 |
87 | 107 |
108 |
109 |
110 |
111 |
112 | 115 |

\

116 | 117 | 118 | 119 | 120 |

Classes

121 | 122 | 123 | 124 | 125 | 126 |
phpListRESTApiClientexample PHP client class to access the phpList Rest API.
127 |
128 | 129 | 137 |
138 | 139 | 140 | 141 |
142 |
143 | 144 |
145 |
146 |
147 |
148 | 174 |
175 |
176 |
177 |
178 |
179 | Documentation is powered by phpDocumentor and authored 180 | on November 18th, 2015 at 14:27. 181 |
182 |
183 |
184 |
185 |
186 | 187 | 188 | 189 | -------------------------------------------------------------------------------- /doc/phpdoc-cache-07/phpdoc-cache-file_1d19d16db26de73856794b92fe2cd5df.dat: -------------------------------------------------------------------------------- 1 | O:39:"phpDocumentor\Descriptor\FileDescriptor":22:{s:7:"*hash";s:32:"7705fb8f5f9625e9a6b7ec0c4d992606";s:7:"*path";s:11:"example.php";s:9:"*source";s:1842:"tmpPath = '/var/tmp'; 20 | 21 | $subscriberEmail = 'phplistTest@mailinator.com'; 22 | 23 | if ($phpList->login()) { 24 | $newListID = $phpList->listAdd('list '.rand(0, 100), 'This is a list made with the example code'); 25 | print 'Our new list has ID '.$newListID.PHP_EOL; 26 | 27 | $subscriberID = $phpList->subscriberFindByEmail($subscriberEmail); 28 | 29 | if (!empty($subscriberID)) { 30 | $phpList->listSubscriberAdd($newListID, $subscriberID); 31 | print "Subscriber $subscriberID has been added to the list".PHP_EOL; 32 | } else { 33 | $subscriberID = $phpList->subscribe($subscriberEmail, $newListID); 34 | print "Subscriber has been subscribed to the list with ID $subscriberID".PHP_EOL; 35 | } 36 | 37 | $lists = $phpList->listsSubscriber($subscriberID); 38 | print 'The subscriber is now member of '.PHP_EOL; 39 | foreach ($lists as $list) { 40 | print "\t".$list->id.' '.$list->name.PHP_EOL; 41 | } 42 | 43 | print 'Removing subscriber from the list'.PHP_EOL; 44 | $lists = $phpList->listSubscriberDelete($newListID, $subscriberID); 45 | print 'The subscriber is now member of '.PHP_EOL; 46 | foreach ($lists as $list) { 47 | print "\t".$list->id.' '.$list->name.PHP_EOL; 48 | } 49 | 50 | print 'And adding the subscriber to the list again'.PHP_EOL; 51 | $lists = $phpList->listSubscriberAdd($newListID, $subscriberID); 52 | print 'The subscriber is now member of '.PHP_EOL; 53 | foreach ($lists as $list) { 54 | print "\t".$list->id.' '.$list->name.PHP_EOL; 55 | } 56 | } 57 | ";s:19:"*namespaceAliases";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:11:"*includes";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:41:"phpDocumentor\Reflection\IncludeReflector":3:{s:7:"*node";O:27:"PHPParser_Node_Expr_Include":2:{s:11:"*subNodes";a:2:{s:4:"expr";O:28:"PHPParser_Node_Scalar_String":2:{s:11:"*subNodes";a:1:{s:5:"value";s:24:"phpListRESTApiClient.php";}s:13:"*attributes";a:3:{s:9:"startLine";i:12;s:7:"endLine";i:12;s:13:"originalValue";s:26:"'phpListRESTApiClient.php'";}}s:4:"type";i:2;}s:13:"*attributes";a:4:{s:8:"comments";a:1:{i:0;O:21:"PHPParser_Comment_Doc":2:{s:7:"*text";s:155:"/** 58 | * 59 | * example code for using the phpList API Client 60 | * 61 | * For more information, visit https://github.com/michield/phplist-restapi-client 62 | * 63 | * 64 | */";s:7:"*line";i:3;}}s:9:"startLine";i:12;s:7:"endLine";i:12;s:13:"originalValue";s:26:"'phpListRESTApiClient.php'";}}s:23:"*default_package_name";s:0:"";s:10:"*context";O:41:"phpDocumentor\Reflection\DocBlock\Context":3:{s:12:"*namespace";s:0:"";s:20:"*namespace_aliases";a:0:{}s:7:"*lsen";s:0:"";}}}}s:12:"*constants";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:12:"*functions";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:10:"*classes";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:13:"*interfaces";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:9:"*traits";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:10:"*markers";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:8:"*fqsen";s:0:"";s:7:"*name";s:11:"example.php";s:12:"*namespace";N;s:10:"*package";s:7:"Default";s:10:"*summary";s:0:"";s:14:"*description";s:0:"";s:17:"*fileDescriptor";N;s:7:"*line";i:0;s:7:"*tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:2:{s:7:"package";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:38:"phpDocumentor\Descriptor\TagDescriptor":3:{s:7:"*name";s:7:"package";s:14:"*description";s:7:"Default";s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}}}s:10:"subpackage";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:40:"phpDocumentor\Descriptor\Validator\Error":4:{s:11:"*severity";s:5:"error";s:7:"*code";s:13:"PPC:ERR-50000";s:7:"*line";i:0;s:10:"*context";a:2:{s:11:"{{ value }}";s:2:"""";i:0;s:0:"";}}}}s:19:"*inheritedElement";N;} -------------------------------------------------------------------------------- /doc/phpdoc-cache-2e/phpdoc-cache-settings.dat: -------------------------------------------------------------------------------- 1 | O:51:"phpDocumentor\Descriptor\ProjectDescriptor\Settings":2:{s:13:"*isModified";b:0;s:13:"*visibility";i:7;} -------------------------------------------------------------------------------- /doc/reports/deprecated.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | » Deprecated elements 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 85 | 86 |
87 |
88 | 89 | 94 | 95 |
96 | 100 | 101 |
102 |
No deprecated elements have been found in this project.
103 | 104 |
105 |
106 |
107 |
108 | 109 |
110 |
111 |
112 |
113 | 139 |
140 |
141 |
142 |
143 |
144 | Documentation is powered by phpDocumentor and authored 145 | on November 18th, 2015 at 14:27. 146 |
147 |
148 |
149 |
150 |
151 | 152 | 153 | 154 | -------------------------------------------------------------------------------- /doc/reports/errors.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | » Compilation errors 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 85 | 86 |
87 |
88 | 95 | 96 |
97 | 101 | 102 | 103 |
104 | 105 |

106 | 107 | example.php 108 | 1 109 |

110 |
111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 |
TypeLineDescription
error0No summary was found for this file
127 |
128 |
129 |
130 |
131 |
132 |
133 | 134 |
135 |
136 |
137 |
138 | 164 |
165 |
166 |
167 |
168 |
169 | Documentation is powered by phpDocumentor and authored 170 | on November 18th, 2015 at 14:27. 171 |
172 |
173 |
174 |
175 |
176 | 177 | 178 | 179 | -------------------------------------------------------------------------------- /doc/reports/markers.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | » Markers 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 85 | 86 |
87 |
88 | 93 | 94 |
95 | 96 | 100 | 101 |
No markers have been found in this project.
102 | 103 |
104 |
105 |
106 |
107 | 108 |
109 |
110 |
111 |
112 | 138 |
139 |
140 |
141 |
142 |
143 | Documentation is powered by phpDocumentor and authored 144 | on November 18th, 2015 at 14:27. 145 |
146 |
147 |
148 |
149 |
150 | 151 | 152 | 153 | -------------------------------------------------------------------------------- /example.php: -------------------------------------------------------------------------------- 1 | tmpPath = '/var/tmp'; 20 | 21 | $subscriberEmail = 'phplistTest@mailinator.com'; 22 | 23 | if ($phpList->login()) { 24 | $newListID = $phpList->listAdd('list '.rand(0, 100), 'This is a list made with the example code'); 25 | print 'Our new list has ID '.$newListID.PHP_EOL; 26 | 27 | $subscriberID = $phpList->subscriberFindByEmail($subscriberEmail); 28 | 29 | if (!empty($subscriberID)) { 30 | $phpList->listSubscriberAdd($newListID, $subscriberID); 31 | print "Subscriber $subscriberID has been added to the list".PHP_EOL; 32 | } else { 33 | $subscriberID = $phpList->subscribe($subscriberEmail, $newListID); 34 | print "Subscriber has been subscribed to the list with ID $subscriberID".PHP_EOL; 35 | } 36 | 37 | $lists = $phpList->listsSubscriber($subscriberID); 38 | print 'The subscriber is now member of '.PHP_EOL; 39 | foreach ($lists as $list) { 40 | print "\t".$list->id.' '.$list->name.PHP_EOL; 41 | } 42 | 43 | print 'Removing subscriber from the list'.PHP_EOL; 44 | $lists = $phpList->listSubscriberDelete($newListID, $subscriberID); 45 | print 'The subscriber is now member of '.PHP_EOL; 46 | foreach ($lists as $list) { 47 | print "\t".$list->id.' '.$list->name.PHP_EOL; 48 | } 49 | 50 | print 'And adding the subscriber to the list again'.PHP_EOL; 51 | $lists = $phpList->listSubscriberAdd($newListID, $subscriberID); 52 | print 'The subscriber is now member of '.PHP_EOL; 53 | foreach ($lists as $list) { 54 | print "\t".$list->id.' '.$list->name.PHP_EOL; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /phpListRESTApiClient.php: -------------------------------------------------------------------------------- 1 | url = $url; 67 | $this->loginName = $loginName; 68 | $this->password = $password; 69 | $this->remoteProcessingSecret = $secret; 70 | } 71 | 72 | /** 73 | * Make a call to the API using cURL. 74 | * 75 | * @param string $command The command to run 76 | * @param array $post_params Array for parameters for the API call 77 | * @param bool $decode json_decode the result (defaults to true) 78 | * 79 | * @return string result of the CURL execution 80 | */ 81 | private function callApi($command, $post_params, $decode = true, $newSession = false) 82 | { 83 | $post_params['cmd'] = $command; 84 | 85 | // optionally add the secret to a call, if provided 86 | if (!empty($this->remoteProcessingSecret)) { 87 | $post_params['secret'] = $this->remoteProcessingSecret; 88 | } 89 | $post_params = http_build_query($post_params); 90 | $c = curl_init(); 91 | curl_setopt($c, CURLOPT_URL, $this->url); 92 | curl_setopt($c, CURLOPT_HEADER, 0); 93 | curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); 94 | curl_setopt($c, CURLOPT_POST, 1); 95 | curl_setopt($c, CURLOPT_POSTFIELDS, $post_params); 96 | curl_setopt($c, CURLOPT_COOKIEFILE, $this->tmpPath.'/phpList_RESTAPI_cookiejar.txt'); 97 | curl_setopt($c, CURLOPT_COOKIEJAR, $this->tmpPath.'/phpList_RESTAPI_cookiejar.txt'); 98 | curl_setopt($c, CURLOPT_COOKIESESSION, $newSession); // Fix for random failed authentication 99 | curl_setopt($c, CURLOPT_HTTPHEADER, array('Connection: Keep-Alive', 'Keep-Alive: 60')); 100 | 101 | // Execute the call 102 | $result = curl_exec($c); 103 | // Check if decoding of result is required 104 | if ($decode === true) { 105 | $result = json_decode($result); 106 | } 107 | 108 | return $result; 109 | } 110 | 111 | /** 112 | * Use a real login to test login api call. 113 | * 114 | * @param none 115 | * 116 | * @return bool true if user exists and login successful 117 | */ 118 | public function login() 119 | { 120 | // Set the username and pwd to login with 121 | $post_params = array( 122 | 'login' => $this->loginName, 123 | 'password' => $this->password, 124 | ); 125 | 126 | // Execute the login with the credentials as params 127 | $result = $this->callApi('login', $post_params, true, true); 128 | return $result->status == 'success'; 129 | } 130 | 131 | /** 132 | * Create a list. 133 | * 134 | * @param string $listName Name of the list 135 | * @param string $listDescription Description of the list 136 | * 137 | * @return int ListId of the list created 138 | */ 139 | public function listAdd($listName, $listDescription) 140 | { 141 | // Create minimal params for api call 142 | $post_params = array( 143 | 'name' => $listName, 144 | 'description' => $listDescription, 145 | 'listorder' => '0', 146 | 'active' => '1', 147 | ); 148 | 149 | // Execute the api call 150 | $result = $this->callAPI('listAdd', $post_params); 151 | 152 | // get the ID of the list we just created 153 | $listId = $result->data->id; 154 | 155 | return $listId; 156 | } 157 | 158 | /** 159 | * Get all lists. 160 | * 161 | * @return array All lists 162 | */ 163 | public function listsGet() 164 | { 165 | // Create minimal params for api call 166 | $post_params = array( 167 | ); 168 | 169 | // Execute the api call 170 | $result = $this->callAPI('listsGet', $post_params); 171 | 172 | // Return all list as array 173 | return $result->data; 174 | } 175 | 176 | /** 177 | * Find a subscriber by email address. 178 | * 179 | * @param string $emailAddress Email address to search 180 | * 181 | * @return int $subscriberID if found false if not found 182 | */ 183 | public function subscriberFindByEmail($emailAddress) 184 | { 185 | $params = array( 186 | 'email' => $emailAddress, 187 | ); 188 | $result = $this->callAPI('subscriberGetByEmail', $params); 189 | 190 | if (!empty($result->data->id)) { 191 | return $result->data->id; 192 | } else { 193 | return false; 194 | } 195 | } 196 | 197 | /** 198 | * Add a subscriber. 199 | * 200 | * This is the main method to use to add a subscriber. It will add the subscriber as 201 | * a non-confirmed subscriber in phpList and it will send the Request-for-confirmation 202 | * email as set up in phpList. 203 | * 204 | * The lists parameter will set the lists the subscriber will be added to. This has 205 | * to be comma-separated list-IDs, eg "1,2,3,4". 206 | * 207 | * @param string $emailAddress email address of the subscriber to add 208 | * @param string $lists comma-separated list of IDs of the lists to add the subscriber to 209 | * 210 | * @return int $subscriberId if added, or false if failed 211 | */ 212 | public function subscribe($emailAddress, $lists) 213 | { 214 | // Set the user details as parameters 215 | $post_params = array( 216 | 'email' => $emailAddress, 217 | 'foreignkey' => '', 218 | 'htmlemail' => 1, 219 | 'subscribepage' => 0, 220 | 'lists' => $lists, 221 | ); 222 | 223 | // Execute the api call 224 | $result = $this->callAPI('subscribe', $post_params); 225 | 226 | if (!empty($result->data->id)) { 227 | $subscriberId = $result->data->id; 228 | 229 | return $subscriberId; 230 | } else { 231 | return false; 232 | } 233 | } 234 | 235 | /** 236 | * Fetch subscriber by ID. 237 | * 238 | * @param int $subscriberID ID of the subscriber 239 | * 240 | * @return the subscriber 241 | */ 242 | public function subscriberGet($subscriberId) 243 | { 244 | $post_params = array( 245 | 'id' => $subscriberId, 246 | ); 247 | 248 | // Execute the api call 249 | $result = $this->callAPI('subscriberGet', $post_params); 250 | if (!empty($result->data->id)) { 251 | $fetchedSubscriberId = $result->data->id; 252 | $this->assertEquals($fetchedSubscriberId, $subscriberId); 253 | 254 | return $result->data; 255 | } else { 256 | return false; 257 | } 258 | } 259 | 260 | /** 261 | * Get a subscriber by Foreign Key. 262 | * 263 | * Note the difference with subscriberFindByEmail which only returns the SubscriberID 264 | * Both API calls return the subscriber 265 | * 266 | * @param string $foreignKey Foreign Key to search 267 | * 268 | * @return subscriber object if found false if not found 269 | */ 270 | public function subscriberGetByForeignkey($foreignKey) 271 | { 272 | $post_params = array( 273 | 'foreignkey' => $foreignKey, 274 | ); 275 | 276 | $result = $this->callAPI('subscriberGetByForeignkey', $post_params); 277 | if (!empty($result->data->id)) { 278 | return $result->data; 279 | } else { 280 | return false; 281 | } 282 | } 283 | 284 | /** 285 | * Get the total number of subscribers. 286 | * 287 | * @param none 288 | * 289 | * @return int total number of subscribers in the system 290 | */ 291 | public function subscriberCount() 292 | { 293 | $post_params = array( 294 | ); 295 | 296 | $result = $this->callAPI('subscribersCount', $post_params); 297 | 298 | return $result->data->total; 299 | } 300 | 301 | /** 302 | * Add a subscriber to an existing list. 303 | * 304 | * @param int $listId ID of the list 305 | * @param int $subscriberId ID of the subscriber 306 | * 307 | * @return the lists this subscriber is member of 308 | */ 309 | public function listSubscriberAdd($listId, $subscriberId) 310 | { 311 | // Set list and subscriber vars 312 | $post_params = array( 313 | 'list_id' => $listId, 314 | 'subscriber_id' => $subscriberId, 315 | ); 316 | 317 | $result = $this->callAPI('listSubscriberAdd', $post_params); 318 | 319 | return $result->data; 320 | } 321 | 322 | /** 323 | * Get the lists a subscriber is member of. 324 | * 325 | * @param int $subscriberId ID of the subscriber 326 | * 327 | * @return the lists this subcriber is member of 328 | */ 329 | public function listsSubscriber($subscriberId) 330 | { 331 | $post_params = array( 332 | 'subscriber_id' => $subscriberId, 333 | ); 334 | 335 | $result = $this->callAPI('listsSubscriber', $post_params); 336 | 337 | return $result->data; 338 | } 339 | 340 | /** 341 | * Remove a Subscriber from a list. 342 | * 343 | * @param int $listId ID of the list to remove 344 | * @param int $subscriberId ID of the subscriber 345 | * 346 | * @return the lists this subcriber is member of 347 | */ 348 | public function listSubscriberDelete($listId, $subscriberId) 349 | { 350 | // Set list and subscriber vars 351 | $post_params = array( 352 | 'list_id' => $listId, 353 | 'subscriber_id' => $subscriberId, 354 | ); 355 | 356 | $result = $this->callAPI('listSubscriberDelete', $post_params); 357 | 358 | return $result->data; 359 | } 360 | } 361 | --------------------------------------------------------------------------------