Search by

kba-team / cake2_app_version

grej

CakePHP plugin to determine the current version of your application. The version is either taken from the commit.json of the deploy script or from the local clone of the git repository.

Package info

github.com/the-kbA-team/cake2_app_version

Language:Makefile

Type:cakephp-plugin

pkg:composer/kba-team/cake2_app_version

Statistics

Installs: 4 814

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v3.0.3 2026-11-13 18:10 UTC

This package is auto-updated.

Last update: 2026-11-13 18:10:50 UTC


README

CakePHP 2.x plugin to determine the current version of your application. The version is either taken from the commit.json of the deploy script or from the local clone of the git repository.

Usage

<?php
echo constant('APP_VERSION');
// Separate identifiers, e.g. for structured logging:
echo APP_VERSION_IDENTIFIER;
echo APP_COMMIT;

APP_VERSION_IDENTIFIER is the release tag or Git ref recorded in commit.json, or the local Git branch when the file is unavailable. APP_COMMIT is the abbreviated commit SHA as provided by the source. When neither source provides both values, each constant contains ~ ? ~. APP_VERSION retains the combined identifier (rev. commit) format and its existing fallback. The plugin reads APP/webroot/commit.json; custom file paths are no longer supported.

The constants are set once at bootstrap. Restart long-running workers after a deployment to pick up the new values. Applications can add the separate constants to their own logging configuration; this plugin does not configure Graylog.

Installation

Composer Installers 1.12 and 2.2 or newer compatible releases are supported.

  1. Require the plugin.
composer require kba-team/cake2_app_version
  1. Include the plugin in your bootstrap.php
<?php
CakePlugin::load('AppVersion', ['bootstrap' => true, 'routes' => false]);

Development

The Makefile runs Composer and PHP tools in Docker. Supported PHP versions are 8.1, 8.2, and 8.3.

make install PHP_VERSION=8.1
make lint PHP_VERSION=8.1
make test PHP_VERSION=8.1
make analyze PHP_VERSION=8.1
make audit PHP_VERSION=8.1
make validate

Use DEPENDENCIES_LOWEST=1 with make install to resolve the lowest allowed dependency versions.

Distribution archives contain the plugin bootstrap, Composer metadata, and license. Composer source installations use a full repository checkout instead.

Agent instructions and engineering-skill configuration are in AGENTS.md.

Pull requests and CI

Create an issue and branch from main in this repository using the name issue/<number>-<description>. Open a pull request against main. Force-pushes are allowed only on issue/* branches; forks have their own settings.

CI runs automatically for pull requests to main and can also be started manually. New commits cancel any older, still-running CI for the same pull request. Branch pushes, merges to main, tags and releases do not trigger CI.

All five CI jobs must pass, and the pull request branch must be up to date with main before merging. Update an out-of-date branch and wait for CI to pass again. No review approval is required. Only squash merges are allowed; GitHub deletes the issue branch after merging.