# user-access-manager/trunk/includes/version.php

User Access Manager, version trunk. 26 lines.

- Page: https://pluginprobe.com/plugins/user-access-manager/trunk/code/includes/version.php
- Raw: https://pluginprobe.com/plugins/user-access-manager/trunk/raw/includes/version.php
- Modified: 2026-07-30T16:16:40+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/user-access-manager/trunk/code/includes/version.php#L10-L20`.

```php
<?php

declare(strict_types=1);

/**
 * Reads the plugin version from the plugin header, the only place where it is maintained.
 */

if (defined('UAM_VERSION') === false) {
    $pluginFile = fopen(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'user-access-manager.php', 'r');
    $pluginHeader = '';

    if ($pluginFile !== false) {
        $pluginHeader = (string) fread($pluginFile, 8192);
        fclose($pluginFile);
    }

    define(
        'UAM_VERSION',
        preg_match('/^[ \t\/*#@]*Version:(.*)$/mi', $pluginHeader, $versionMatches) === 1 ?
            trim($versionMatches[1]) : ''
    );

    unset($pluginFile, $pluginHeader, $versionMatches);
}

```
