Fix some naming and spacing in lib/util.php
This commit is contained in:
parent
9c5416fe4a
commit
65d802329f
|
@ -34,7 +34,7 @@ $opts = array(
|
||||||
'hasMSSQL' => $hasMSSQL,
|
'hasMSSQL' => $hasMSSQL,
|
||||||
'directory' => $datadir,
|
'directory' => $datadir,
|
||||||
'secureRNG' => OC_Util::secureRNGAvailable(),
|
'secureRNG' => OC_Util::secureRNGAvailable(),
|
||||||
'htaccessWorking' => OC_Util::isHtaccessWorking(),
|
'htaccessWorking' => OC_Util::isHtAccessWorking(),
|
||||||
'vulnerableToNullByte' => $vulnerableToNullByte,
|
'vulnerableToNullByte' => $vulnerableToNullByte,
|
||||||
'errors' => array(),
|
'errors' => array(),
|
||||||
);
|
);
|
||||||
|
|
|
@ -413,7 +413,7 @@ class OC {
|
||||||
}
|
}
|
||||||
|
|
||||||
self::initPaths();
|
self::initPaths();
|
||||||
OC_Util::isSetlocaleWorking();
|
OC_Util::isSetLocaleWorking();
|
||||||
|
|
||||||
// set debug mode if an xdebug session is active
|
// set debug mode if an xdebug session is active
|
||||||
if (!defined('DEBUG') || !DEBUG) {
|
if (!defined('DEBUG') || !DEBUG) {
|
||||||
|
@ -522,7 +522,7 @@ class OC {
|
||||||
}
|
}
|
||||||
|
|
||||||
// write error into log if locale can't be set
|
// write error into log if locale can't be set
|
||||||
if (OC_Util::isSetlocaleWorking() == false) {
|
if (OC_Util::isSetLocaleWorking() == false) {
|
||||||
OC_Log::write('core',
|
OC_Log::write('core',
|
||||||
'setting locale to en_US.UTF-8/en_US.UTF8 failed. Support is probably not installed on your system',
|
'setting locale to en_US.UTF-8/en_US.UTF8 failed. Support is probably not installed on your system',
|
||||||
OC_Log::ERROR);
|
OC_Log::ERROR);
|
||||||
|
|
25
lib/util.php
25
lib/util.php
|
@ -18,9 +18,11 @@ class OC_Util {
|
||||||
* @brief Can be set up
|
* @brief Can be set up
|
||||||
* @param user string
|
* @param user string
|
||||||
* @return boolean
|
* @return boolean
|
||||||
|
* @description configure the initial filesystem based on the configuration
|
||||||
*/
|
*/
|
||||||
public static function setupFS( $user = '' ) { // configure the initial filesystem based on the configuration
|
public static function setupFS( $user = '' ) {
|
||||||
if(self::$fsSetup) { //setting up the filesystem twice can only lead to trouble
|
//setting up the filesystem twice can only lead to trouble
|
||||||
|
if(self::$fsSetup) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,11 +73,11 @@ class OC_Util {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function tearDownFS() {
|
public static function tearDownFS() {
|
||||||
\OC\Files\Filesystem::tearDown();
|
\OC\Files\Filesystem::tearDown();
|
||||||
self::$fsSetup=false;
|
self::$fsSetup=false;
|
||||||
self::$rootMounted=false;
|
self::$rootMounted=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -165,9 +167,10 @@ class OC_Util {
|
||||||
* @param int timestamp $timestamp
|
* @param int timestamp $timestamp
|
||||||
* @param bool dateOnly option to omit time from the result
|
* @param bool dateOnly option to omit time from the result
|
||||||
* @return string timestamp
|
* @return string timestamp
|
||||||
|
* @description adjust to clients timezone if we know it
|
||||||
*/
|
*/
|
||||||
public static function formatDate( $timestamp, $dateOnly=false) {
|
public static function formatDate( $timestamp, $dateOnly=false) {
|
||||||
if(\OC::$session->exists('timezone')) { //adjust to clients timezone if we know it
|
if(\OC::$session->exists('timezone')) {
|
||||||
$systemTimeZone = intval(date('O'));
|
$systemTimeZone = intval(date('O'));
|
||||||
$systemTimeZone = (round($systemTimeZone/100, 0)*60) + ($systemTimeZone%100);
|
$systemTimeZone = (round($systemTimeZone/100, 0)*60) + ($systemTimeZone%100);
|
||||||
$clientTimeZone = \OC::$session->get('timezone')*60;
|
$clientTimeZone = \OC::$session->get('timezone')*60;
|
||||||
|
@ -629,13 +632,15 @@ class OC_Util {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Check if the htaccess file is working by creating a test file in the data directory and trying to access via http
|
* @brief Check if the htaccess file is working
|
||||||
* @return bool
|
* @return bool
|
||||||
|
* @description Check if the htaccess file is working by creating a test
|
||||||
|
* file in the data directory and trying to access via http
|
||||||
*/
|
*/
|
||||||
public static function isHtaccessWorking() {
|
public static function isHtAccessWorking() {
|
||||||
// testdata
|
// testdata
|
||||||
$filename = '/htaccesstest.txt';
|
$fileName = '/htaccesstest.txt';
|
||||||
$testcontent = 'testcontent';
|
$testContent = 'testcontent';
|
||||||
|
|
||||||
// creating a test file
|
// creating a test file
|
||||||
$testfile = OC_Config::getValue( "datadirectory", OC::$SERVERROOT."/data" ).'/'.$filename;
|
$testfile = OC_Config::getValue( "datadirectory", OC::$SERVERROOT."/data" ).'/'.$filename;
|
||||||
|
@ -718,7 +723,7 @@ class OC_Util {
|
||||||
* local packages are not available on the server.
|
* local packages are not available on the server.
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function isSetlocaleWorking() {
|
public static function isSetLocaleWorking() {
|
||||||
// setlocale test is pointless on Windows
|
// setlocale test is pointless on Windows
|
||||||
if (OC_Util::runningOnWindows() ) {
|
if (OC_Util::runningOnWindows() ) {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -15,7 +15,7 @@ OC_App::setActiveNavigationEntry( "admin" );
|
||||||
|
|
||||||
$tmpl = new OC_Template( 'settings', 'admin', 'user');
|
$tmpl = new OC_Template( 'settings', 'admin', 'user');
|
||||||
$forms=OC_App::getForms('admin');
|
$forms=OC_App::getForms('admin');
|
||||||
$htaccessworking=OC_Util::isHtaccessWorking();
|
$htaccessworking=OC_Util::isHtAccessWorking();
|
||||||
|
|
||||||
$entries=OC_Log_Owncloud::getEntries(3);
|
$entries=OC_Log_Owncloud::getEntries(3);
|
||||||
$entriesremain=(count(OC_Log_Owncloud::getEntries(4)) > 3)?true:false;
|
$entriesremain=(count(OC_Log_Owncloud::getEntries(4)) > 3)?true:false;
|
||||||
|
@ -25,7 +25,7 @@ $tmpl->assign('entries', $entries);
|
||||||
$tmpl->assign('entriesremain', $entriesremain);
|
$tmpl->assign('entriesremain', $entriesremain);
|
||||||
$tmpl->assign('htaccessworking', $htaccessworking);
|
$tmpl->assign('htaccessworking', $htaccessworking);
|
||||||
$tmpl->assign('internetconnectionworking', OC_Util::isInternetConnectionEnabled() ? OC_Util::isInternetConnectionWorking() : false);
|
$tmpl->assign('internetconnectionworking', OC_Util::isInternetConnectionEnabled() ? OC_Util::isInternetConnectionWorking() : false);
|
||||||
$tmpl->assign('islocaleworking', OC_Util::isSetlocaleWorking());
|
$tmpl->assign('islocaleworking', OC_Util::isSetLocaleWorking());
|
||||||
$tmpl->assign('isWebDavWorking', OC_Util::isWebDAVWorking());
|
$tmpl->assign('isWebDavWorking', OC_Util::isWebDAVWorking());
|
||||||
$tmpl->assign('has_fileinfo', OC_Util::fileInfoLoaded());
|
$tmpl->assign('has_fileinfo', OC_Util::fileInfoLoaded());
|
||||||
$tmpl->assign('backgroundjobs_mode', OC_Appconfig::getValue('core', 'backgroundjobs_mode', 'ajax'));
|
$tmpl->assign('backgroundjobs_mode', OC_Appconfig::getValue('core', 'backgroundjobs_mode', 'ajax'));
|
||||||
|
|
Loading…
Reference in New Issue