{"id":22278457,"url":"https://github.com/devjack/gitver","last_synced_at":"2025-03-25T18:22:03.659Z","repository":{"id":11041935,"uuid":"13377442","full_name":"devjack/gitver","owner":"devjack","description":"Version parsing from git tags","archived":false,"fork":false,"pushed_at":"2013-11-09T04:55:36.000Z","size":172,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-30T15:49:30.057Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devjack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-10-07T07:24:32.000Z","updated_at":"2013-11-09T04:55:38.000Z","dependencies_parsed_at":"2022-08-31T12:51:44.991Z","dependency_job_id":null,"html_url":"https://github.com/devjack/gitver","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devjack%2Fgitver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devjack%2Fgitver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devjack%2Fgitver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devjack%2Fgitver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devjack","download_url":"https://codeload.github.com/devjack/gitver/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245516971,"owners_count":20628257,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-03T15:14:35.363Z","updated_at":"2025-03-25T18:22:03.634Z","avatar_url":"https://github.com/devjack.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"gitver\n======\n\nSimple class to parse version tags from a git working directory.\n\n[![Build Status](https://travis-ci.org/sydnerdrage/gitver.png?branch=master)](https://travis-ci.org/sydnerdrage/gitver)\n[![Coverage Status](https://coveralls.io/repos/sydnerdrage/gitver/badge.png?branch=master)](https://coveralls.io/r/sydnerdrage/gitver?branch=master)\n\nUsage\n-----------\nGitver defaults to the current working directory.  As such it requires no immediate configuration\n\n~~~php\nuse \\Gitver\\Git;\n\n$gitver = new Git(__DIR__);\necho $gitver-\u003eversion();\n~~~\n\nThis will output a `git describe` of the current working directory.\ne.g.  v0.1.1-0-abcdefg\n\nThis is a combination of:\n - Most recent tag (matching a $prefixX.Y.Z format - see configuration below)\n - Number of commits since that tag\n - Current commit prefixed with 'g' (identifying the repository as git).\n\n\n\n## Configuration\n - Working directory to retrieve version from (defaults to the current working directory)\n - Tag match prefix (defaults to \"v\")\n\nFor example if you version tags are in the format of release-X.Y.Z then you  would call\n~~~php\n$gitver = new Git(__DIR__, \"version-\");\n~~~\n\n\n\n#### CakePHP Sample\n~~~php\n\u003c?php\nuse \\Gitver\\Git;\n\nApp::uses('Controller', 'Controller');\n\nclass AppController extends Controller\n{\n    public function beforeFilter()\n    {\n        parent::beforeFilter();\n        $this-\u003eset(\"VERSION\", (new Git(__DIR__))-\u003eversion());\n    }\n}\n~~~\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevjack%2Fgitver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevjack%2Fgitver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevjack%2Fgitver/lists"}