File: phar-version.php

package info (click to toggle)
phpunit 12.3.5-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 50,160 kB
  • sloc: php: 101,772; xml: 2,084; makefile: 124; sh: 99
file content (22 lines) | stat: -rwxr-xr-x 505 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env php
<?php declare(strict_types=1);

if (!isset($argv[1], $argv[2])) {
    exit(1);
}

\file_put_contents(
    __DIR__ . '/../tmp/phar/phpunit/Runner/Version.php',
    \str_replace(
        'private static string $pharVersion = \'\';',
        'private static string $pharVersion = \'' . $argv[1] . '\';',
        \file_get_contents(__DIR__ . '/../tmp/phar/phpunit/Runner/Version.php')
    ),
    \LOCK_EX
);

if ($argv[2] === 'release') {
    print $argv[1];
} else {
    print $argv[2];
}