@ -9,13 +9,21 @@
namespace OC\Core\Setup;
use bantu\IniGetWrapper\IniGetWrapper;
use OCP\IConfig;
use OCP\IL10N;
class Controller {
/**
* @var \OCP\IConfig
*/
protected $config;
/** @var IniGetWrapper */
protected $iniWrapper;
/** @var IL10N */
protected $l10n;
/** @var \OC_Defaults */
protected $defaults;
/**
* @var string
@ -24,12 +32,24 @@ class Controller {
/**
* @param IConfig $config
* @param IniGetWrapper $iniWrapper
* @param IL10N $l10n
* @param \OC_Defaults $defaults
*/
function __construct(IConfig $config) {
function __construct(IConfig $config,
IniGetWrapper $iniWrapper,
IL10N $l10n,
\OC_Defaults $defaults) {
$this->autoConfigFile = \OC::$SERVERROOT.'/config/autoconfig.php';
$this->config = $config;
$this->iniWrapper = $iniWrapper;
$this->l10n = $l10n;
$this->defaults = $defaults;
}
/**
* @param $post
*/
public function run($post) {
// Check for autosetup:
$post = $this->loadAutoConfig($post);
@ -138,16 +158,36 @@ class Controller {
}
}
if (\OC_Util::runningOnMac()) {
$l10n = \OC::$server->getL10N('core');
$theme = new \OC_Defaults();
$errors[] = array(
'error' => $l10n->t(
'error' => $this->l10n->t(
'Mac OS X is not supported and %s will not work properly on this platform. ' .
'Use it at your own risk! ',
$theme->getName()
$this->defaults->getName()
),
'hint' => $this->l10n->t('For the best results, please consider using a GNU/Linux server instead.')
);
}
if($this->iniWrapper->getString('open_basedir') !== '' & & PHP_INT_SIZE === 4) {
$errors[] = array(
'error' => $this->l10n->t(
'It seems that this %s instance is running on a 32bit PHP environment and the open_basedir has been configured in php.ini. ' .
'This will lead to problems with files over 4GB and is highly discouraged.',
$this->defaults->getName()
),
'hint' => $this->l10n->t('Please remove the open_basedir setting within your php.ini or switch to 64bit PHP.')
);
}
if(!function_exists('curl_init') & & PHP_INT_SIZE === 4) {
$errors[] = array(
'error' => $this->l10n->t(
'It seems that this %s instance is running on a 32bit PHP environment and cURL is not installed. ' .
'This will lead to problems with files over 4GB and is highly discouraged.',
$this->defaults->getName()
),
'hint' => $l10n->t('For the best results, please consider using a GNU/Linux server instead.')
'hint' => $this->l10n->t('Please install the cURL extension and restart your webserver .')
);
}