Set up namespaces data - only if data has not been expired yet,
if data has been expired, unset data from
`\MvcCore\ISession::$meta` and `$_SESSION` storage.
Called only once at session start by `\MvcCore\ISession::Start();`.
@return void
488545
protected static function setUpData () {
		$hoops = & static::$meta->hoops;
		$names = & static::$meta->names;
		$expirations = & static::$meta->expirations;
		foreach ($hoops as $name => $hoop) {
			$hoops[$name] -= 1;
		}
		foreach ($names as $name => $one) {
			$unset = [];
			if (isset($hoops[$name])) {
				if ($hoops[$name] < 0) $unset[] = 'hoops';
			}
			if (isset($expirations[$name])) {
				$expiration = $expirations[$name];
				if ($expiration < static::$sessionStartTime) {
					$unset[] = 'expirations';
				} else if ($expiration > static::$sessionMaxTime) {
					static::$sessionMaxTime = $expiration;
				}
			}
			if ($unset) {
				$currentErrRepLevels = error_reporting();
				error_reporting(0);
				foreach ($unset as $unsetKey) {
					if (isset(static::$meta->{$unsetKey}) && isset(static::$meta->{$unsetKey}[$name])) {
						unset(static::$meta->{$unsetKey}[$name]);
					}
				}
				error_reporting($currentErrRepLevels);
				unset($names[$name]);
				unset($_SESSION[$name]);
			}
		}
	}
757842
public function set($key, $value): void
    {
        $this->start();
        // check storage
        if (!isset($_SESSION[$this->getNamespace()])) {
            $_SESSION[$this->getNamespace()] = [];
        }
        $_SESSION[$this->namespace][$key] = $value;
    }
49743
private function sessionExpiry()
    {
        $dateTime = new DateTime();
        if (null !== $this->sessionOptions['SessionExpiry']) {
            $expiryDateTime = new DateTime($_SESSION['Expiry']);
            $expiryDateTime->add(new DateInterval($this->sessionOptions['SessionExpiry']));
            if ($expiryDateTime < $dateTime) {
                $this->destroy();
            }
        }
    }
197682
protected function registerNamespaces()
    {
        $configPath = __DIR__ . '/../config/config.php';

        $this->mergeConfigFrom($configPath, 'modules');
        $this->publishes([
            $configPath => config_path('modules.php'),
        ], 'config');
    }
1057936
protected function setAddonConfigNamespaces()
    {
        if (file_exists($this->addon->path('addon.php'))) {
            $search = [
                "namespace {$this->currentNamespace}",
                "'namespace' => '{$this->currentNamespace}'",
                "'{$this->currentNamespace}\\",
                "\"{$this->currentNamespace}\\",
                "\\{$this->currentNamespace}\\",
            ];

            $replace = [
                "namespace {$this->newNamespace}",
                "'namespace' => '{$this->newNamespace}'",
                "'{$this->newNamespace}\\",
                "\"{$this->newNamespace}\\",
                "\\{$this->newNamespace}\\",
            ];

            $this->replaceIn($this->addon->path('addon.php'), $search, $replace);
        }
    }
1193567
public function Destroy () {
		$name = $this->__name;
		$names = & static::$meta->names;
		$hoops = & static::$meta->hoops;
		$expirations = & static::$meta->expirations;
		$instances = & static::$instances;
		if (isset($names[$name])) unset($names[$name]);
		if (isset($hoops[$name])) unset($hoops[$name]);
		if (isset($expirations[$name])) unset($expirations[$name]);
		if (isset($_SESSION[$name])) unset($_SESSION[$name]);
		if (isset($instances[$name])) unset($instances[$name]);
	}
831821
protected function initNamespace()
    {
        $namespaces = $this->config->get('namespaces', null);

        if ($namespaces !== null) {
            foreach ($namespaces as $namespace => $path) {
                $this->loader->registerNamespaces([$namespace => $path], true);
            }
            $this->loader->register();
            $this->di->set('loader', $this->loader);
        }
    }
1041767
protected function setPhpSpecNamespace()
	{
		if ($this->files->exists($path = $this->getPhpSpecConfigPath()))
		{
			$this->replaceIn($path, $this->currentRoot, $this->argument('name'));
		}
	}
734932
protected function setDatabaseFactoryNamespaces()
    {
        $files = Finder::create()
                            ->in(database_path('factories'))
                            ->contains($this->currentRoot)
                            ->name('*.php');

        foreach ($files as $file) {
            $this->replaceIn(
                $file->getRealPath(),
                $this->currentRoot, $this->argument('name')
            );
        }
    }
411960
public function clear($namespace='default')
    {
        $cleared = false;

        if (isset($this->addedData[$namespace])) {
            $this->addedData[$namespace] = [];
            $cleared = true;
        }

        if (isset($this->cachedData[$namespace])) {
            $this->cachedData[$namespace] = [];
            $cleared = true;
        }

        if ($cleared) {
            $this->queryHits = [];
        }
    }
391725
protected function initializeSession($session_expiration = null)
	{
		// Setup the session
		$this->session = new Session();

		$this->config->load('config');

		// We need a unique session name for this app. Let's use last 10 characters the file path's sha1 hash.
		try {
			$this->session->setName('TSAPP' . substr(sha1(__FILE__), -10));
			$this->session->start();

			// Default session expiration 1 hour.
			// Can be overridden in method param or by setting session_expiration in config.php
			$session_expiration = !empty($session_expiration)
										? $session_expiration
										: $this->config->get('session_expiration', 3600);

			// Is this session too old?
			if (time() - $this->session->getMetadataBag()->getLastUsed() > $session_expiration) {
				$this->session->invalidate();
			}
		} catch (\LogicException $e) {
			// Session already active, can't change it now!
		}
	}
503802
protected function startSession()
    {
        if (session_status() == PHP_SESSION_NONE) {

            session_start();

            if(!$this->expireOnClose) {
                setcookie('planet_session', session_id(), time() + ($this->expireTime * 60 ), '/', null, false, false);
            }
        }
    }
129981
function clearSessionData($name = '', $clearErrors = true){
		if(!$name) $name = $this->owner->FormName();
		\Session::clear("FormInfo.{$name}.data");
		if($clearErrors) \Session::clear("FormInfo.{$name}.errors");
	}
717393
protected function init($namespace = '', $defaultLifetime = null)
    {
        $this->namespace = (string) $namespace;
        $this->defaultLifetime = $this->convertTtl($defaultLifetime);
        $this->miss = new \stdClass;
    }
152431
protected function setAppDirectoryNamespace()
	{
		$files = Finder::create()
                            ->in($this->laravel['path'])
                            ->name('*.php');

		foreach ($files as $file)
		{
			$this->replaceNamespace($file->getRealPath());
		}
	}
50246
public function registerNamespaces()
    {
        foreach ($this->all() as $theme) {
            foreach (array('views', 'lang') as $hint) {
                $this->{$hint}->addNamespace($theme->getLowerName(), $theme->getPath($hint));
            }

            $theme->boot();
        }
    }
1313135
public function reset()
    {
        $this->description   = null;
        $this->title_session = null;
        $this->metatags      = [];
        $this->keywords      = [];
    }