Mercurial > hg > rc1
diff vendor/pear/crypt_gpg/scripts/crypt-gpg-pinentry @ 0:1e000243b222
vanilla 1.3.3 distro, I hope
author | Charlie Root |
---|---|
date | Thu, 04 Jan 2018 15:50:29 -0500 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/crypt_gpg/scripts/crypt-gpg-pinentry Thu Jan 04 15:50:29 2018 -0500 @@ -0,0 +1,33 @@ +#! /usr/bin/env php +<?php + +/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ + +// Check if we're running directly from git repo or if we're running +// from a PEAR or Composer packaged version. +$ds = DIRECTORY_SEPARATOR; +$root = __DIR__ . $ds . '..' ; +$paths = array( + '@php-dir@', // PEAR or Composer + $root, // Git (or Composer with wrong @php-dir@) + $root . $ds . '..' . $ds . 'Console_CommandLine', // Composer + $root . $ds . '..' . $ds . 'console_commandline', // Composer + // and composer-installed PEAR_Exception for Console_CommandLine (#21074) + $root . $ds . '..' . $ds . '..' . $ds . 'pear' . $ds . 'pear_exception', +); + +foreach ($paths as $idx => $path) { + if (!is_dir($path)) { + unset($paths[$idx]); + } +} + +// We depend on Console_CommandLine, so we append also the default include path +set_include_path(implode(PATH_SEPARATOR, $paths) . PATH_SEPARATOR . get_include_path()); + +require_once 'Crypt/GPG/PinEntry.php'; + +$pinentry = new Crypt_GPG_PinEntry(); +$pinentry->__invoke(); + +?>