Download the PHP package spiriitlabs/commit-history-bundle without Composer

On this page you can find all versions of the php package spiriitlabs/commit-history-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package commit-history-bundle

SpiriitLabs Commit History Bundle

A Symfony bundle that fetches commit history from GitLab or GitHub repositories and displays them in a beautiful vertical timeline UI — similar to the Symfony releases page.

PHP Version Symfony Latest Stable Version

Features

Architecture

This project is split into two packages:

This separation allows you to use the core library in any PHP project (Laravel, plain PHP, etc.) while Symfony users get a ready-to-use bundle with full integration.

Bundle Components

The bundle provides Symfony-specific integrations:

Component Description
SymfonyCacheAdapter Bridges Symfony's cache to the library's CacheInterface
SymfonyHttpClientAdapter Bridges Symfony's HTTP client to the library's HttpClientInterface
TimelineController Renders the timeline page
DependenciesChangesController JSON API for dependency details
RefreshCacheCommand CLI command to refresh cache
ClearCacheCommand CLI command to clear cache

Requirements

Installation

Install the bundle using Composer:

If you're using Symfony Flex, the bundle will be automatically registered. Otherwise, add it to your config/bundles.php:

Configuration

Create a configuration file config/packages/spiriit_commit_history.yaml:

GitLab Configuration

GitHub Configuration

Configuration Options

Option Type Default Description
provider string required Provider type: gitlab or github
feed_name string Commits Display name for the timeline
cache_ttl integer 3600 Cache duration in seconds
available_years_count integer 6 Number of years to show in the year filter dropdown
track_dependency_changes boolean true Enable dependency change detection
dependency_files array [composer.json, composer.lock, package.json, package-lock.json] Files to track for dependency changes

GitLab Options

Option Type Default Description
project_id string required Numeric ID or URL-encoded path
base_url string https://gitlab.com GitLab instance URL
token string null Personal Access Token (for private repos)
ref string null Branch or tag name

GitHub Options

Option Type Default Description
owner string required Repository owner
repo string required Repository name
base_url string https://api.github.com GitHub API URL
token string null Personal Access Token (for private repos)
ref string null Branch or tag name

Routes Configuration

Add the routes to your config/routes.yaml:

Usage

Standalone Page

Visit /commits (or your configured prefix) to see the timeline. The page displays commits for the current year by default, with a dropdown to select other years.

You can also directly access a specific year by adding the year query parameter:

Embedding in Your Own Layout

You can embed the timeline in your own templates by injecting the FeedFetcherInterface service:

Then in your template:

Console Commands

Refresh Cache

Refresh the commit cache and re-detect dependency badges:

This command clears the commits list cache and dependency detection cache, then fetches fresh data from the provider. Each year is cached separately.

Clear Cache

Clear all caches (commits list, dependency detection, and dependency changes):

This command clears all cached data without re-fetching. Useful if you want to force a complete refresh on the next page load.

Dependency Tracking

The bundle automatically detects commits that modify dependency files (composer.json, package.json, etc.) and displays a "DEPENDENCIES" badge on these commits. Clicking the badge reveals the list of added, updated, or removed dependencies.

How It Works

  1. Badge Detection: When commits are loaded, the bundle checks if any dependency files were modified. This check is cached per-commit (forever, since commit content is immutable).

  2. Lazy Loading: The dependency details are only fetched when a user clicks the badge, reducing initial page load time.

  3. Per-Commit Caching: Both badge detection and dependency details are cached per-commit. Since commit IDs are immutable, this cache never needs to expire.

Configuration

Extending with Custom Parsers

The bundle uses a tagged service pattern for diff parsers. You can add support for additional dependency file formats by creating your own parser.

  1. Create a parser class implementing DiffParserInterface from the library:

  2. Tag your service:

  3. Add the file to the tracked files:

Authentication

GitLab

For private repositories, create a Personal Access Token:

  1. Go to GitLab → User Settings → Access Tokens
  2. Create a token with read_api scope
  3. Add to your .env file:

GitHub

For private repositories, create a Personal Access Token:

  1. Go to GitHub → Settings → Developer settings → Personal access tokens
  2. Create a token (classic or fine-grained) with repo scope
  3. Add to your .env file:

Template Customization

Override the default templates by creating files in your project:

Available CSS Classes (BEM)

The templates use BEM naming convention:

Class Description
.timeline Main timeline container
.timeline--empty Empty state modifier
.timeline__filter Year filter form container
.timeline__filter-select Year dropdown select
.timeline__item Individual commit item
.timeline__title Commit title
.timeline__meta Metadata container
.timeline__hash Commit hash
.timeline__date Commit date
.timeline__author Author name
.timeline__badge Dependency badge (DEPENDENCIES label)
.timeline__badge--loading Loading state for badge
.timeline__dependencies Dependencies detail container
.timeline__dependencies-list List of dependency changes
.timeline__dependencies-item Individual dependency change
.timeline__dependencies-name Package name
.timeline__dependencies-version Version information
.timeline__dependencies-type Change type indicator dot
.timeline__dependencies-type--added Added dependency (green)
.timeline__dependencies-type--updated Updated dependency (orange)
.timeline__dependencies-type--removed Removed dependency (red)

Using the Standalone Library

If you're not using Symfony, you can use the standalone library directly. See the spiriitlabs/commit-history repository for documentation.

The library provides:

You'll need to provide your own implementations of:

Testing

Run the test suite:

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This bundle is released under the MIT License. See the LICENSE file for details.

Support

For questions and support, please open an issue on GitHub or contact [email protected].


All versions of commit-history-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
spiriitlabs/commit-history Version ^1.0
symfony/cache Version ^6.4|^7.0
symfony/console Version ^6.4|^7.0
symfony/framework-bundle Version ^6.4|^7.0
symfony/http-client Version ^6.4|^7.0
twig/twig Version ^3.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package spiriitlabs/commit-history-bundle contains the following files

Loading the files please wait ...