Style and comment fixes

remotes/origin/stable6
Michael Gapczynski 12 years ago
parent 195f6143a3
commit d50d663928
  1. 16
      lib/config.php
  2. 4
      lib/hintexception.php
  3. 12
      lib/legacy/config.php

@ -38,7 +38,7 @@ namespace OC;
/**
* This class is responsible for reading and writing config.php, the very basic
* configuration file of owncloud.
* configuration file of ownCloud.
*/
class Config {
// associative array key => value
@ -76,7 +76,7 @@ class Config {
* $default will be returned.
*/
public function getValue($key, $default = null) {
if( array_key_exists( $key, $this->cache )) {
if (isset($this->cache[$key])) {
return $this->cache[$key];
}
@ -88,8 +88,8 @@ class Config {
* @param string $key key
* @param string $value value
*
* This function sets the value and writes the config.php. If the file can
* not be written, false will be returned.
* This function sets the value and writes the config.php.
*
*/
public function setValue($key, $value) {
// Add change
@ -103,11 +103,11 @@ class Config {
* @brief Removes a key from the config
* @param string $key key
*
* This function removes a key from the config.php. If owncloud has no
* write access to config.php, the function will return false.
* This function removes a key from the config.php.
*
*/
public function deleteKey($key) {
if( array_key_exists( $key, $this->cache )) {
if (isset($this->cache[$key])) {
// Delete key from cache
unset($this->cache[$key]);
@ -169,7 +169,7 @@ class Config {
throw new HintException(
"Can't write into config directory 'config'",
'You can usually fix this by giving the webserver user write access'
.' to the config directory in owncloud');
.' to the config directory in ownCloud');
}
// Prevent others not to read the config
@chmod($this->configFilename, 0640);

@ -8,8 +8,8 @@
namespace OC;
class HintException extends \Exception
{
class HintException extends \Exception {
private $hint;
public function __construct($message, $hint, $code = 0, Exception $previous = null) {

@ -36,11 +36,13 @@
/**
* This class is responsible for reading and writing config.php, the very basic
* configuration file of owncloud.
* configuration file of ownCloud.
*/
OC_Config::$object = new \OC\Config(OC::$SERVERROOT.'/config/', defined('DEBUG') && DEBUG);
class OC_Config {
public static $object;
/**
* @brief Lists all available config keys
* @return array with key names
@ -70,8 +72,8 @@ class OC_Config{
* @param string $key key
* @param string $value value
*
* This function sets the value and writes the config.php. If the file can
* not be written, false will be returned.
* This function sets the value and writes the config.php.
*
*/
public static function setValue($key, $value) {
try {
@ -85,8 +87,8 @@ class OC_Config{
* @brief Removes a key from the config
* @param string $key key
*
* This function removes a key from the config.php. If owncloud has no
* write access to config.php, the function will return false.
* This function removes a key from the config.php.
*
*/
public static function deleteKey($key) {
try {

Loading…
Cancel
Save