Sets a prefix for all keys (if needed) using options in the given configuration array.

@return bool True if setting the prefix succeeded or no prefix was specified, else false
168126
protected function _setPrefix() {
		if ($this->config['prefix']) {
			return $this->_connection->setOption(Redis::OPT_PREFIX, $this->config['prefix']);
		}

		return true;
	}
584578
public function clearPaths($prefix = null)
    {
        if ((null !== $prefix) && is_string($prefix)) {
            $prefix = $this->_formatPrefix($prefix);
            if ($this->_useStaticRegistry) {
                if (isset(self::$_staticPrefixToPaths[$this->_useStaticRegistry][$prefix])) {
                    unset(self::$_staticPrefixToPaths[$this->_useStaticRegistry][$prefix]);
                    return true;
                }

                return false;
            }

            if (isset($this->_prefixToPaths[$prefix])) {
                unset($this->_prefixToPaths[$prefix]);
                return true;
            }

            return false;
        }

        if ($this->_useStaticRegistry) {
            self::$_staticPrefixToPaths[$this->_useStaticRegistry] = array();
        } else {
            $this->_prefixToPaths = array();
        }

        return true;
    }
1348994
public function remove($key)
    {
        foreach ($this->options as $idx => $option) {
            if (is_array($option)) {
                if (! strcasecmp($key, $option['name'])) {
                    unset($this->options[$idx]);

                    return true;
                }
            } elseif (! strcasecmp($key, $option)) {
                unset($this->options[$idx]);

                return true;
            }
        }

        return false;
    }
393427
public function checkTablePrefix() {
        if (!$this->tablePrefix) {
            $this->setTablePrefix($this->in('What table prefix would you like to use?'));
        }

        $this->out(sprintf('Table Prefix: <info>%s</info>', $this->tablePrefix));

        $answer = strtoupper($this->in('Is this correct?', array('Y', 'N')));

        if ($answer === 'N') {
            $this->tablePrefix = null;
            $this->checkTablePrefix();
        }

        $this->out('<success>Table prefix set, proceeding...</success>');
        return true;
    }
1067876
protected function writeOption(string $key, $value): bool
    {
        return $value === get_option($this->prefix . $key)
               || update_option($this->prefix . $key, $value);
    }
186811
public static function setConfig($options = []) {
		$config = $options + (array)Configure::read('Localization');
		foreach ($config as $key => $value) {
			$key = '_' . $key;
			if (!isset(static::${$key})) {
				continue;
			}
			static::${$key} = $value;
		}
	}
625417
public function setTablePrefix($prefix) {
        if ($prefix) {
            $prefix = trim($prefix, '_') . '_';
        }

        $this->tablePrefix = $prefix;

        return $this;
    }
438617
function set(prefix, value) {
    for (const key of keys(value)) {
      const name = prefix ? `${prefix}[${key}]` : key
      const field = value[key]

      if (isArray(field) || isPlainObject(field)) {
        set(name, field)
      } else {
        if (options.strict && (isBoolean(field) && field === false)) {
          continue
        }

        fd[method](name, field)
      }
    }
  }
589267
protected function keyToNormalizeMethod($key, $prefix)
    {
        $arrayKey = "$prefix:$key";

        if (!isset($this->_methodCache[$arrayKey])) {

            $method = $prefix . ucfirst(Type::camelCase(str_replace([' ', '.'],'_', $key)));

            $this->_methodCache[$arrayKey] = method_exists($this, $method) ? $method : false;

        }

        return $this->_methodCache[$arrayKey];

    }
875210
public function setPrefix($prefix = null) {

		if(null !== $prefix) {

			if(false === is_string($prefix)) {
				return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($prefix)), E_USER_ERROR);
			}

			$this -> prefix = $prefix;
		}

		return $this;
	}
1267909
public function isPrefix()
    {
        $params = $this->Controller->request->params;
        if (key_exists('prefix', $params)) {
            $prefix = $params['prefix'];
            if ($prefix) {
                return true;
            }
        }
        return false;
    }
707265
public function set($key, $value)
    {
        $config = &$this->config;

        foreach (explode('.', $key) as $k) {
            $config = &$config[$k];
        }

        $config = $value;

        return true;
    }
1022224
private function _setDbPrefix()
    {
        if (! Agl::isInitialized()) {
            return $this;
        }

        $dbPrefix = Agl::app()->getConfig('main/db/prefix');
        if ($dbPrefix) {
            $this->_dbPrefix = $dbPrefix;
        }

        return $this;
    }
523774
public function generate_single_key_prefix() {
        if ($this->keyprefixsingle === null) {
            $this->keyprefixsingle = $this->mode.'/'.$this->component.'/'.$this->area;
            $this->keyprefixsingle .= '/'.$this->get_cache_identifier();
            $identifiers = $this->get_identifiers();
            if ($identifiers) {
                foreach ($identifiers as $key => $value) {
                    $this->keyprefixsingle .= '/'.$key.'='.$value;
                }
            }
            $this->keyprefixsingle = md5($this->keyprefixsingle);
        }
        return $this->keyprefixsingle;
    }
399654
public static function prefix($prefix = '') {
        $that = self::driver();
        $that->prefix($prefix);
        if (empty($prefix)) {
            return $that->config['prefix'];
        }
        $that->config['prefix'] = $prefix;
    }
840179
protected function _prefixOrderProperty() {
		if (is_string($this->order)) {
			$this->order = $this->_prefixAlias($this->order);
		}
		if (is_array($this->order)) {
			foreach ($this->order as $key => $value) {
				if (is_numeric($key)) {
					$this->order[$key] = $this->_prefixAlias($value);
				} else {
					$newKey = $this->_prefixAlias($key);
					$this->order[$newKey] = $value;
					if ($newKey !== $key) {
						unset($this->order[$key]);
					}
				}
			}
		}
	}
677220
public function setOptionsArray($options) {
    foreach($options as $key => $value) {
      if (!$this->setOption($key, $value)) {
        return false;
      }
    }
    return true;
  }