You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

crypt-gpg-pinentry 1.0KB

123456789101112131415161718192021222324252627282930313233
  1. #! /usr/bin/env php
  2. <?php
  3. /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
  4. // Check if we're running directly from git repo or if we're running
  5. // from a PEAR or Composer packaged version.
  6. $ds = DIRECTORY_SEPARATOR;
  7. $root = __DIR__ . $ds . '..' ;
  8. $paths = array(
  9. '@php-dir@', // PEAR or Composer
  10. $root, // Git (or Composer with wrong @php-dir@)
  11. $root . $ds . '..' . $ds . 'Console_CommandLine', // Composer
  12. $root . $ds . '..' . $ds . 'console_commandline', // Composer
  13. // and composer-installed PEAR_Exception for Console_CommandLine (#21074)
  14. $root . $ds . '..' . $ds . '..' . $ds . 'pear' . $ds . 'pear_exception',
  15. );
  16. foreach ($paths as $idx => $path) {
  17. if (!is_dir($path)) {
  18. unset($paths[$idx]);
  19. }
  20. }
  21. // We depend on Console_CommandLine, so we append also the default include path
  22. set_include_path(implode(PATH_SEPARATOR, $paths) . PATH_SEPARATOR . get_include_path());
  23. require_once 'Crypt/GPG/PinEntry.php';
  24. $pinentry = new Crypt_GPG_PinEntry();
  25. $pinentry->__invoke();
  26. ?>