|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | +<head> |
| 4 | + <meta charset="utf-8"> |
| 5 | + <title>LaunchDarkly PHP SDK phpredis integration 1.0.0</title> |
| 6 | + <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 7 | + <base href="../"> |
| 8 | + <link rel="icon" href="images/favicon.ico"/> |
| 9 | + <link rel="stylesheet" href="css/normalize.css"> |
| 10 | + <link rel="stylesheet" href="css/base.css"> |
| 11 | + <link rel="preconnect" href="https://fonts.gstatic.com"> |
| 12 | + <link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&display=swap" rel="stylesheet"> |
| 13 | + <link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet"> |
| 14 | + <link rel="stylesheet" href="css/template.css"> |
| 15 | + <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" /> |
| 16 | + <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css"> |
| 17 | + <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css"> |
| 18 | + <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css"> |
| 19 | + <script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script> |
| 20 | + <script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script> |
| 21 | + <script src="js/search.js"></script> |
| 22 | + <script defer src="js/searchIndex.js"></script> |
| 23 | + </head> |
| 24 | +<body id="top"> |
| 25 | + <header class="phpdocumentor-header phpdocumentor-section"> |
| 26 | + <h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">LaunchDarkly PHP SDK phpredis integration 1.0.0</a></h1> |
| 27 | + <input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" /> |
| 28 | + <label class="phpdocumentor-header__menu-icon" for="menu-button"> |
| 29 | + <i class="fas fa-bars"></i> |
| 30 | + </label> |
| 31 | + <section data-search-form class="phpdocumentor-search"> |
| 32 | + <label> |
| 33 | + <span class="visually-hidden">Search for</span> |
| 34 | + <svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg"> |
| 35 | + <circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/> |
| 36 | + <line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/> |
| 37 | + </svg> |
| 38 | + <input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled /> |
| 39 | + </label> |
| 40 | +</section> |
| 41 | + |
| 42 | + <nav class="phpdocumentor-topnav"> |
| 43 | + <ul class="phpdocumentor-topnav__menu"> |
| 44 | + </ul> |
| 45 | +</nav> |
| 46 | +</header> |
| 47 | + |
| 48 | + <main class="phpdocumentor"> |
| 49 | + <div class="phpdocumentor-section"> |
| 50 | + <input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" /> |
| 51 | +<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button"> |
| 52 | + Menu |
| 53 | +</label> |
| 54 | +<aside class="phpdocumentor-column -four phpdocumentor-sidebar"> |
| 55 | + |
| 56 | + <section class="phpdocumentor-sidebar__category"> |
| 57 | + <h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2> |
| 58 | + <h4 class="phpdocumentor-sidebar__root-namespace"><a href="namespaces/launchdarkly.html"><abbr title="\LaunchDarkly">LaunchDarkly</abbr></a></h4> |
| 59 | + <ul class="phpdocumentor-list"> |
| 60 | + <li><a href="namespaces/launchdarkly-impl.html"><abbr title="\LaunchDarkly\Impl">Impl</abbr></a></li> |
| 61 | + <li><a href="namespaces/launchdarkly-integrations.html"><abbr title="\LaunchDarkly\Integrations">Integrations</abbr></a></li> |
| 62 | + </ul> |
| 63 | + </section> |
| 64 | + |
| 65 | + <section class="phpdocumentor-sidebar__category"> |
| 66 | + <h2 class="phpdocumentor-sidebar__category-header">Packages</h2> |
| 67 | + <h3 class="phpdocumentor-sidebar__root-package"><a href="packages/SDK.html"><abbr title="\SDK">SDK</abbr></a></h3> |
| 68 | + </section> |
| 69 | + |
| 70 | + <section class="phpdocumentor-sidebar__category"> |
| 71 | + <h2 class="phpdocumentor-sidebar__category-header">Reports</h2> |
| 72 | + <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3> |
| 73 | + <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3> |
| 74 | + <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3> |
| 75 | + </section> |
| 76 | + |
| 77 | + <section class="phpdocumentor-sidebar__category"> |
| 78 | + <h2 class="phpdocumentor-sidebar__category-header">Indices</h2> |
| 79 | + <h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3> |
| 80 | + </section> |
| 81 | +</aside> |
| 82 | + |
| 83 | + <div class="phpdocumentor-column -eight phpdocumentor-content"> |
| 84 | + <ul class="phpdocumentor-breadcrumbs"> |
| 85 | + <li class="phpdocumentor-breadcrumb"><a href="namespaces/launchdarkly.html">LaunchDarkly</a></li> |
| 86 | + <li class="phpdocumentor-breadcrumb"><a href="namespaces/launchdarkly-integrations.html">Integrations</a></li> |
| 87 | + </ul> |
| 88 | + |
| 89 | + <article class="phpdocumentor-element -class"> |
| 90 | + <h2 class="phpdocumentor-content__title"> |
| 91 | + PHPRedis |
| 92 | + |
| 93 | + |
| 94 | + <div class="phpdocumentor-element__package"> |
| 95 | + in package |
| 96 | + <ul class="phpdocumentor-breadcrumbs"> |
| 97 | + <li class="phpdocumentor-breadcrumb"><a href="packages/SDK.html">SDK</a></li> |
| 98 | + </ul> |
| 99 | + </div> |
| 100 | + |
| 101 | + |
| 102 | + </h2> |
| 103 | + |
| 104 | + <aside class="phpdocumentor-element-found-in"> |
| 105 | + <abbr class="phpdocumentor-element-found-in__file" title="LaunchDarkly/Integrations/PHPRedis.php"><a href="files/launchdarkly-integrations-phpredis.html"><abbr title="LaunchDarkly/Integrations/PHPRedis.php">PHPRedis.php</abbr></a></abbr> |
| 106 | + : |
| 107 | + <span class="phpdocumentor-element-found-in__line">9</span> |
| 108 | + |
| 109 | + </aside> |
| 110 | + |
| 111 | + <p class="phpdocumentor-summary">Integration with a Redis data store using the `phpredis` extension.</p> |
| 112 | + |
| 113 | + |
| 114 | + |
| 115 | + |
| 116 | + |
| 117 | + |
| 118 | + |
| 119 | + |
| 120 | + |
| 121 | +<h3 id="toc"> |
| 122 | + Table of Contents |
| 123 | + <a href="#toc" class="headerlink"><i class="fas fa-link"></i></a> |
| 124 | +</h3> |
| 125 | + |
| 126 | +<dl class="phpdocumentor-table-of-contents"> |
| 127 | + <dt class="phpdocumentor-table-of-contents__entry -method -public"> |
| 128 | + <a href="classes/LaunchDarkly-Integrations-PHPRedis.html#method_featureRequester">featureRequester()</a> |
| 129 | + <span> |
| 130 | + : mixed </span> |
| 131 | +</dt> |
| 132 | +<dd>Configures an adapter for reading feature flag data from Redis using persistent connections.</dd> |
| 133 | + |
| 134 | + </dl> |
| 135 | + |
| 136 | + |
| 137 | + |
| 138 | + |
| 139 | + |
| 140 | + |
| 141 | + |
| 142 | + <section class="phpdocumentor-methods"> |
| 143 | + <h3 class="phpdocumentor-elements__header" id="methods"> |
| 144 | + Methods |
| 145 | + <a href="classes/LaunchDarkly-Integrations-PHPRedis.html#methods" class="headerlink"><i class="fas fa-link"></i></a> |
| 146 | + </h3> |
| 147 | + <article |
| 148 | + class="phpdocumentor-element |
| 149 | + -method |
| 150 | + -public |
| 151 | + -static " |
| 152 | +> |
| 153 | + <h4 class="phpdocumentor-element__name" id="method_featureRequester"> |
| 154 | + featureRequester() |
| 155 | + <a href="classes/LaunchDarkly-Integrations-PHPRedis.html#method_featureRequester" class="headerlink"><i class="fas fa-link"></i></a> |
| 156 | + </h4> |
| 157 | + <aside class="phpdocumentor-element-found-in"> |
| 158 | + <abbr class="phpdocumentor-element-found-in__file" title="LaunchDarkly/Integrations/PHPRedis.php"><a href="files/launchdarkly-integrations-phpredis.html"><abbr title="LaunchDarkly/Integrations/PHPRedis.php">PHPRedis.php</abbr></a></abbr> |
| 159 | + : |
| 160 | + <span class="phpdocumentor-element-found-in__line">34</span> |
| 161 | + |
| 162 | + </aside> |
| 163 | + |
| 164 | + <p class="phpdocumentor-summary">Configures an adapter for reading feature flag data from Redis using persistent connections.</p> |
| 165 | + |
| 166 | + <code class="phpdocumentor-code phpdocumentor-signature "> |
| 167 | + <span class="phpdocumentor-signature__visibility">public</span> |
| 168 | + <span class="phpdocumentor-signature__static">static</span> <span class="phpdocumentor-signature__name">featureRequester</span><span>(</span><span class="phpdocumentor-signature__argument"><span>[</span><span class="phpdocumentor-signature__argument__return-type">array<string|int, mixed> </span><span class="phpdocumentor-signature__argument__name">$options</span><span> = </span><span class="phpdocumentor-signature__argument__default-value">array()</span><span> ]</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code> |
| 169 | + |
| 170 | + <section class="phpdocumentor-description"><p>To use this method, you must have installed the <code class="prettyprint">phpredis</code> extension. After calling this |
| 171 | +method, store its return value in the <code class="prettyprint">feature_requester</code> property of your client configuration:</p> |
| 172 | +<pre class="prettyprint"><code class="prettyprint">$fr = LaunchDarkly\Integrations\PHPRedis::featureRequester([ "redis_prefix" => "env1" ]); |
| 173 | +$config = [ "feature_requester" => $fr ]; |
| 174 | +$client = new LDClient("sdk_key", $config); |
| 175 | +</code></pre> |
| 176 | +<p>For more about using LaunchDarkly with databases, see the |
| 177 | +<a href="https://docs.launchdarkly.com/sdk/features/storing-data">SDK reference guide</a>.</p> |
| 178 | +</section> |
| 179 | + |
| 180 | + <h5 class="phpdocumentor-argument-list__heading">Parameters</h5> |
| 181 | + <dl class="phpdocumentor-argument-list"> |
| 182 | + <dt class="phpdocumentor-argument-list__entry"> |
| 183 | + <span class="phpdocumentor-signature__argument__name">$options</span> |
| 184 | + : <span class="phpdocumentor-signature__argument__return-type">array<string|int, mixed></span> |
| 185 | + = <span class="phpdocumentor-signature__argument__default-value">array()</span> </dt> |
| 186 | + <dd class="phpdocumentor-argument-list__definition"> |
| 187 | + <section class="phpdocumentor-description"><p>Configuration settings (can also be passed in the main client configuration):</p> |
| 188 | +<ul> |
| 189 | +<li> |
| 190 | +<code class="prettyprint">redis_host</code>: hostname of the Redis server; defaults to <code class="prettyprint">localhost</code> |
| 191 | +</li> |
| 192 | +<li> |
| 193 | +<code class="prettyprint">redis_port</code>: port of the Redis server; defaults to 6379</li> |
| 194 | +<li> |
| 195 | +<code class="prettyprint">redis_timeout</code>: connection timeout in seconds; defaults to 5</li> |
| 196 | +<li> |
| 197 | +<code class="prettyprint">redis_prefix</code>: a string to be prepended to all database keys; corresponds to the prefix |
| 198 | +setting in ld-relay</li> |
| 199 | +<li> |
| 200 | +<code class="prettyprint">phpredis_client</code>: an already-configured Redis client instance if you wish to reuse one</li> |
| 201 | +<li> |
| 202 | +<code class="prettyprint">apc_expiration</code>: expiration time in seconds for local caching, if <code class="prettyprint">APCu</code> is installed</li> |
| 203 | +</ul> |
| 204 | +</section> |
| 205 | + |
| 206 | + </dd> |
| 207 | + </dl> |
| 208 | + |
| 209 | + |
| 210 | + |
| 211 | + <h5 class="phpdocumentor-return-value__heading">Return values</h5> |
| 212 | + <span class="phpdocumentor-signature__response_type">mixed</span> |
| 213 | + — |
| 214 | + <section class="phpdocumentor-description"><p>an object to be stored in the <code class="prettyprint">feature_requester</code> configuration property</p> |
| 215 | +</section> |
| 216 | + |
| 217 | + |
| 218 | +</article> |
| 219 | + </section> |
| 220 | + |
| 221 | + |
| 222 | + <script type="text/javascript"> |
| 223 | + function loadExternalCodeSnippets(line) { |
| 224 | + Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach((pre) => { |
| 225 | + var src = pre.getAttribute('data-src').replace( /\\/g, '/'); |
| 226 | + var extension = (src.match(/\.(\w+)$/) || [, ''])[1]; |
| 227 | + var language = 'php'; |
| 228 | + |
| 229 | + var code = document.createElement('code'); |
| 230 | + code.className = 'language-' + language; |
| 231 | + |
| 232 | + pre.textContent = ''; |
| 233 | + |
| 234 | + pre.setAttribute('data-line', line) |
| 235 | + code.textContent = 'Loading…'; |
| 236 | + |
| 237 | + pre.appendChild(code); |
| 238 | + |
| 239 | + var xhr = new XMLHttpRequest(); |
| 240 | + |
| 241 | + xhr.open('GET', src, true); |
| 242 | + |
| 243 | + xhr.onreadystatechange = function () { |
| 244 | + if (xhr.readyState == 4) { |
| 245 | + |
| 246 | + if (xhr.status < 400 && xhr.responseText) { |
| 247 | + code.textContent = xhr.responseText; |
| 248 | + |
| 249 | + Prism.highlightElement(code); |
| 250 | + } |
| 251 | + else if (xhr.status >= 400) { |
| 252 | + code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText; |
| 253 | + } |
| 254 | + else { |
| 255 | + code.textContent = '✖ Error: File does not exist, is empty or trying to view from localhost'; |
| 256 | + } |
| 257 | + } |
| 258 | + }; |
| 259 | + |
| 260 | + xhr.send(null); |
| 261 | + }); |
| 262 | + } |
| 263 | + |
| 264 | + var modals = document.querySelectorAll("[data-modal]"); |
| 265 | + |
| 266 | + modals.forEach(function (trigger) { |
| 267 | + trigger.addEventListener("click", function (event) { |
| 268 | + //event.preventDefault(); |
| 269 | + const modal = document.getElementById(trigger.dataset.modal); |
| 270 | + modal.classList.add("phpdocumentor-modal__open"); |
| 271 | + loadExternalCodeSnippets(trigger.dataset.line) |
| 272 | + const exits = modal.querySelectorAll("[data-exit-button]"); |
| 273 | + exits.forEach(function (exit) { |
| 274 | + exit.addEventListener("click", function (event) { |
| 275 | + event.preventDefault(); |
| 276 | + modal.classList.remove("phpdocumentor-modal__open"); |
| 277 | + }); |
| 278 | + }); |
| 279 | + }); |
| 280 | + }); |
| 281 | + </script> |
| 282 | + |
| 283 | + </article> |
| 284 | + <section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden"> |
| 285 | + <section class="phpdocumentor-search-results__dialog"> |
| 286 | + <header class="phpdocumentor-search-results__header"> |
| 287 | + <h2 class="phpdocumentor-search-results__title">Search results</h2> |
| 288 | + <button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button> |
| 289 | + </header> |
| 290 | + <section class="phpdocumentor-search-results__body"> |
| 291 | + <ul class="phpdocumentor-search-results__entries"></ul> |
| 292 | + </section> |
| 293 | + </section> |
| 294 | +</section> |
| 295 | + </div> |
| 296 | + </div> |
| 297 | + <a href="classes/LaunchDarkly-Integrations-PHPRedis.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a> |
| 298 | + |
| 299 | + </main> |
| 300 | + |
| 301 | + <script> |
| 302 | + cssVars({}); |
| 303 | + </script> |
| 304 | + <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script> |
| 305 | + <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script> |
| 306 | + <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script> |
| 307 | + <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script> |
| 308 | +</body> |
| 309 | +</html> |
0 commit comments