[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-8281":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":20,"hasPages":20,"topics":22,"createdAt":10,"pushedAt":10,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":26,"discoverSource":27},8281,"version","sebastianbergmann\u002Fversion","sebastianbergmann","Library that helps with managing the version number of Git-hosted PHP projects","",null,"PHP",6578,36,9,1,0,2,60.9,"BSD 3-Clause \"New\" or \"Revised\" License",false,"main",[],"2026-06-12 04:00:38","[![Latest Stable Version](https:\u002F\u002Fposer.pugx.org\u002Fsebastian\u002Fversion\u002Fv)](https:\u002F\u002Fpackagist.org\u002Fpackages\u002Fsebastian\u002Fversion)\n\n# sebastian\u002Fversion\n\n**sebastian\u002Fversion** is a library that helps with managing the version number of Git-hosted PHP projects.\n\n## Installation\n\nYou can add this library as a local, per-project dependency to your project using [Composer](https:\u002F\u002Fgetcomposer.org\u002F):\n\n```\ncomposer require sebastian\u002Fversion\n```\n\nIf you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency:\n\n```\ncomposer require --dev sebastian\u002Fversion\n```\n## Usage\n\nThe constructor of the `SebastianBergmann\\Version` class expects two parameters:\n\n* `$release` is the version number of the latest release (`X.Y.Z`, for instance) or the name of the release series (`X.Y`) when no release has been made from that branch \u002F for that release series yet.\n* `$path` is the path to the directory (or a subdirectory thereof) where the sourcecode of the project can be found. Simply passing `__DIR__` here usually suffices.\n\nApart from the constructor, the `SebastianBergmann\\Version` class has a single public method: `asString()`.\n\nHere is a contrived example that shows the basic usage:\n\n```php\n\u003C?php declare(strict_types=1);\nuse SebastianBergmann\\Version;\n\n$version = new Version('1.0.0', __DIR__);\n\nvar_dump($version->asString());\n```\n```\nstring(18) \"1.0.0-17-g00f3408\"\n```\n\nWhen a new release is prepared, the string that is passed to the constructor as the first argument needs to be updated.\n\n### How SebastianBergmann\\Version::asString() works\n\n* If `$path` is not (part of) a Git repository and `$release` is in `X.Y.Z` format then `$release` is returned as-is.\n* If `$path` is not (part of) a Git repository and `$release` is in `X.Y` format then `$release` is returned suffixed with `-dev`.\n* If `$path` is (part of) a Git repository and `$release` is in `X.Y.Z` format then the output of `git describe --tags` is returned as-is.\n* If `$path` is (part of) a Git repository and `$release` is in `X.Y` format then a string is returned that begins with `X.Y` and ends with information from `git describe --tags`.\n","sebastian\u002Fversion 是一个帮助管理Git托管的PHP项目版本号的库。其核心功能在于通过解析Git标签来生成项目的版本字符串，支持传入具体的版本号或版本系列名作为参数，并能根据项目源代码目录是否为Git仓库的一部分自动调整输出格式。该库提供了`asString()`方法用于获取当前版本信息，适用于需要动态管理或展示项目版本号的各种场景，如自动化构建、持续集成\u002F持续部署（CI\u002FCD）流程中等。通过Composer可轻松将其集成到PHP项目中。","2026-06-11 03:17:09","top_language"]