handle default git+workdir in phar files
[phorkie.git] / data / config.default.php
1 <?php
2 $pharFile = \Phar::running();
3 if ($pharFile == '') {
4     $phorkieDir = __DIR__ . '/../';
5 } else {
6     //remove phar:// from the path
7     $phorkieDir = dirname(substr($pharFile, 7)) . '/';
8 }
9
10 $GLOBALS['phorkie']['cfg'] = array(
11     'debug'         => false,
12     'gitdir'        => $phorkieDir . 'repos/git/',
13     'workdir'       => $phorkieDir . 'repos/work/',
14     'tpl'           => __DIR__ . '/templates/',
15     'baseurl'       => null,
16     'avatars'       => true,
17     'css'           => '',
18     'iconpng'       => '',//phorkie browser icon (favicon)
19     'title'         => 'phorkie',
20     'topbar'        => '',
21     'setupcheck'    => true,
22     'elasticsearch' => null,
23     'geshi'         => 'MediaWiki/geshi/geshi/geshi.php',
24     'index'         => 'new',//"new" or "list"
25     'perPage'       => 10,
26     'defaultListPage' => 'last',//a number or "last"
27     'notificator'   => array(
28         /* send out pingback/webmentions when a remote paste is forked */
29         'linkback'  => true,
30         'webhook'   => array(
31             /* array of urls that get called when
32                a paste is created, edited or deleted */
33         )
34     ),
35 );
36 $GLOBALS['phorkie']['auth'] = array(
37     // 0 = public, no authentication, 1 = protect adds/edits/deletes,
38     // 2 = require authentication
39     'securityLevel'   => 0,
40     'listedUsersOnly' => false,
41     'users'           => array(),             // Array of OpenIDs that may login
42     'anonymousName'   => 'Anonymous',         // Email for non-authenticated commits
43     'anonymousEmail'  => 'anonymous@phorkie', // Email for non-authenticated commits
44 );
45 $GLOBALS['phorkie']['tools'] = array(
46     '\\phorkie\\Tool_Xmllint' => true,
47     '\\phorkie\\Tool_PHPlint' => true,
48 );
49 /**
50  * Array of supported file types / languages.
51  * Key is the file extension
52  */
53 $GLOBALS['phorkie']['languages'] = array(
54     'css' => array(
55         'title' => 'CSS',
56         'mime'  => 'text/css',
57         'geshi' => 'css'
58     ),
59     'diff' => array(
60         'title' => 'Diff',
61         'mime'  => 'text/diff',
62         'geshi' => 'diff'
63     ),
64     'htm' => array(
65         'title' => 'HTML',
66         'mime'  => 'text/html',
67         'geshi' => 'xml'
68     ),
69     'html' => array(
70         'title' => 'HTML',
71         'mime'  => 'text/html',
72         'geshi' => 'xml',
73         'show'  => false
74     ),
75     'jpg' => array(
76         'title' => 'JPEG image',
77         'mime'  => 'image/jpeg',
78         'show'  => false
79     ),
80     'ini' => array(
81         'title' => 'Ini',
82         'mime'  => 'text/ini',
83         'geshi' => 'ini'
84     ),
85     'js' => array(
86         'title' => 'Javascript',
87         'mime'  => 'application/javascript',
88         'geshi' => 'javascript'
89     ),
90     'json' => array(
91         'title' => 'Javascript',
92         'mime'  => 'application/javascript',
93         'geshi' => 'javascript',
94         'show'  => false
95     ),
96     'md' => array(
97         'title' => 'Markdown',
98         'mime'  => 'text/x-markdown',
99         'renderer' => '\\phorkie\\Renderer_Markdown'
100     ),
101     'pl' => array(
102         'title' => 'Perl',
103         'mime'  => 'application/x-perl',
104         'geshi' => 'pl'
105     ),
106     'php' => array(
107         'title' => 'PHP',
108         'mime'  => 'text/x-php',
109         'geshi' => 'php'
110     ),
111     'png' => array(
112         'title' => 'PNG image',
113         'mime'  => 'image/png',
114         'show'  => false
115     ),
116     'rb' => array(
117         'title' => 'Ruby/Rails',
118         'mime'  => 'text/x-ruby', /* Is this an acceptable mime type? */
119         'geshi' => 'rails'
120     ),
121     'rst' => array(
122         'title' => 'reStructuredText',
123         'mime'  => 'text/x-rst',
124         'geshi' => 'rst',
125         'renderer' => '\\phorkie\\Renderer_ReStructuredText',
126     ),
127     'sh' => array(
128         'title' => 'Shell script (Bash)',
129         'mime'  => 'text/x-shellscript',
130         'geshi' => 'bash'
131     ),
132     'sql' => array(
133         'title' => 'SQL',
134         'mime'  => 'text/x-sql',
135         'geshi' => 'sql'
136     ),
137     'svg' => array(
138         'title' => 'SVG image',
139         'mime'  => 'image/svg+xml',
140         'show'  => false
141     ),
142     'txt' => array(
143         'title' => 'Text (plain)',
144         'mime'  => 'text/plain',
145         'geshi' => 'txt'
146     ),
147     'ts' => array(
148         'title' => 'TypoScript',
149         'mime'  => 'text/x-typoscript',/* TODO: correct type */
150         'geshi' => 'typoscript'
151     ),
152     'wsdl' => array(
153         'title' => 'WSDL',
154         'mime'  => 'application/wsdl+xml',
155         'geshi' => 'xml'
156     ),
157     'xml' => array(
158         'title' => 'XML',
159         'mime'  => 'text/xml',
160         'geshi' => 'xml'
161     ),
162     'xsl' => array(
163         'title' => 'eXtensible Stylesheet Language',
164         'mime'  => 'text/xml',
165         'geshi' => 'xml',
166         'show'  => false
167     ),
168 );
169
170 //needed for UTF-8 characters in file names
171 setlocale(LC_CTYPE, 'en_US.UTF_8');
172 ?>