Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Gitlib Laravel Package

gitonomy/gitlib

Gitonomy Gitlib is a PHP library for interacting with Git repositories programmatically. Read commits, trees, branches, tags and diffs; run Git commands via a clean API and work with local repos from your apps, tools, or CI scripts.

View on GitHub
Deep Wiki
Context7

Blob

In git, a blob represents a file content. You can't access the file name directly from the Blob object; the filename information is stored within the tree, not in the blob.

It means that for git, two files with different names but same content will have the same hash.

To access a repository Blob, you need the hash identifier:

$repository = new Gitonomy\Git\Repository('/path/to/repository');
$blob = $repository->getBlob('a7c8d2b4');

Get content

To get content from a Blob object:

echo $blob->getContent();

File informations

To get mimetype of a Blob object using finfo extension:

echo $blob->getMimetype();

You can also test if Blob is a text of a binary file:

if ($blob->isText()) {
    echo $blob->getContent(), PHP_EOL;
} elseif ($blob->isBinary()) {
    echo 'File is binary', PHP_EOL;
}
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours