Please see the main PostHog docs.
Specifically, the PHP integration details.
- ✅ Event capture and user identification
- ✅ Feature flag local evaluation
- ✅ Feature flag dependencies (new!) - Create conditional flags based on other flags
- ✅ Multivariate flags and payloads
- ✅ Group analytics
- ✅ Comprehensive test coverage
- Copy
.env.exampleto.envand add your PostHog credentials - Run
php example.phpto see interactive examples of all features
- Download PHP and Composer
php composer.phar updateto install dependenciesbin/testto run tests (this script calls./vendor/bin/phpunit --verbose test)
Releases are semi-automated via GitHub Actions. When a PR with the release and a version bump label is merged to master, the release workflow is triggered.
You'll need an approval from a PostHog engineer. If you're an employee, you can see the request in the #approvals-client-libraries channel.
- Create your PR with the changes you want to release
- Add the
releaselabel to the PR - Add a version bump label that should be either
bump-patch,bump-minororbump-major - Merge the PR to
master
Once merged, the following happens automatically:
- A Slack notification is sent to the client libraries channel requesting approval
- A maintainer approves the release in the GitHub
Releaseenvironment - The version is bumped in
lib/PostHog.phpandcomposer.jsonbased on the version label (patch,minor, ormajor, extracted from the label) - The
CHANGELOG.mdis updated with a link to the full changelog - Changes are committed and pushed to
master - A git tag is created (e.g.,
v1.8.0) - A GitHub release is created with the changelog content
- Slack is notified of the successful release
Releases are installed directly from GitHub.