aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/paragonie/random_compat/other/build_phar.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-01-13 09:50:53 +0000
committerMario <mario@mariovavti.com>2021-01-13 09:50:53 +0000
commit5eefdc6485b2f6082f6fe5dfd6f1731fae7e3a2a (patch)
tree7521f4800e393538d19c393c6f495ea2d41cbf5a /vendor/paragonie/random_compat/other/build_phar.php
parent0bc4c7d1a0e4348018e533be600ad1c648fd97fb (diff)
parent4d2bcbc5837a7d99dc541595ca8087c335242af0 (diff)
downloadvolse-hubzilla-5eefdc6485b2f6082f6fe5dfd6f1731fae7e3a2a.tar.gz
volse-hubzilla-5eefdc6485b2f6082f6fe5dfd6f1731fae7e3a2a.tar.bz2
volse-hubzilla-5eefdc6485b2f6082f6fe5dfd6f1731fae7e3a2a.zip
Merge branch '5.2RC'5.2
Diffstat (limited to 'vendor/paragonie/random_compat/other/build_phar.php')
-rw-r--r--vendor/paragonie/random_compat/other/build_phar.php57
1 files changed, 0 insertions, 57 deletions
diff --git a/vendor/paragonie/random_compat/other/build_phar.php b/vendor/paragonie/random_compat/other/build_phar.php
deleted file mode 100644
index 70ef4b2ed..000000000
--- a/vendor/paragonie/random_compat/other/build_phar.php
+++ /dev/null
@@ -1,57 +0,0 @@
-<?php
-$dist = dirname(__DIR__).'/dist';
-if (!is_dir($dist)) {
- mkdir($dist, 0755);
-}
-if (file_exists($dist.'/random_compat.phar')) {
- unlink($dist.'/random_compat.phar');
-}
-$phar = new Phar(
- $dist.'/random_compat.phar',
- FilesystemIterator::CURRENT_AS_FILEINFO | \FilesystemIterator::KEY_AS_FILENAME,
- 'random_compat.phar'
-);
-rename(
- dirname(__DIR__).'/lib/random.php',
- dirname(__DIR__).'/lib/index.php'
-);
-$phar->buildFromDirectory(dirname(__DIR__).'/lib');
-rename(
- dirname(__DIR__).'/lib/index.php',
- dirname(__DIR__).'/lib/random.php'
-);
-
-/**
- * If we pass an (optional) path to a private key as a second argument, we will
- * sign the Phar with OpenSSL.
- *
- * If you leave this out, it will produce an unsigned .phar!
- */
-if ($argc > 1) {
- if (!@is_readable($argv[1])) {
- echo 'Could not read the private key file:', $argv[1], "\n";
- exit(255);
- }
- $pkeyFile = file_get_contents($argv[1]);
-
- $private = openssl_get_privatekey($pkeyFile);
- if ($private !== false) {
- $pkey = '';
- openssl_pkey_export($private, $pkey);
- $phar->setSignatureAlgorithm(Phar::OPENSSL, $pkey);
-
- /**
- * Save the corresponding public key to the file
- */
- if (!@is_readable($dist.'/random_compat.phar.pubkey')) {
- $details = openssl_pkey_get_details($private);
- file_put_contents(
- $dist.'/random_compat.phar.pubkey',
- $details['key']
- );
- }
- } else {
- echo 'An error occurred reading the private key from OpenSSL.', "\n";
- exit(255);
- }
-}