From 49beb2ff645d85668c994d143d1a6d1ff9edba15 Mon Sep 17 00:00:00 2001 From: rugk Date: Wed, 17 Aug 2016 19:37:40 +0200 Subject: [PATCH] Allow PHP files in vendor dir to be committed --- .gitignore | 20 ++++++- vendor/composer/autoload_files.php | 10 ++++ .../random_compat/other/build_phar.php | 57 +++++++++++++++++++ vendor/yzalis/identicon/src/autoload.php | 30 ++++++++++ 4 files changed, 114 insertions(+), 3 deletions(-) create mode 100644 vendor/composer/autoload_files.php create mode 100644 vendor/paragonie/random_compat/other/build_phar.php create mode 100644 vendor/yzalis/identicon/src/autoload.php diff --git a/.gitignore b/.gitignore index 8172e1c7..ec9e35a6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,23 @@ -# Ignore for safety +# Ignore server files for safety .htaccess .htpasswd -# Ignore data/ and vendor/ + +# Ignore data/ data/ -vendor/ + +# Ignore vendor dir except PHP files +vendor/*.* +vendor/*/*.* +vendor/*/*/*.* +vendor/*/*/*/*.* +vendor/*/*/*/*/*.* +vendor/*/*/*/*/*/*.* +vendor/**/LICENSE +vendor/**/test +vendor/**/tst +vendor/**/tests +!vendor/**/*.php + # Ignore unit testing logs, api docs and eclipse project files doc/ tst/log/ diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php new file mode 100644 index 00000000..4d80bcb5 --- /dev/null +++ b/vendor/composer/autoload_files.php @@ -0,0 +1,10 @@ + $vendorDir . '/paragonie/random_compat/lib/random.php', +); diff --git a/vendor/paragonie/random_compat/other/build_phar.php b/vendor/paragonie/random_compat/other/build_phar.php new file mode 100644 index 00000000..70ef4b2e --- /dev/null +++ b/vendor/paragonie/random_compat/other/build_phar.php @@ -0,0 +1,57 @@ +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); + } +} diff --git a/vendor/yzalis/identicon/src/autoload.php b/vendor/yzalis/identicon/src/autoload.php new file mode 100644 index 00000000..33f57e93 --- /dev/null +++ b/vendor/yzalis/identicon/src/autoload.php @@ -0,0 +1,30 @@ +