Get the session handlers

@return  array  An array of available session handlers

@since   1.0
@deprecated  2.0  The Storage class chain will be removed
330252
public static function getStores()
	{
		$connectors = array();

		// Get an iterator and loop trough the driver classes.
		$iterator = new \DirectoryIterator(__DIR__ . '/Storage');

		foreach ($iterator as $file)
		{
			$fileName = $file->getFilename();

			// Only load for php files.
			if (!$file->isFile() || $file->getExtension() != 'php')
			{
				continue;
			}

			// Derive the class name from the type.
			$class = str_ireplace('.php', '', '\\Joomla\\Session\\Storage\\' . ucfirst(trim($fileName)));

			// If the class doesn't exist we have nothing left to do but look at the next type. We did our best.
			if (!class_exists($class))
			{
				continue;
			}

			// Sweet!  Our class exists, so now we just need to know if it passes its test method.
			if ($class::isSupported())
			{
				// Connector names should not have file extensions.
				$connectors[] = str_ireplace('.php', '', $fileName);
			}
		}

		return $connectors;
	}
1062725
protected function getSessionData()
    {
        $data = isset($_SESSION[$this->config['key']]) ? $_SESSION[$this->config['key']] : [];

        return array_merge($data, $this->flash);
    }
794487
protected function getDefaultHandlers()
    {
        return array(
            '+' => new Handler\StatusResponse(),
            '-' => new Handler\ErrorResponse(),
            ':' => new Handler\IntegerResponse(),
            '$' => new Handler\BulkResponse(),
            '*' => new Handler\MultiBulkResponse(),
        );
    }
178919
public function get_all_handlers() {
        $sitepolicyhandlers = [];
        foreach (\core_component::get_plugin_types() as $ptype => $unused) {
            $plugins = \core_component::get_plugin_list_with_class($ptype, 'privacy\local\sitepolicy\handler') +
                \core_component::get_plugin_list_with_class($ptype, 'privacy_local_sitepolicy_handler');
            // Allow plugins to have the class either with namespace or without (useful for unittest).
            foreach ($plugins as $pname => $class) {
                $sitepolicyhandlers[$pname] = $class;
            }
        }
        return $sitepolicyhandlers;
    }
777323
protected function getSession()
    {
        if (null === $this->session) {
            if (null !== $this->getRequest()) {
                $this->session = $this->request->getSession();
            }
        }

        return $this->session;
    }
153394
public function getData(): array
    {
        return [
            $this->serverOriginScheme,
            $this->serverOriginHost,
            $this->serverOriginPort,
            $this->isPreFlightCanBeCached,
            $this->preFlightCacheMaxAge,
            $this->isForceAddMethods,
            $this->isForceAddHeaders,
            $this->isUseCredentials,
            $this->areAllOriginsAllowed,
            $this->allowedOrigins,
            $this->areAllMethodsAllowed,
            $this->allowedLcMethods,
            $this->allowedMethodsList,
            $this->areAllHeadersAllowed,
            $this->allowedLcHeaders,
            $this->allowedHeadersList,
            $this->exposedHeadersList,
            $this->isCheckHost,
        ];
    }
430486
public function getHandlers()
    {
        $handlers = array(
            'key' => array(
                'name' => $this->translation->text('API key'),
                'handlers' => array(
                    'delete' => array(__CLASS__, 'delete'),
                    'edit' => array('gplcart\\modules\\gapi\\controllers\\Credential', 'editKeyCredential')
                )
            ),
            'oauth' => array(
                'name' => $this->translation->text('OAuth client ID'),
                'handlers' => array(
                    'delete' => array(__CLASS__, 'delete'),
                    'edit' => array('gplcart\\modules\\gapi\\controllers\\Credential', 'editOauthCredential')
                )
            ),
            'service' => array(
                'name' => $this->translation->text('Service account key'),
                'handlers' => array(
                    'delete' => array(__CLASS__, 'deleteService'),
                    'edit' => array('gplcart\\modules\\gapi\\controllers\\Credential', 'editServiceCredential')
                )
            )
        );

        $this->hook->attach('module.gapi.credential.handlers', $handlers);
        return $handlers;
    }
41213
public function info()
    {
        $handler = $this->get('handler');
        if (class_exists($handler)) {
            $handler = new $handler();

            return $handler->info();
        }

        return [];
    }
1266374
public function getConnectionHandlersAsArray()
    {

        // initialize the array for the connection handlers
        $connectionHandlers = array();

        // iterate over the connection handler nodes and sort them into an array
        /** @var \AppserverIo\Appserver\Core\Api\Node\ConnectionHandlerNode $connectionHandler */
        foreach ($this->getConnectionHandlers() as $connectionHandler) {
            $connectionHandlers[$connectionHandler->getUuid()] = $connectionHandler->getType();
        }

        // return the array
        return $connectionHandlers;
    }
1332455
public function getHandler()
    {
        $handlers = $this->handlers;
        if (isset($this->instructions['handler'])
            && isset($handlers[$this->instructions['handler']])) {
            return Yii::createObject([
                'class' => $handlers[$this->instructions['handler']],
                'bundle' => $this,
            ]);
        }

        return false;
    }
1094015
public function getSession()
    {
        if (null === $this->session) {
            // Using fully qualified name, to ensure polyfill class alias is used
            $this->session = new SessionContainer($this->getId());
        }

        return $this->session;
    }
587356
protected function _handlers()
    {
        $gmstrtotime = function ($value) {
            $TZ = date_default_timezone_get();
            if ($TZ === 'UTC') {
                return strtotime($value);
            }
            date_default_timezone_set('UTC');
            $time = strtotime($value);
            date_default_timezone_set($TZ);
            return $time;
        };

        return [
            'array' => [
                'object' => function($value, $column) {
                    return $value->to('array', $column);
                },
                'string' => function($value, $column) {
                    return (string) $value;
                },
                'integer' => function($value, $column) {
                    return (int) $value;
                },
                'float' => function($value, $column) {
                    return (float) $value;
                },
                'date' => function($value, $column) {
                    return $this->convert('array', 'datetime', $value, ['format' => 'Y-m-d']);
                },
                'datetime' => function($value, $column) use ($gmstrtotime) {
                    $column += ['format' => 'Y-m-d H:i:s'];
                    $format = $column['format'];
                    if ($value instanceof DateTime) {
                        return $value->format($format);
                    }
                    return gmdate($format, is_numeric($value) ? $value : $gmstrtotime($value));
                },
                'boolean' => function($value, $column) {
                    return $value;
                },
                'null' => function($value, $column) {
                    return;
                },
                'json' => function($value, $column) {
                    return is_array($value) ? $value : $value->to('array', $column);
                }
            ],
            'cast' => [
                'object' => function($value, $column, $options) {
                    return is_array($value) ? new Document([
                        'schema' => $options['schema'] ?? null,
                        'basePath' => $options['basePath'] ?? null,
                        'data' => $value
                    ]) : $value;
                },
                'string' => function($value, $column, $options) {
                    return (string) $value;
                },
                'integer' => function($value, $column, $options) {
                    return (integer) $value;
                },
                'float'   => function($value, $column, $options) {
                    return (float) $value;
                },
                'decimal' => function($value, $column, $options) {
                    $column += ['precision' => 2, 'decimal' => '.', 'separator' => ''];
                    return number_format($value, $column['precision'], $column['decimal'], $column['separator']);
                },
                'boolean' => function($value, $column, $options) {
                    return !!$value;
                },
                'date'    => function($value, $column, $options) {
                    return $this->convert('cast', 'datetime', $value, ['format' => 'Y-m-d'], $options);
                },
                'datetime'    => function($value, $column, $options) use ($gmstrtotime) {
                    $column += ['format' => 'Y-m-d H:i:s'];
                    if ($value instanceof DateTime) {
                        return $value;
                    }
                    $timestamp = is_numeric($value) ? $value : $gmstrtotime($value);
                    if ($timestamp < 0 || $timestamp === false) {
                        return;
                    }
                    return DateTime::createFromFormat("!{$column['format']}", gmdate($column['format'], $timestamp), new DateTimeZone('UTC'));
                },
                'null'    => function($value, $column, $options) {
                    return null;
                },
                'json' => function($value, $column, $options) {
                    return is_string($value) ? json_decode($value, true) : $value;
                }
            ]
        ];
    }
960970
public static function getSession()
    {
        if (is_null(self::$session)) {
            if (PHPSession::singleton()->hasAttribute(self::PHPSESSION_SESSION_KEY)) {
                $session = PHPSession::singleton()->getAttribute(self::PHPSESSION_SESSION_KEY);
                if (! $session instanceof common_session_Session) {
                    throw new common_exception_Error('Non session stored in php-session');
                }
                self::$session = $session;
            } else {
                self::$session = new common_session_AnonymousSession();
            }
        }
        if (self::$session instanceof ServiceLocatorAwareInterface) {
            self::$session->setServiceLocator(ServiceManager::getServiceManager());
        }
        return self::$session;
    }
988409
public function getDependencyConfig(): array
    {
        return [
            'aliases' => [
                SessionManager::class => ManagerInterface::class,
            ],
            'factories' => [
                ConfigInterface::class => SessionConfigFactory::class,
                ManagerInterface::class => SessionManagerFactory::class,
                StorageInterface::class => StorageFactory::class,

                SessionOptions::class => SessionOptionsFactory::class,
                SessionMiddleware::class => SessionMiddlewareFactory::class,
            ],
            'abstract_factories' => [
                ContainerAbstractServiceFactory::class,
            ]
        ];
    }
1099442
public function getHandler()
    {
        if(!$this->_handler instanceof UserSessionHandlerInterface)
        {
            $this->_handler = $this->getObject($this->_handler);

            if(!$this->_handler instanceof UserSessionHandlerInterface)
            {
                throw new \UnexpectedValueException(
                    'Handler: '.get_class($this->_handler).' does not implement UserSessionHandlerInterface'
                );
            }
        }

        return $this->_handler;
    }
1188751
private function getShrinkedSession()
    {
        $serialized = '';
        if (isset($_SESSION)) {
            $serialized = serialize($_SESSION);
        }
        if (strlen($serialized) > 64000) {
            $sessionCopy = $_SESSION;
            $ignoredKeys = array();
            foreach ($_SESSION as $key => $value) {
                $size = strlen(serialize($value));
                if ($size > 1000) {
                    unset($sessionCopy[$key]);
                    $ignoredKeys[$key] = $key;
                }
            }
            $sessionCopy['__ignored_keys_in_audit'] = $ignoredKeys;
            $serialized = serialize($sessionCopy);
        }
        return unserialize($serialized);
    }
628054
public function getHandle()
    {
        $delegate = $this->getDelegate();

        if($delegate instanceof ObjectHandlable) {
            $handle = $delegate->getHandle();
        } else {
            $handle = spl_object_hash($this);
        }

        return $handle;
    }