-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathget-syn.php
38 lines (32 loc) · 922 Bytes
/
get-syn.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/**
* Simple script that updates syn.js by downloading it from NPM through Unpkg and attaches a file
* header comment. To switch to a different Syn version, just update $version variable appropriately.
*
* @codeCoverageIgnore
*/
$version = '0.15.0';
if ('cli' !== PHP_SAPI && 'phpdbg' !== PHP_SAPI) {
throw new RuntimeException('This script must be run from the command line.');
}
file_put_contents(
__DIR__ . '/syn.js',
sprintf(
<<<'JS'
/**
* Syn - Standalone Synthetic Event Library
*
* @generated by get-syn.php on %s
*
* @version %s
* @copyright 2014 Bitovi
* @license https://github.com/bitovi/syn/blob/master/LICENSE.md
*/
%s
JS,
date('r'),
$version,
file_get_contents("https://www.unpkg.com/syn@$version/dist/global/syn.js")
)
);
echo "Done.\n";