aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/db/extractor/sqlite3_extractor.php
diff options
context:
space:
mode:
authorJoshyPHP <s9e.dev@gmail.com>2015-12-05 09:53:26 +0100
committerJoshyPHP <s9e.dev@gmail.com>2015-12-05 09:53:26 +0100
commit4b8acefc6c3ed245778843ae7e52a7576eef6c28 (patch)
tree8b717959ef87685c6aed5b2c3a9129b3c7714d8c /phpBB/phpbb/db/extractor/sqlite3_extractor.php
parentb0dfca1dbf503d8dbbcac87d7025b73227fb27ad (diff)
downloadforums-4b8acefc6c3ed245778843ae7e52a7576eef6c28.tar
forums-4b8acefc6c3ed245778843ae7e52a7576eef6c28.tar.gz
forums-4b8acefc6c3ed245778843ae7e52a7576eef6c28.tar.bz2
forums-4b8acefc6c3ed245778843ae7e52a7576eef6c28.tar.xz
forums-4b8acefc6c3ed245778843ae7e52a7576eef6c28.zip
[ticket/13451] Added regression test
PHPBB3-13451
Diffstat (limited to 'phpBB/phpbb/db/extractor/sqlite3_extractor.php')
0 files changed, 0 insertions, 0 deletions
'n35' href='#n35'>35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
package Xconfig; # $Id$

use diagnostics;
use strict;

use common qw(:common :file :system);
use mouse;
use devices;
use Xconfigurator;

# otherwise uses the rule substr($keymap, 0, 2)
my %keymap_translate = (
    cf => "ca_enhanced",
    uk => "gb",
);


1;

sub keymap_translate {
    $keymap_translate{$_[0]} || substr($_[0], 0, 2);
}


sub getinfo {
    my $o = shift || {};
    getinfoFromDDC($o);
    getinfoFromSysconfig($o);

    add2hash($o->{mouse}, mouse::detect()) unless $o->{mouse}{XMOUSETYPE};

    $o->{mouse}{device} ||= "mouse" if -e "/dev/mouse";
    $o;
}

sub getinfoFromXF86Config {
    my $o = shift || {};
    my $prefix = shift || "";
    my (%c, $depth, $driver);

    $o->{card}{server} ||= $1 if readlink("$prefix/etc/X11/X") =~ /XF86_ (\w+)$/x; #- /x for perl2fcalls

    local *F;
    open F, "$prefix/etc/X11/XF86Config" or return {};
    foreach (<F>) {
	if (/^Section "Keyboard"/ .. /^EndSection/) {
	    $o->{keyboard}{xkb_keymap} ||= $1 if /^\s*XkbLayout\s+"(.*?)"/;
	} elsif (/^Section "Pointer"/ .. /^EndSection/) {
	    $o->{mouse}{XMOUSETYPE} ||= $1 if /^\s*Protocol\s+"(.*?)"/;
	    $o->{mouse}{device} ||= $1 if m|^\s*Device\s+"/dev/(.*?)"|;