Allows to keep the current Application and browser state.

@param	string	Description of the snapshot moment.
185397
public static function keepSnapshot($description) {
		
		$app = Application::getInstance();
		$router = Router::getInstance();
		
		$snap = new self();
		
		$snap->createdTime	= new \DateTime();
		$snap->userId		= $app->currentUser->id;
		$snap->module		= $router->module;
		$snap->action		= $router->action;
		$snap->getData		= serialize($_GET);
		$snap->postData		= serialize($_POST);
		$snap->cookieData	= serialize($_COOKIE);
		$snap->description	= $description;
		$snap->userMessages	= serialize($app->messages);
		
		if (isset($_SERVER['HTTP_REFERER'])) {

			// removes application base url from referer
			if (0 === strpos($_SERVER['HTTP_REFERER'], BASE_HREF)) {
				$snap->referer = substr($_SERVER['HTTP_REFERER'], strlen(BASE_HREF));
			} else {
				$snap->referer = $_SERVER['HTTP_REFERER'];
			}
			
		}

		return $snap->create();
		
	}
1111447
public function restore(Snapshot $snapshot) : void
    {
        foreach ($snapshot as [$layer, $params]) {
            if ($layer instanceof Parametric) {
                $layer->restore($params);
            }
        }
    }
1105738
public function refresh(String $url = NULL, Int $time = 0, Array $data = NULL, Bool $exit = false)
    {
        $this->location($url, $time, $data, $exit, __FUNCTION__);
    }
1279206
public void setDescription( String applicationName, String newDesc )
	throws ApplicationWsException {

		this.logger.finer( "Updating the description of application " + applicationName + "." );

		WebResource path = this.resource.path( UrlConstants.APP ).path( applicationName ).path( "description" );
		ClientResponse response = this.wsClient.createBuilder( path )
					.accept( MediaType.TEXT_PLAIN )
					.post( ClientResponse.class, newDesc );

		handleResponse( response );
		this.logger.finer( String.valueOf( response.getStatusInfo()));
	}
662015
function () {
            if (typeof window !== "undefined") {

                if (this.$.useState) {
                    if (window.removeEventListener) {
                        window.removeEventListener('popstate', this.$checkUrlFn, false);
                    } else {
                        window.detachEvent('onpopstate', this.$checkUrlFn);
                    }
                } else {
                    if ("onhashchange" in window) {
                        if (window.removeEventListener) {
                            window.removeEventListener('hashchange', this.$checkUrlFn, false);
                        } else {
                            window.detachEvent('onhashchange', this.$checkUrlFn);
                        }
                    } else {
                        // polling
                        clearInterval(this.$checkUrlInterval);
                    }
                }
            }
        }
139246
public function saveState()
	{
        if($this->sessionEnabled()) {
            // Session handling.
            if(!is_array($this->sessionvars)) {
                $this->sessionvars = array();
            }
            foreach($this->sessionvars as $varname => $val) {
                if($val === null) {
                    unset($_SESSION[$varname]);
                }
                else {
                    $_SESSION[$varname] = $val;
                }
            }
        }

        if(!headers_sent()) {
            foreach($this->cookievars as $cookiename => $cookiedef) {
                if($cookiedef['value'] === null) {
                    setcookie($cookiename, null, time() - 3600, '/'); // Expiring the cookie
                }
                else {
                    setcookie(
                        $cookiename,
                        $cookiedef['value'],
                        time() + $cookiedef['max_age'],
                        '/'
                    );
                }
            }
        }
	}
679199
public function takeSnapshot()
    {
        if (is_array($this->originalNodeNames)) {
            if ($this->isInitialized()) {
                $this->originalNodeNames = $this->collection->getKeys();
            } else {
                $this->originalNodeNames = null;
            }
        }

        parent::takeSnapshot();
    }
555476
public function refreshLastUsed($sessionId, $lastUsed = null)
    {
        if ($sessionInformation = $this->getSessionInformation($sessionId)) {
            if ($sessionInformation->getLastUsed() !== $lastUsed) {
                $sessionInformation->refreshLastUsed($lastUsed);
                $this->saveSessionInformation($sessionInformation);
            }
        }
    }
744496
public void snapshotState(StateSnapshotContext context) throws Exception {
		final KeyedStateBackend<?> keyedStateBackend = getKeyedStateBackend();
		//TODO all of this can be removed once heap-based timers are integrated with RocksDB incremental snapshots
		if (keyedStateBackend instanceof AbstractKeyedStateBackend &&
			((AbstractKeyedStateBackend<?>) keyedStateBackend).requiresLegacySynchronousTimerSnapshots()) {

			KeyedStateCheckpointOutputStream out;

			try {
				out = context.getRawKeyedOperatorStateOutput();
			} catch (Exception exception) {
				throw new Exception("Could not open raw keyed operator state stream for " +
					getOperatorName() + '.', exception);
			}

			try {
				KeyGroupsList allKeyGroups = out.getKeyGroupList();
				for (int keyGroupIdx : allKeyGroups) {
					out.startNewKeyGroup(keyGroupIdx);

					timeServiceManager.snapshotStateForKeyGroup(
						new DataOutputViewStreamWrapper(out), keyGroupIdx);
				}
			} catch (Exception exception) {
				throw new Exception("Could not write timer service of " + getOperatorName() +
					" to checkpoint state stream.", exception);
			} finally {
				try {
					out.close();
				} catch (Exception closeException) {
					LOG.warn("Could not close raw keyed operator state stream for {}. This " +
						"might have prevented deleting some state data.", getOperatorName(), closeException);
				}
			}
		}
	}
940328
public function touchPending($url)
    {
        while (isset($this->pending[$url]) && !$this->pending[$url]->isEmpty()) {
            if (true === $this->getConnection($url, $this->pending[$url]->dequeue())) {
                return;
            }
        }
    }
1247185
function setHeadsetState(newState){

    if (newState){

        appPlaying = true;
        appActive = true;

    }else{

        if (removeHeadsetPausesPlay)
            appPlaying = false;

    }


}
19274
public function setSnapshots($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->snapshots = $arr;

        return $this;
    }
328623
public function hookDisplayAdminNavBarBeforeEnd()
    {
        if (!$this->onBoarding->isFinished()) {
            $this->onBoarding->showModuleContentForNavBar($this->context->link);
        }
    }
900766
function(path) {
    var state = window.history.state,
        initialURL = get(this, '_initialURL');

    path = this.formatPath(path);

    if ((initialURL !== path && !state) || (state && state.path !== path)) {
      window.history.pushState({ path: path }, null, path);
    }
  }
156486
def set_last_access(self, tag):
        """"""
        import time
        # time defeats check that value didn't change

        self.buildstate.access.last = '{}-{}'.format(tag, time.time())
        self.buildstate.commit()
339904
public function notify($current, $max, $percent, $timeTaken, $timeRemaining, $text)
    {
        //lastWrittenPercent and lastWrittenTime are used to prevent performance issues if
        //many progresses are written. (the filesystem access at nfs can slow that down)
        //we just update the progressbar if the percentage increases and
        //the last request was at least 500ms ago
        if (!$this->_lastWrittenPercent) {
            $this->_lastWrittenPercent = (int)($percent*100);
        }
        if (!$this->_lastWrittenTime) {
            $this->_lastWrittenTime = microtime(true);
        }
        if ($this->_lastWrittenPercent < (int)($percent*100)
            && $this->_lastWrittenTime+0.5 <= microtime(true)) {
            $arguments = array(
                'current'       => $current,
                'max'           => $max,
                'percent'       => ($percent * 100),
                'timeTaken'     => $timeTaken,
                'timeRemaining' => $timeRemaining,
                'text'          => $text,
                'finished'      => false
            );
            $this->_saveStatus($arguments);
            $this->_lastWrittenPercent = (int)($percent*100);
            $this->_lastWrittenTime = microtime(true);
        }
    }
102958
public function doBefore() {
        $this->_isMobile = $this->_md->isMobile();
        $this->_isTablet = $this->_md->isTablet();

        if(!isset($_SESSION[$this->_sessionAutoName]) && $this->_isTablet){
            $_SESSION[$this->_sessionAutoName] = $this->_allowMobileForTablet;
        }
        elseif(!isset($_SESSION[$this->_sessionAutoName]) || $_SESSION[$this->_sessionAutoName] == '') {
            $_SESSION[$this->_sessionAutoName] = $this->_defaultBehaviour;
        }

        $_SESSION[$this->_sessionName] = $this->_isMobile;
    }