-
Notifications
You must be signed in to change notification settings - Fork 17
/
LanguageManager.php
82 lines (76 loc) · 2.18 KB
/
LanguageManager.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
<?php
namespace Enlighter;
class LanguageManager{
private $_cachedData = null;
// list of build-in languages
const LANGUAGES = array(
'generic' => 'Generic Highlighting',
'raw' => 'Plain text',
'abap' => 'ABAP',
'asm' => 'Generic Assembly',
'apache' => 'Apache httpd',
'avrasm' => 'Avr Assembly',
'bash' => 'Bash script',
'bat' => 'Batchfile',
'c' => 'C',
'cpp' => 'C++',
'csharp' => 'C#',
'css' => 'CSS',
'cython' => 'Cython',
'cordpro' => 'CordPro',
'dart' => 'Dart',
'diff' => 'Diff',
'dockerfile' => 'Dockerfile',
'groovy' => 'Groovy',
'golang' => 'Go',
'html' => 'HTML',
'htaccess' => '.htaccess',
'ini' => 'Ini/Conf Syntax',
'java' => 'Java',
'js' => 'Javascript',
'json' => 'JSON',
'kotlin' => 'Kotlin',
'latex' => 'LaTeX',
'less' => 'LESS',
'lighttpd' => 'lighttpd',
'lua' => 'Lua',
'md' => 'Markdown',
'mariadb' => 'MariaDB',
'matlab' => 'Matlab/Octave',
'mssql' => 'Microsoft SQL',
'nginx' => 'NGINX',
'nsis' => 'NSIS',
'oracledb' => 'OracleDB',
'php' => 'PHP',
'postgresql' => 'PostgreSQL',
'powershell' => 'PowerShell',
'prolog' => 'Prolog',
'python' => 'Python',
'purebasic' => 'Purebasic',
'qml' => 'QML',
'r' => 'R',
'routeros' => 'RouterOS',
'ruby' => 'Ruby',
'rust' => 'Rust',
'scala' => 'SCALA',
'scss' => 'SCSS',
'shell' => 'Shellscript',
'sql' => 'SQL',
'squirrel' => 'Squirrel',
'swift' => 'Swift',
'typescript' => 'TypeScript',
'vhdl' => 'VHDL',
'visualbasic' => 'VisualBasic',
'verilog' => 'Verilog',
'xml' => 'XML',
'yaml' => 'YAML'
);
// fetch the language list
public function getLanguages(){
// cached ?
if ($this->_cachedData === null){
$this->_cachedData = apply_filters('enlighter_languages', self::LANGUAGES);
}
return $this->_cachedData;
}
}