MDL-17458 rewritten installer
This commit is contained in:
+45
-41
@@ -24,45 +24,6 @@
|
||||
// //
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/// Required files
|
||||
require_once($CFG->libdir.'/typo3/class.t3lib_cs.php');
|
||||
require_once($CFG->libdir.'/typo3/class.t3lib_div.php');
|
||||
|
||||
/// If ICONV is available, lets Typo3 library use it for convert
|
||||
if (extension_loaded('iconv')) {
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['t3lib_cs_convMethod'] = 'iconv';
|
||||
/// Else if mbstring is available, lets Typo3 library use it
|
||||
} else if (extension_loaded('mbstring')) {
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['t3lib_cs_convMethod'] = 'mbstring';
|
||||
/// Else if recode is available, lets Typo3 library use it
|
||||
} else if (extension_loaded('recode')) {
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['t3lib_cs_convMethod'] = 'recode';
|
||||
} else {
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['t3lib_cs_convMethod'] = '';
|
||||
}
|
||||
|
||||
/// If mbstring is available, lets Typo3 library use it for functions
|
||||
if (extension_loaded('mbstring')) {
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['t3lib_cs_utils'] = 'mbstring';
|
||||
} else {
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['t3lib_cs_utils'] = '';
|
||||
}
|
||||
|
||||
/// And this directory must exist to allow Typo to cache conversion
|
||||
/// tables when using internal functions
|
||||
make_upload_directory('temp/typo3temp/cs');
|
||||
|
||||
/// Default mask for Typo
|
||||
$GLOBALS['TYPO3_CONF_VARS']['BE']['fileCreateMask'] = $CFG->directorypermissions;
|
||||
|
||||
/// This full path constants must be defined too, transforming backslashes
|
||||
/// to forward slashed beacuse Typo3 requires it.
|
||||
define ('PATH_t3lib', str_replace('\\','/',$CFG->libdir.'/typo3/'));
|
||||
define ('PATH_typo3', str_replace('\\','/',$CFG->libdir.'/typo3/'));
|
||||
define ('PATH_site', str_replace('\\','/',$CFG->dataroot.'/temp/'));
|
||||
define ('TYPO3_OS', stristr(PHP_OS,'win')&&!stristr(PHP_OS,'darwin')?'WIN':'');
|
||||
|
||||
|
||||
/// As we implement the singleton pattern to use this class (only one instance
|
||||
/// is shared globally), we need this helper function
|
||||
|
||||
@@ -71,8 +32,51 @@
|
||||
/// from every wrapper function!
|
||||
|
||||
function textlib_get_instance() {
|
||||
static $instance;
|
||||
if (!is_object($instance)) {
|
||||
global $CFG;
|
||||
|
||||
static $instance = null;
|
||||
|
||||
if (!$instance) {
|
||||
/// initialisation is delayed because we do not want this on each page ;-)
|
||||
|
||||
/// Required files
|
||||
require_once($CFG->libdir.'/typo3/class.t3lib_cs.php');
|
||||
require_once($CFG->libdir.'/typo3/class.t3lib_div.php');
|
||||
|
||||
/// If ICONV is available, lets Typo3 library use it for convert
|
||||
if (extension_loaded('iconv')) {
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['t3lib_cs_convMethod'] = 'iconv';
|
||||
/// Else if mbstring is available, lets Typo3 library use it
|
||||
} else if (extension_loaded('mbstring')) {
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['t3lib_cs_convMethod'] = 'mbstring';
|
||||
/// Else if recode is available, lets Typo3 library use it
|
||||
} else if (extension_loaded('recode')) {
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['t3lib_cs_convMethod'] = 'recode';
|
||||
} else {
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['t3lib_cs_convMethod'] = '';
|
||||
}
|
||||
|
||||
/// If mbstring is available, lets Typo3 library use it for functions
|
||||
if (extension_loaded('mbstring')) {
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['t3lib_cs_utils'] = 'mbstring';
|
||||
} else {
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['t3lib_cs_utils'] = '';
|
||||
}
|
||||
|
||||
/// And this directory must exist to allow Typo to cache conversion
|
||||
/// tables when using internal functions
|
||||
make_upload_directory('temp/typo3temp/cs');
|
||||
|
||||
/// Default mask for Typo
|
||||
$GLOBALS['TYPO3_CONF_VARS']['BE']['fileCreateMask'] = $CFG->directorypermissions;
|
||||
|
||||
/// This full path constants must be defined too, transforming backslashes
|
||||
/// to forward slashed beacuse Typo3 requires it.
|
||||
define ('PATH_t3lib', str_replace('\\','/',$CFG->libdir.'/typo3/'));
|
||||
define ('PATH_typo3', str_replace('\\','/',$CFG->libdir.'/typo3/'));
|
||||
define ('PATH_site', str_replace('\\','/',$CFG->dataroot.'/temp/'));
|
||||
define ('TYPO3_OS', stristr(PHP_OS,'win')&&!stristr(PHP_OS,'darwin')?'WIN':'');
|
||||
|
||||
$instance = new textlib();
|
||||
}
|
||||
return $instance;
|
||||
|
||||
Reference in New Issue
Block a user