-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWikitexConstants.in.php
103 lines (97 loc) · 3.23 KB
/
WikitexConstants.in.php
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
34
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
<?php
/**
* WikiTeX: expansible LaTeX module for MediaWiki
*
* PHP version 5
*
* WikiTeX is licensed under the Artistic License 2.0; to
* view a copy of this license, see COPYING or visit:
*
* http://dev.perl.org/perl6/rfc/346.html
*
* @package Wikitex
* @author Peter Danenberg <[email protected]>
* @copyright Copyright (C) 2004-6 Peter Danenberg
* @version %VERSION%
* @link http://wikitex.org
* @since WikiTeX 1.1-beta2
*/
/**
* WikiTeX Constants.
*
* Provides centralized error messages and class to method mapping.
*
* @package Wikitex
* @author Peter Danenberg <[email protected]>
* @copyright Copyright (C) 2004-6 Peter Danenberg
* @version %VERSION%
* @link http://wikitex.org
* @since WikiTeX 1.1-beta2
*/
class Wikitex_Constants
{
/**
* Class to function mapping.
*
* Ideal topos for tranlation: maps in-article class names to names of functions
* within class {@link Wikitex}.
*
* @access protected
* @static
* @var array
*/
protected static $classHooks = array('amsmath' => 'amsmath',
'pstrix' => 'pstrix',
'chem' => 'chem',
'chess' => 'chess',
'feyn' => 'feyn',
'go' => 'go',
'greek' => 'greek',
'graph' => 'graph',
'music' => 'music',
'plot' => 'plot',
'svg' => 'svg',
'teng' => 'teng',
'ipa' => 'ipa');
/**
* Error messages.
*
* Simulated constant array with error messages.
*
* @access protected
* @static
* @var array
*/
protected static $errors = array('temp' => 'no template corresponds to said class.',
'cache' => 'unable to change to temp directory.',
'dir' => 'unable to create working directory.',
'perm' => 'unable to set permissions on working directory.',
'work' => 'unable to change to work directory.',
'src' => 'unable to write contents in work directory.',
'source' => 'source existeth nought or is illegible.',
'copy' => 'cannot copy data to the work directory.',
'bash' => '<code>wikitex.sh</code> is not executable.');
/**
* Get class to function mapping.
*
* Maps in-article class name to methods within {@link Wikitex}.
* @access public
* @static
* @return array array containing class to function mapping.
*/
public static function getHooks() {
return self::$classHooks;
}
/**
* Get error messages.
*
* Maps error type to message; simulates constant array.
* @static
* @access public
* @return array containing closs to error mapping.
*/
public static function getErrors() {
return self::$errors;
}
}
?>