summaryrefslogtreecommitdiffstats
path: root/lib/config.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/config.php')
-rw-r--r--lib/config.php28
1 files changed, 15 insertions, 13 deletions
diff --git a/lib/config.php b/lib/config.php
index 266d559126c..032d401264c 100644
--- a/lib/config.php
+++ b/lib/config.php
@@ -52,7 +52,7 @@ class OC_Config{
* This function returns all keys saved in config.php. Please note that it
* does not return the values.
*/
- public static function getKeys(){
+ public static function getKeys() {
self::readData();
return array_keys( self::$cache );
@@ -67,10 +67,10 @@ class OC_Config{
* This function gets the value from config.php. If it does not exist,
* $default will be returned.
*/
- public static function getValue( $key, $default = null ){
+ public static function getValue( $key, $default = null ) {
self::readData();
- if( array_key_exists( $key, self::$cache )){
+ if( array_key_exists( $key, self::$cache )) {
return self::$cache[$key];
}
@@ -86,7 +86,7 @@ class OC_Config{
* This function sets the value and writes the config.php. If the file can
* not be written, false will be returned.
*/
- public static function setValue( $key, $value ){
+ public static function setValue( $key, $value ) {
self::readData();
// Add change
@@ -105,10 +105,10 @@ class OC_Config{
* This function removes a key from the config.php. If owncloud has no
* write access to config.php, the function will return false.
*/
- public static function deleteKey( $key ){
+ public static function deleteKey( $key ) {
self::readData();
- if( array_key_exists( $key, self::$cache )){
+ if( array_key_exists( $key, self::$cache )) {
// Delete key from cache
unset( self::$cache[$key] );
@@ -125,18 +125,18 @@ class OC_Config{
*
* Reads the config file and saves it to the cache
*/
- private static function readData(){
- if( self::$init ){
+ private static function readData() {
+ if( self::$init ) {
return true;
}
- if( !file_exists( OC::$SERVERROOT."/config/config.php" )){
+ if( !file_exists( OC::$SERVERROOT."/config/config.php" )) {
return false;
}
// Include the file, save the data from $CONFIG
- include( OC::$SERVERROOT."/config/config.php" );
- if( isset( $CONFIG ) && is_array( $CONFIG )){
+ include OC::$SERVERROOT."/config/config.php";
+ if( isset( $CONFIG ) && is_array( $CONFIG )) {
self::$cache = $CONFIG;
}
@@ -153,7 +153,7 @@ class OC_Config{
* Saves the config to the config file.
*
*/
- public static function writeData(){
+ public static function writeData() {
// Create a php file ...
$content = "<?php\n\$CONFIG = ";
$content .= var_export(self::$cache, true);
@@ -164,7 +164,9 @@ class OC_Config{
$result=@file_put_contents( $filename, $content );
if(!$result) {
$tmpl = new OC_Template( '', 'error', 'guest' );
- $tmpl->assign('errors',array(1=>array('error'=>"Can't write into config directory 'config'",'hint'=>"You can usually fix this by giving the webserver user write access to the config directory in owncloud")));
+ $tmpl->assign('errors', array(1=>array(
+ 'error'=>"Can't write into config directory 'config'",
+ 'hint'=>"You can usually fix this by giving the webserver user write access to the config directory in owncloud")));
$tmpl->printPage();
exit;
}