File: crypt-gpg-pinentry

package info (click to toggle)
php-crypt-gpg 1.6.4-2%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,184 kB
  • sloc: php: 9,171; xml: 201; makefile: 9
file content (33 lines) | stat: -rwxr-xr-x 1,039 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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();

?>