Skip to content

Commit e4f79f0

Browse files
committed
make it more clear what is slim
1 parent a5a17be commit e4f79f0

File tree

7 files changed

+17
-16
lines changed

7 files changed

+17
-16
lines changed

docs/server/_server_core.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## Motivation & Background
22

3-
PHP-Core is a brand new from-the-ground-up server SDK leveraging [Statsig's Server Core](https://github.com/statsig-io/statsig-server-core), a performance-focused evaluation & logging library written in Rust. Early benchmarking suggests Server Core can evaluate Gates and Experiments in a small fraction of the time native SDKs are capable of.
3+
PHP-Core is a *brand new from-the-ground-up* server SDK leveraging [Statsig's Server Core](https://github.com/statsig-io/statsig-server-core), a performance-focused evaluation & logging library written in Rust. Early benchmarking suggests Server Core can evaluate Gates and Experiments in a small fraction of the time native SDKs are capable of.
44

55
We plan to offer Server Core across multiple languages in the near future. Want another language sooner? Reach out in our [Slack Channel](https://statsig.com/slack).

docs/server/php-core/_checkGate.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ use Statsig\Statsig;
33
use Statsig\StatsigUserBuilder;
44

55
$user = StatsigUserBuilder::withUserID('my_user')->build();
6-
$passed = $statsig->checkGate($user, 'an_experiment');
6+
$passed = $statsig->checkGate($user, 'my_gate');
77
```

docs/server/php-core/_getConfig.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
```php
22
$user = StatsigUserBuilder::withUserID('my_user')->build();
3-
$config = $statsig->getDynamicConfig($user, 'an_experiment');
3+
$config = $statsig->getDynamicConfig($user, 'my_config');
44
```
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
```php
22
$user = StatsigUserBuilder::withUserID('my_user')->build();
3-
$config = $statsig->getExperiment($user, 'an_experiment');
3+
$xp = $statsig->getExperiment($user, 'an_experiment');
44
```

docs/server/php-core/_initialize.mdx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,19 @@ You'll want to add your client secret key to the environment, by adding to a .en
44
export STATSIG_SECRET_KEY=secret-123456789
55
```
66

7-
In the dependencies.php container builder, add your initialization logic:
7+
In the case of the slim framework, we initialize our SDK in dependencies.php:
8+
9+
In the case of the slim framework, you'll also need to add Statsig as a dependency in `app/dependencies.php`. If you're using something like Laravel, this may look different.
10+
11+
```php
12+
// At the top of your file
13+
use Statsig\Statsig;
14+
use Statsig\StatsigOptions;
15+
use Statsig\StatsigLocalFileEventLoggingAdapter;
16+
use Statsig\StatsigLocalFileSpecsAdapter;
17+
18+
//In the case of slim framework, in container builder definitions:
819

9-
```PHP
1020
Statsig::class => function (ContainerInterface $c) {
1121
$sdk_key = getenv("STATSIG_SECRET_KEY");
1222

docs/server/php-core/_install.mdx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,6 @@ You can install the new PHP Core SDK using composer:
99
composer require statsig/statsig-core-php
1010
```
1111

12-
In the case of the slim framework, you'll also need to add Statsig as a dependency in `app/dependencies.php`. If you're using something like Laravel, this may look different.
13-
14-
```php
15-
use Statsig\Statsig;
16-
use Statsig\StatsigOptions;
17-
use Statsig\StatsigLocalFileEventLoggingAdapter;
18-
use Statsig\StatsigLocalFileSpecsAdapter;
19-
```
20-
2112
### 2. Add Scripts & Cron Job
2213

2314
Add post-install and post-update scripts in composer.json:

docs/server/phpCoreSDK.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ import {
3434

3535
export const Builder = SDKDocsBuilder({
3636
sections: [
37-
[ServerCore, {}],
3837
[
3938

4039
Repository,
4140
{
4241
repo: "https://github.com/statsig-io/statsig-server-core",
4342
},
4443
],
44+
[ServerCore, {}],
4545
[
4646
GettingStarted,
4747
{

0 commit comments

Comments
 (0)