From 62c79e1c4f1d48310b9df102777812a3e2310bae Mon Sep 17 00:00:00 2001 From: Philipp Holzer Date: Tue, 5 Feb 2019 23:42:49 +0100 Subject: [PATCH] codeblock updates --- src/Core/Config/IConfigAdapter.php | 21 +++------------------ src/Core/Config/IPConfigAdapter.php | 16 +++------------- src/Core/Config/JITConfigAdapter.php | 12 ++++++++++++ src/Core/Config/JITPConfigAdapter.php | 12 ++++++++++++ src/Core/Config/PreloadConfigAdapter.php | 12 ++++++++++++ src/Core/Config/PreloadPConfigAdapter.php | 12 ++++++++++++ 6 files changed, 54 insertions(+), 31 deletions(-) diff --git a/src/Core/Config/IConfigAdapter.php b/src/Core/Config/IConfigAdapter.php index 5bbb61ae80..139483de26 100644 --- a/src/Core/Config/IConfigAdapter.php +++ b/src/Core/Config/IConfigAdapter.php @@ -9,10 +9,7 @@ namespace Friendica\Core\Config; interface IConfigAdapter { /** - * @brief Loads all configuration values into a cached storage. - * - * All configuration values of the system are stored in global cache - * which is available under the global variable Config::$config + * Loads all configuration values into a cached storage. * * @param string $cat The category of the configuration values to load * @@ -21,17 +18,9 @@ interface IConfigAdapter public function load($cat = "config"); /** - * @brief Get a particular user's config variable given the category name + * Get a particular user's config variable given the category name * ($family) and a key. * - * Get a particular config value from the given category ($family) - * and the $key from a cached storage in static::$config[$uid]. - * $instore is only used by the set_config function - * to determine if the key already exists in the DB - * If a key is found in the DB but doesn't exist in - * local config cache, pull it into the cache so we don't have - * to hit the DB again for this item. - * * @param string $cat The category of the configuration value * @param string $k The configuration key to query * @param mixed $default_value optional, The value to return if key is not set (default: null) @@ -42,8 +31,6 @@ interface IConfigAdapter public function get($cat, $k, $default_value = null, $refresh = false); /** - * @brief Sets a configuration value for system config - * * Stores a config value ($value) in the category ($family) under the key ($key) * for the user_id $uid. * @@ -58,9 +45,7 @@ interface IConfigAdapter public function set($cat, $k, $value); /** - * @brief Deletes the given key from the system configuration. - * - * Removes the configured value from the stored cache in Config::$config + * Removes the configured value from the stored cache * and removes it from the database. * * @param string $cat The category of the configuration value diff --git a/src/Core/Config/IPConfigAdapter.php b/src/Core/Config/IPConfigAdapter.php index f4ad392d7f..e62fc9c93f 100644 --- a/src/Core/Config/IPConfigAdapter.php +++ b/src/Core/Config/IPConfigAdapter.php @@ -15,10 +15,7 @@ namespace Friendica\Core\Config; interface IPConfigAdapter { /** - * @brief Loads all configuration values of a user's config family into a cached storage. - * - * All configuration values of the given user are stored in global cache - * which is available under the global variable self::$config[$uid]. + * Loads all configuration values of a user's config family into a cached storage. * * @param string $uid The user_id * @param string $cat The category of the configuration value @@ -28,12 +25,9 @@ interface IPConfigAdapter public function load($uid, $cat); /** - * @brief Get a particular user's config variable given the category name + * Get a particular user's config variable given the category name * ($family) and a key. * - * Get a particular user's config value from the given category ($family) - * and the $key from a cached storage in self::$config[$uid]. - * * @param string $uid The user_id * @param string $cat The category of the configuration value * @param string $k The configuration key to query @@ -45,8 +39,6 @@ interface IPConfigAdapter public function get($uid, $cat, $k, $default_value = null, $refresh = false); /** - * @brief Sets a configuration value for a user - * * Stores a config value ($value) in the category ($family) under the key ($key) * for the user_id $uid. * @@ -62,9 +54,7 @@ interface IPConfigAdapter public function set($uid, $cat, $k, $value); /** - * @brief Deletes the given key from the users's configuration. - * - * Removes the configured value from the stored cache in self::$config[$uid] + * Removes the configured value from the stored cache * and removes it from the database. * * @param string $uid The user_id diff --git a/src/Core/Config/JITConfigAdapter.php b/src/Core/Config/JITConfigAdapter.php index 5e7e786f07..e7aecb933b 100644 --- a/src/Core/Config/JITConfigAdapter.php +++ b/src/Core/Config/JITConfigAdapter.php @@ -28,6 +28,9 @@ class JITConfigAdapter implements IConfigAdapter $this->configCache = $configCache; } + /** + * {@inheritdoc} + */ public function load($cat = "config") { // We don't preload "system" anymore. @@ -50,6 +53,9 @@ class JITConfigAdapter implements IConfigAdapter DBA::close($configs); } + /** + * {@inheritdoc} + */ public function get($cat, $k, $default_value = null, $refresh = false) { if (!$refresh) { @@ -92,6 +98,9 @@ class JITConfigAdapter implements IConfigAdapter return $default_value; } + /** + * {@inheritdoc} + */ public function set($cat, $k, $value) { // We store our setting values in a string variable. @@ -129,6 +138,9 @@ class JITConfigAdapter implements IConfigAdapter return $result; } + /** + * {@inheritdoc} + */ public function delete($cat, $k) { if (isset($this->cache[$cat][$k])) { diff --git a/src/Core/Config/JITPConfigAdapter.php b/src/Core/Config/JITPConfigAdapter.php index 2fd7705928..b1a15601cc 100644 --- a/src/Core/Config/JITPConfigAdapter.php +++ b/src/Core/Config/JITPConfigAdapter.php @@ -28,6 +28,9 @@ class JITPConfigAdapter implements IPConfigAdapter $this->configCache = $configCache; } + /** + * {@inheritdoc} + */ public function load($uid, $cat) { $pconfigs = DBA::select('pconfig', ['v', 'k'], ['cat' => $cat, 'uid' => $uid]); @@ -46,6 +49,9 @@ class JITPConfigAdapter implements IPConfigAdapter DBA::close($pconfigs); } + /** + * {@inheritdoc} + */ public function get($uid, $cat, $k, $default_value = null, $refresh = false) { if (!$refresh) { @@ -82,6 +88,9 @@ class JITPConfigAdapter implements IPConfigAdapter } } + /** + * {@inheritdoc} + */ public function set($uid, $cat, $k, $value) { // We store our setting values in a string variable. @@ -109,6 +118,9 @@ class JITPConfigAdapter implements IPConfigAdapter return $result; } + /** + * {@inheritdoc} + */ public function delete($uid, $cat, $k) { $this->configCache->deleteP($uid, $cat, $k); diff --git a/src/Core/Config/PreloadConfigAdapter.php b/src/Core/Config/PreloadConfigAdapter.php index bda9b28aae..d5fbd982bf 100644 --- a/src/Core/Config/PreloadConfigAdapter.php +++ b/src/Core/Config/PreloadConfigAdapter.php @@ -30,6 +30,9 @@ class PreloadConfigAdapter implements IConfigAdapter $this->load(); } + /** + * {@inheritdoc} + */ public function load($family = 'config') { if ($this->config_loaded) { @@ -45,6 +48,9 @@ class PreloadConfigAdapter implements IConfigAdapter $this->config_loaded = true; } + /** + * {@inheritdoc} + */ public function get($cat, $k, $default_value = null, $refresh = false) { if ($refresh) { @@ -59,6 +65,9 @@ class PreloadConfigAdapter implements IConfigAdapter return $return; } + /** + * {@inheritdoc} + */ public function set($cat, $k, $value) { // We store our setting values as strings. @@ -83,6 +92,9 @@ class PreloadConfigAdapter implements IConfigAdapter return true; } + /** + * {@inheritdoc} + */ public function delete($cat, $k) { $this->configCache->delete($cat, $k); diff --git a/src/Core/Config/PreloadPConfigAdapter.php b/src/Core/Config/PreloadPConfigAdapter.php index b49f39382f..af97815ade 100644 --- a/src/Core/Config/PreloadPConfigAdapter.php +++ b/src/Core/Config/PreloadPConfigAdapter.php @@ -34,6 +34,9 @@ class PreloadPConfigAdapter implements IPConfigAdapter } } + /** + * {@inheritdoc} + */ public function load($uid, $family) { if ($this->config_loaded) { @@ -53,6 +56,9 @@ class PreloadPConfigAdapter implements IPConfigAdapter $this->config_loaded = true; } + /** + * {@inheritdoc} + */ public function get($uid, $cat, $k, $default_value = null, $refresh = false) { if (!$this->config_loaded) { @@ -71,6 +77,9 @@ class PreloadPConfigAdapter implements IPConfigAdapter return $this->configCache->getP($uid, $cat, $k, $default_value);; } + /** + * {@inheritdoc} + */ public function set($uid, $cat, $k, $value) { if (!$this->config_loaded) { @@ -98,6 +107,9 @@ class PreloadPConfigAdapter implements IPConfigAdapter return true; } + /** + * {@inheritdoc} + */ public function delete($uid, $cat, $k) { if (!$this->config_loaded) {