https://github.com/davidrjenni/scip-php
SCIP Code Intelligence Protocol (SCIP) indexer for PHP
https://github.com/davidrjenni/scip-php
code-intel php scip
Last synced: 10 days ago
JSON representation
SCIP Code Intelligence Protocol (SCIP) indexer for PHP
- Host: GitHub
- URL: https://github.com/davidrjenni/scip-php
- Owner: davidrjenni
- License: mit
- Created: 2023-03-29T07:28:55.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2026-01-12T15:27:19.000Z (12 days ago)
- Last Synced: 2026-01-12T21:36:37.075Z (11 days ago)
- Topics: code-intel, php, scip
- Language: PHP
- Homepage:
- Size: 666 KB
- Stars: 12
- Watchers: 4
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# scip-php
[](https://github.com/davidrjenni/scip-php/actions/workflows/ci.yml)
[](https://codecov.io/gh/davidrjenni/scip-php)
[](https://api.securityscorecards.dev/projects/github.com/davidrjenni/scip-php)
[](https://github.com/davidrjenni/scip-php/blob/main/LICENSE)
[](https://packagist.org/packages/davidrjenni/scip-php)
[](https://packagist.org/packages/davidrjenni/scip-php)
[](https://hub.docker.com/r/davidrjenni/scip-php)
[](https://hub.docker.com/r/davidrjenni/scip-php)
[](https://github.com/davidrjenni/scip-php/contributors)
SCIP Code Intelligence Protocol (SCIP) indexer for PHP
---
This repository is indexed using itself and available on
[Sourcegraph](https://sourcegraph.com/github.com/davidrjenni/scip-php).
And here is a Sourcegraph notebook with a
[demo](https://sourcegraph.com/notebooks/Tm90ZWJvb2s6MjI2NQ==) and
additional explanations.
## Requirements
- `scip-php` must be run in the root directory of the project you want
to index.
- It needs the `composer.json` and `composer.lock` files in the current
working directory.
- Also, `scip-php` needs an up-to-date autoloader and the dependencies
must be installed in the vendor directory.
## Usage
### Manual
Install [`scip-php`](https://packagist.org/packages/davidrjenni/scip-php)
with `composer` and the
[`src`](https://docs.sourcegraph.com/cli/quickstart) binary. Then generate
the SCIP index and upload it:
```bash
composer require --dev davidrjenni/scip-php
vendor/bin/scip-php
src code-intel upload
```
### Private Sourcegraph Instance
To use a private Sourcegraph instance, set the
`SRC_ENDPOINT` and `SRC_ACCESS_TOKEN` [environment
variables](https://docs.sourcegraph.com/cli/explanations/env) first.
## Contributing
See the [contributing guidelines](CONTRIBUTING.md).
## Development
- Run `composer lint` to run all linters.
- Run `composer test` to run the unit tests.
- Run `composer cover` to generate a coverage report.
### Inspecting the Output
- Install the `scip` cli from
[github.com/sourcegraph/scip](https://github.com/sourcegraph/scip).
- Run `bin/scip-php` to generate the SCIP index.
- Run `scip snapshot` to generate snapshot files which can be used for
inspecting the output of the index.
- See the
[documentation](https://github.com/sourcegraph/scip/blob/main/docs/CLI.md)
for further functionality.
### Bindings
The directory [`src/Bindings`](src/Bindings) contains auto-generated
bindings for SCIP. To update the bindings, download the protobuf schema
for SCIP and regenerate the bindings:
```bash
wget -O src/Bindings/scip.proto https://raw.githubusercontent.com/sourcegraph/scip/main/scip.proto
composer gen-bindings
```
The protobuf compiler `protoc` must be present to generate the bindings.
See [github.com/sourcegraph/scip](https://github.com/sourcegraph/scip)
for further information.