HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux wordpress-ubuntu-s-2vcpu-4gb-fra1-01 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64
User: root (0)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/dinamo-shop/wp-content/plugins/woocommerce-multilingual/classes/User/Store/Store.php
<?php

namespace WCML\User\Store;


class Store implements Strategy {

	/**
	 * @param string $key
	 *
	 * @return mixed
	 */
	public function get( $key ) {

		$key = $this->adjustKey( $key );

		return $this->getStrategy( $key )->get( $key );
	}

	/**
	 * @param string   $key
	 * @param mixed    $value
	 */
	public function set( $key, $value ) {

		$key = $this->adjustKey( $key );

		$this->getStrategy( $key )->set( $key, $value );
	}

	/**
	 * @param string $key
	 *
	 * @return Strategy
	 */
	private function getStrategy( $key ) {
		global $woocommerce;

		/**
		 * This filter hook allows to override the storage strategy.
		 *
		 * @since 4.11.0
		 *
		 * @param string 'wc-session' Storage strategy
		 * @param string $key      The key operating the storage
		 */
		switch ( apply_filters( 'wcml_user_store_strategy', 'wc-session', $key ) ) {
			case 'cookie':
				$store = \WPML\Container\make( Cookie::class );
				break;

			case 'wc-session':
			default:
				$store = isset( $woocommerce->session ) ? new WcSession( $woocommerce->session ) : new Noop();
		}

		return $store;
	}

	/**
	 * @param string $key
	 *
	 * @return string $key
	 */
	private function adjustKey( $key ) {

		$prefix = 'wcml_';

		return strpos( $key, $prefix ) === 0 ? $key : $prefix . $key;
	}

}