Download the PHP package igzard/code-storage-php without Composer
On this page you can find all versions of the php package igzard/code-storage-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download igzard/code-storage-php
More information about igzard/code-storage-php
Files in igzard/code-storage-php
Package code-storage-php
Short Description Pierre Code Storage SDK for PHP
License MIT
Informations about the package code-storage-php
code-storage-php
Pierre Code Storage SDK for PHP — a port of
code-storage-go.
Installation
The SDK talks HTTP through any PSR-18 client. If you already have one installed (Guzzle, Symfony HttpClient, ...) it is discovered automatically; otherwise pass your own:
Usage
Every option is a named argument, every response is a readonly object. TTLs are integer seconds.
Inspect file metadata
Download an archive
archiveStream() and fileStream() return the raw PSR-7 response, so you can pipe
the body wherever you need it.
List files with metadata
Blame a file
ranges accepts repeated git blame -L specs ("10,30", "/getUser/,/^}/",
"10,+5", "10,", ",30", "10", ":funcname"). Up to 16 per request; omit to
blame the whole file. The top-level commitSha is the SHA ref resolved to; each
BlameLine carries its authoring commit's metadata inline, with
previousCommitSha empty when the line has no prior version.
Manage tags and branches
Manage notes
Notes default to refs/notes/commits. Set ref to target another notes ref; a bare
name like reviews is placed under refs/notes/ (a fully-qualified refs/notes/*
ref also works). Custom refs must be enabled server-side.
Preview and perform merges
Create a commit
addFile() also accepts a stream resource or a PSR-7 StreamInterface, so large
blobs never have to be held in memory. A builder cannot be reused after send().
Inspect commit parents
listCommits() and getCommit() expose parent SHAs in Git parent order. Root
commits return an empty array.
Get an applicable commit diff
gitApplyCompatible generates raw diffs for use with git apply. When no files are
filtered and every changed file has a non-empty raw, concatenate each
$diff->files[$i]->raw in response order to produce a patch for the exact base tree.
Hydrate a repo without an API request
Sync from a public GitHub base repository
Validate webhooks
Errors
| Exception | Raised when |
|---|---|
InvalidArgumentException |
Client-side option validation fails. |
Exception\ApiException |
The API answers with a non-2xx status. Carries status, method, url and the decoded body. |
Exception\RefUpdateException |
A commit, note write or restore was refused. Carries status, a normalized reason and the partial refUpdate. |
Features
- Create, list, find, and delete repositories.
- Generate authenticated git remote URLs, including import and ephemeral variants.
- Read files, read file metadata, download archives, list branches/commits, and run grep queries.
- Create commits via streaming commit-pack or diff-commit endpoints.
- Restore commits, merge branches, manage git notes, create branches, and manage tags.
- Validate webhook signatures and parse push events.
Development
All versions of code-storage-php with dependencies
ext-json Version *
ext-openssl Version *
firebase/php-jwt Version ^6.10 || ^7.0
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^1.1 || ^2.0
php-http/discovery Version ^1.19