[{"data":1,"prerenderedAt":118},["ShallowReactive",2],{"docs:\u002Fdocs\u002Fphp":3,"docs-navigation":77},{"id":4,"title":5,"body":6,"description":69,"extension":70,"meta":71,"navigation":72,"path":73,"seo":74,"stem":75,"__hash__":76},"docs\u002Fdocs\u002Fphp.md","PHP quickstart",{"type":7,"value":8,"toc":66},"minimark",[9,13,22,32,55,63],[10,11,5],"h1",{"id":12},"php-quickstart",[14,15,16,17,21],"p",{},"Use the Dipswitch provider with the OpenFeature PHP SDK, PHP 8.2 or later in the 8.x series, and the cURL extension. To install before registry publication, copy the supplied provider directory next to your application at the relative path shown below. Run these commands beside your application’s ",[18,19,20],"code",{},"composer.json",".",[23,24,30],"pre",{"className":25,"code":27,"language":28,"meta":29},[26],"language-sh","composer config repositories.dipswitch path ..\u002Fpackages\u002Fopenfeature-php\ncomposer require dipswitch\u002Fopenfeature-provider:@dev\n","sh","",[18,31,27],{"__ignoreMap":29},[14,33,34,35,38,39,42,43,46,47,50,51,54],{},"Set ",[18,36,37],{},"DIPSWITCH_SERVER_KEY"," in the service environment. Set ",[18,40,41],{},"DIPSWITCH_EDGE_URL"," to your local edge address when self-hosting. Save this as ",[18,44,45],{},"example.php"," beside your application's ",[18,48,49],{},"vendor"," directory. Run ",[18,52,53],{},"php example.php",", optionally followed by a user ID and a flag key.",[23,56,61],{"className":57,"code":59,"language":60,"meta":29},[58],"language-php","\u003C?php\nrequire __DIR__ . '\u002Fvendor\u002Fautoload.php';\n\nuse Dipswitch\\OpenFeature\\DipswitchProvider;\nuse OpenFeature\\implementation\\flags\\EvaluationContext;\nuse OpenFeature\\OpenFeatureAPI;\n\n$api = OpenFeatureAPI::getInstance();\n$api->setProvider(new DipswitchProvider(\n    getenv('DIPSWITCH_SERVER_KEY') ?: throw new RuntimeException('Set DIPSWITCH_SERVER_KEY.'),\n    getenv('DIPSWITCH_EDGE_URL') ?: 'https:\u002F\u002Fedge.dipswitch.co'\n));\n\n$user = new EvaluationContext($argv[1] ?? 'user-42');\n$flag = $argv[2] ?? 'new-checkout';\n$result = $api->getClient()->getBooleanDetails($flag, false, $user);\nprintf(\"%s %s\\n\", $result->getValue() ? 'true' : 'false', $result->getReason());\n","php",[18,62,59],{"__ignoreMap":29},[14,64,65],{},"Each boolean check asks edge over HTTP. Omit the context for an anonymous user. Choose the fallback boolean for your feature. Use evaluation details to distinguish a missing flag, an invalid context or a failed request from an evaluated value.",{"title":29,"searchDepth":67,"depth":67,"links":68},2,[],"Use the Dipswitch provider with the OpenFeature PHP SDK, PHP 8.2 or later in the 8.x series, and the cURL extension. To install before registry publication, copy the supplied provider directory next to your application at the relative path shown below. Run these commands beside your application’s composer.json.","md",{},true,"\u002Fdocs\u002Fphp",{"title":5,"description":69},"docs\u002Fphp","VT5xKsYuJAClTcPBO6NRdl4y2K6TokVw6qtP8whxUXs",[78,81,84,87,90,93,96,99,102,105,106,109,112,115],{"path":79,"title":80},"\u002Fdocs","Dipswitch documentation",{"path":82,"title":83},"\u002Fdocs\u002Fdotnet",".NET quickstart",{"path":85,"title":86},"\u002Fdocs\u002Fidentity","Verify user identity",{"path":88,"title":89},"\u002Fdocs\u002Fjava","Java quickstart",{"path":91,"title":92},"\u002Fdocs\u002Fjavascript","JavaScript quickstart",{"path":94,"title":95},"\u002Fdocs\u002Flaunchdarkly","Migrate from LaunchDarkly",{"path":97,"title":98},"\u002Fdocs\u002Fmanagement-api","Management API",{"path":100,"title":101},"\u002Fdocs\u002Fnode","Node.js quickstart",{"path":103,"title":104},"\u002Fdocs\u002Fopenfeature","OpenFeature and OFREP",{"path":73,"title":5},{"path":107,"title":108},"\u002Fdocs\u002Fplans","Plans and limits",{"path":110,"title":111},"\u002Fdocs\u002Frate-limits","Rate limits",{"path":113,"title":114},"\u002Fdocs\u002Freact","React quickstart",{"path":116,"title":117},"\u002Fdocs\u002Fvue","Vue quickstart",1795767833783]