1
|
<?php
|
2
|
|
3
|
/*
|
4
|
* To change this template, choose Tools | Templates
|
5
|
* and open the template in the editor.
|
6
|
*/
|
7
|
|
8
|
/**
|
9
|
* InstallHelper.php
|
10
|
*
|
11
|
* @category Core
|
12
|
* @package Core_package
|
13
|
* @subpackage Name of the subpackage if needed
|
14
|
* @copyright Manuela v.d.Decken <manuela@isteam.de>
|
15
|
* @author Manuela v.d.Decken <manuela@isteam.de>
|
16
|
* @license http://www.gnu.org/licenses/gpl.html GPL License
|
17
|
* @version 0.0.1
|
18
|
* @revision $Revision: $
|
19
|
* @link $HeadURL: $
|
20
|
* @lastmodified $Date: $
|
21
|
* @since File available since 19.09.2014
|
22
|
* @deprecated This class is deprecated since the ...
|
23
|
* @description xyz
|
24
|
*/
|
25
|
class InstallHelper {
|
26
|
|
27
|
|
28
|
/*
|
29
|
Find all available languages in /language/ folder and build option list from
|
30
|
*/
|
31
|
public static function getAvailableLanguages($sLanguageDirectory)
|
32
|
{
|
33
|
$aRetval = array();
|
34
|
$sLangDir = rtrim(str_replace('\\', '/', $sLanguageDirectory), '/').'/';
|
35
|
$aAvailableLanguages = preg_replace('/^.*\/([A-Z]{2})\.php$/iU', '\1', glob($sLangDir.'??.php'));
|
36
|
sort($aAvailableLanguages, SORT_NATURAL);
|
37
|
foreach ($aAvailableLanguages as $sLangCode) {
|
38
|
if (is_readable($sLangDir.$sLangCode.'.php')) {
|
39
|
if (($sContent = file_get_contents($sLangDir.$sLangCode.'.php', false, null, -1, 2048)) !== false) {
|
40
|
if (preg_match('/.*\s*\$language_name\s*=\s*([\'\"])([^\1]*)\1\s*;/siU', $sContent, $aMatches)) {
|
41
|
$aRetval[$sLangCode] = $aMatches[2];
|
42
|
}
|
43
|
}
|
44
|
}
|
45
|
}
|
46
|
return $aRetval;
|
47
|
}
|
48
|
|
49
|
}
|
50
|
|
51
|
// end of class Helper
|