PluginProbe
WindPress – Tailwind CSS integration for WordPress / 3.0.0
WindPress – Tailwind CSS integration for WordPress v3.0.0
3.2.90 3.2.89 3.2.88 3.2.87 3.2.86 3.2.85 3.2.84 3.2.83 3.2.82 3.2.81 trunk 3.0.0 3.0.1 3.0.10 3.0.11 3.0.12 3.0.13 3.0.14 3.0.15 3.0.16 3.0.17 3.0.2 3.0.3 3.0.4 3.0.5 All 144 releases
windpress / vendor / paragonie / random_compat / other / build_phar.php

build_phar.php in WindPress – Tailwind CSS integration for WordPress 3.0.0, at vendor/paragonie/random_compat/other/build_phar.php

45 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace WindPressPackages;
4
5 $dist = \dirname(__DIR__) . '/dist';
6 if (!\is_dir($dist)) {
7 \mkdir($dist, 0755);
8 }
9 if (\file_exists($dist . '/random_compat.phar')) {
10 \unlink($dist . '/random_compat.phar');
11 }
12 $phar = new \Phar($dist . '/random_compat.phar', \FilesystemIterator::CURRENT_AS_FILEINFO | \FilesystemIterator::KEY_AS_FILENAME, 'random_compat.phar');
13 \rename(\dirname(__DIR__) . '/lib/random.php', \dirname(__DIR__) . '/lib/index.php');
14 $phar->buildFromDirectory(\dirname(__DIR__) . '/lib');
15 \rename(\dirname(__DIR__) . '/lib/index.php', \dirname(__DIR__) . '/lib/random.php');
16 /**
17 * If we pass an (optional) path to a private key as a second argument, we will
18 * sign the Phar with OpenSSL.
19 *
20 * If you leave this out, it will produce an unsigned .phar!
21 */
22 if ($argc > 1) {
23 if (!@\is_readable($argv[1])) {
24 echo 'Could not read the private key file:', $argv[1], "\n";
25 exit(255);
26 }
27 $pkeyFile = \file_get_contents($argv[1]);
28 $private = \openssl_get_privatekey($pkeyFile);
29 if ($private !== \false) {
30 $pkey = '';
31 \openssl_pkey_export($private, $pkey);
32 $phar->setSignatureAlgorithm(\Phar::OPENSSL, $pkey);
33 /**
34 * Save the corresponding public key to the file
35 */
36 if (!@\is_readable($dist . '/random_compat.phar.pubkey')) {
37 $details = \openssl_pkey_get_details($private);
38 \file_put_contents($dist . '/random_compat.phar.pubkey', $details['key']);
39 }
40 } else {
41 echo 'An error occurred reading the private key from OpenSSL.', "\n";
42 exit(255);
43 }
44 }
45