Skip to content

Commit 9538e57

Browse files
committed
edits
1 parent 8132e60 commit 9538e57

File tree

1 file changed

+11
-11
lines changed
  • src/connections/sources/catalog/libraries/server/php

1 file changed

+11
-11
lines changed

src/connections/sources/catalog/libraries/server/php/index.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ support_type: maintenance
66
---
77
Segment's PHP library lets you record analytics data from your PHP code. The requests hit Segment servers, and then Segment routes your data to any analytics service you enable on your destinations page.
88

9-
This library is open-source, so you can [check it out on GitHub](https://github.com/segmentio/analytics-php).
9+
This library is open-source, so you can [check it out on GitHub](https://github.com/segmentio/analytics-php){:target="_blank”}.
1010

1111
PHP is a little different than Segment's other server-side libraries because it is a single-threaded language. Segment worked to make the PHP library as performant as possible, while still leaving you room to tune the settings for your application. If you want to learn more about tuning your settings for high performance, be sure to read through the section on [configuration](#configuration) at the end of this guide.
1212

13-
Want to stay updated on releases? Subscribe to the [release feed](https://github.com/segmentio/analytics-php/releases.atom).
13+
Want to stay updated on releases? Subscribe to the [release feed](https://github.com/segmentio/analytics-php/releases.atom){:target="_blank”}.
1414

15-
## Getting Started
15+
## Getting started
1616

1717
Clone the repository from GitHub into your desired application directory.
1818

@@ -103,7 +103,7 @@ Find details on the **identify method payload** in the [Segment Spec](/docs/conn
103103

104104
Track lets you record the actions your users perform.Every action triggers what Segment calls an "event", which can also have associated properties.
105105

106-
You'll want to track events that are indicators of success for your site, like **Signed Up**, **Item Purchased** or **Article Bookmarked**.
106+
You'll want to track events that are indicators of success for your site, like **Signed Up**, **Item Purchased**, or **Article Bookmarked**.
107107

108108
To get started, Segment recommends tracking just a few important events. You can always add more later.
109109

@@ -318,7 +318,7 @@ Segment::track(array(
318318

319319
For more details about Alias including the **Alias call payload**, check out the [Segment Spec](/docs/connections/spec/alias/).
320320

321-
## Historical Import
321+
## Historical import
322322

323323
You can import historical data by adding the `timestamp` argument to any of your method calls. This can be helpful if you've just switched to Segment.
324324

@@ -402,7 +402,7 @@ Segment::init("YOUR_WRITE_KEY", array(
402402
</tr>
403403
</table>
404404

405-
### Lib-Curl Consumer
405+
### Lib-Curl consumer
406406

407407
The [lib-curl consumer](https://github.com/segmentio/analytics-php/blob/master/lib/Segment/Consumer/LibCurl.php) is a reliable option for low-volume sources or if you want fast response times under light loads. The library runs synchronously, queuing calls and sending them in batches to Segment's servers. By default, this happens every 100 calls, or at the end of serving the page. By default, Segment ignores http responses to optimize the library's speed, but you can choose to wait for these responses by enabling debug mode.
408408

@@ -425,7 +425,7 @@ Segment::init("YOUR_WRITE_KEY", array(
425425
```
426426

427427

428-
### Fork-Curl Consumer
428+
### Fork-Curl consumer
429429

430430
The [fork-curl consumer](https://github.com/segmentio/analytics-php/blob/master/lib/Segment/Consumer/ForkCurl.php) should work best for cases where you can't use persistent sockets, or want to ensure quick response times under light load. It works by creating an in-memory queue which buffers track and identify calls. The queue is flushed by forking an async `curl` process that sends a batch request. By default, this happens every `100` calls, or at the end of serving the page. This consumer will spawn a separate process for each request which tracks events. If your servers are handling more than 20 requests per second, you may want to look at the [file consumer](#file-consumer).
431431

@@ -452,7 +452,7 @@ Segment::init("YOUR_WRITE_KEY", array(
452452
</table>
453453

454454

455-
### Socket Consumer
455+
### Socket consumer
456456

457457
If you can't spawn other processes from your PHP scripts, you can use the [socket consumer](https://github.com/segmentio/analytics-php/blob/master/lib/Segment/Consumer/Socket.php), which will allow you to make requests to Segment. Each time a track or identify call is made, it will initiate a socket request to Segment's servers. The socket request is about as async as you can get with PHP, where the request will write the event data and close the connection before waiting for a response. However, if your servers are dealing with more than 100s of requests per second or cannot use a persistent connection, you may want to use one of the other consumers instead.
458458

@@ -483,7 +483,7 @@ Segment::init("YOUR_WRITE_KEY", array(
483483
</table>
484484

485485

486-
### File Consumer
486+
### File consumer
487487

488488
The [file consumer](https://github.com/segmentio/analytics-php/blob/master/lib/Segment/Consumer/File.php) is a more performant method for making requests to Segment. Each time a track or identify call is made, it will record that call to a log file. The log file is then uploaded "out of band" by running the `file.php` file found in [the analytics-php repository](https://github.com/segmentio/analytics-php/blob/master/lib/Segment/Consumer/File.php).
489489

@@ -526,6 +526,6 @@ $ sudo service cron reload # reload the cron daemon
526526
{% include content/server-side-troubleshooting.md %}
527527

528528

529-
## 3rd-Party Libraries
529+
## 3rd party libraries
530530

531-
Laravel Segment is a Segment SDK, for Laravel. The GitHub repo can be found here: [slashEquip/laravel-segment](https://github.com/slashequip/laravel-segment){:target="_blank”}.
531+
Laravel Segment is a Segment SDK for Laravel. View the [slashEquip/laravel-segment](https://github.com/slashequip/laravel-segment){:target="_blank”} GitHub repo to learn more.

0 commit comments

Comments
 (0)