OCP\User::checkAdminUser();
$htaccessWorking=(getenv('htaccessWorking')=='true');
-
-$upload_max_filesize = OCP\Util::computerFileSize(ini_get('upload_max_filesize'));
-$post_max_size = OCP\Util::computerFileSize(ini_get('post_max_size'));
+$upload_max_filesize = OC::$server->getIniWrapper()->getBytes('upload_max_filesize');
+$post_max_size = OC::$server->getIniWrapper()->getBytes('post_max_size');
$maxUploadFilesize = OCP\Util::humanFileSize(min($upload_max_filesize, $post_max_size));
if($_POST && OC_Util::isCallRegistered()) {
if(isset($_POST['maxUploadSize'])) {
$errors = array(
UPLOAD_ERR_OK => $l->t('There is no error, the file uploaded with success'),
UPLOAD_ERR_INI_SIZE => $l->t('The uploaded file exceeds the upload_max_filesize directive in php.ini: ')
- . ini_get('upload_max_filesize'),
+ . OC::$server->getIniWrapper()->getNumeric('upload_max_filesize'),
UPLOAD_ERR_FORM_SIZE => $l->t('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form'),
UPLOAD_ERR_PARTIAL => $l->t('The uploaded file was only partially uploaded'),
UPLOAD_ERR_NO_FILE => $l->t('No file was uploaded'),
"firstDay" => json_encode($l->getFirstWeekDay()) ,
"oc_config" => json_encode(
array(
- 'session_lifetime' => min(\OCP\Config::getSystemValue('session_lifetime', ini_get('session.gc_maxlifetime')), ini_get('session.gc_maxlifetime')),
+ 'session_lifetime' => min(\OCP\Config::getSystemValue('session_lifetime', OC::$server->getIniWrapper()->getNumeric('session.gc_maxlifetime')), OC::$server->getIniWrapper()->getNumeric('session.gc_maxlifetime')),
'session_keepalive' => \OCP\Config::getSystemValue('session_keepalive', true),
'version' => implode('.', OC_Util::getVersion()),
'versionstring' => OC_Util::getVersionString(),
self::lockFiles($view, $dir, $files);
$streamer->sendHeaders($name);
- $executionTime = intval(ini_get('max_execution_time'));
+ $executionTime = intval(OC::$server->getIniWrapper()->getNumeric('max_execution_time'));
set_time_limit(0);
if ($getType === self::ZIP_FILES) {
foreach ($files as $file) {
// Default check will be done with $path directories :
$dirs = explode(PATH_SEPARATOR, $path);
// WARNING : We have to check if open_basedir is enabled :
- $obd = ini_get('open_basedir');
+ $obd = OC::$server->getIniWrapper()->getString('open_basedir');
if ($obd != "none") {
$obd_values = explode(PATH_SEPARATOR, $obd);
if (count($obd_values) > 0 and $obd_values[0]) {
static public function isAvailable() {
if (!extension_loaded('apc')) {
return false;
- } elseif (!ini_get('apc.enabled')) {
+ } elseif (!\OC::$server->getIniWrapper()->getBool('apc.enabled')) {
return false;
- } elseif (!ini_get('apc.enable_cli') && \OC::$CLI) {
+ } elseif (!\OC::$server->getIniWrapper()->getBool('apc.enable_cli') && \OC::$CLI) {
return false;
} else {
return true;
static public function isAvailable() {
if (!extension_loaded('apcu')) {
return false;
- } elseif (!ini_get('apc.enabled')) {
+ } elseif (!\OC::$server->getIniWrapper()->getBool('apc.enabled')) {
return false;
- } elseif (!ini_get('apc.enable_cli') && \OC::$CLI) {
+ } elseif (!\OC::$server->getIniWrapper()->getBool('apc.enable_cli') && \OC::$CLI) {
return false;
} elseif (version_compare(phpversion('apc'), '4.0.6') === -1) {
return false;
if (\OC::$CLI && !getenv('XCACHE_TEST')) {
return false;
}
- if (!function_exists('xcache_unset_by_prefix') && ini_get('xcache.admin.enable_auth')) {
+ if (!function_exists('xcache_unset_by_prefix') && \OC::$server->getIniWrapper()->getBool('xcache.admin.enable_auth')) {
// We do not want to use XCache if we can not clear it without
// using the administration function xcache_clear_cache()
// AND administration functions are password-protected.