Checks if all history parameters are set in order to read and write into history
@return bool
960796
public static function check(): bool
  {
	  return
      isset(self::$user, self::$table, self::$db) &&
      self::is_init() &&
      self::_get_db();
  }
1038637
protected function hasDatabaseHistory($code, $version, $script = null)
    {
        $historyInfo = $this->getDatabaseHistory($code);
        if (!$historyInfo) {
            return false;
        }

        foreach ($historyInfo as $history) {
            if ($history->version != $version) {
                continue;
            }

            if ($history->type == self::HISTORY_TYPE_COMMENT && !$script) {
                return true;
            }

            if ($history->type == self::HISTORY_TYPE_SCRIPT && $history->detail == $script) {
                return true;
            }
        }

        return false;
    }
848463
@Override
  public boolean isHistoryLevelAtLeast(HistoryLevel level) {
    if (log.isDebugEnabled()) {
      log.debug("Current history level: {}, level required: {}", historyLevel, level);
    }
    // Comparing enums actually compares the location of values declared in
    // the enum
    return historyLevel.isAtLeast(level);
  }
578835
public final function verifySetData(){

        foreach($this->data as $k => $v){
            $this->verifyData($k);
        }//foreach

        if(count($this->errors)){
            return false;
        }//if

        return true;

    }
1289711
public function read()
    {
        if ($this->_canReadline) {
            $line = readline('');
            if (strlen($line) > 0) {
                readline_add_history($line);
            }

            return $line;
        }

        return fgets($this->_input);
    }
942791
public function resume(): bool
    {
        if ($this->values->offsetExists('principal')) {
            $this->principal = $this->values->get('principal');

            $this->logger->info(
                "Authentication resume: {user}",
                ['user' => $this->principal]
            );
            $this->publishResume($this->principal, $this->values);

            $this->values->offsetSet('lastActive', microtime(true));

            return true;
        }
        return false;
    }
988048
public function getHistoryFile()
    {
        if (isset($this->historyFile)) {
            return $this->historyFile;
        }

        $files = ConfigPaths::getConfigFiles(['psysh_history', 'history'], $this->configDir);

        if (!empty($files)) {
            if ($this->warnOnMultipleConfigs && \count($files) > 1) {
                $msg = \sprintf('Multiple history files found: %s. Using %s', \implode($files, ', '), $files[0]);
                \trigger_error($msg, E_USER_NOTICE);
            }

            $this->setHistoryFile($files[0]);
        } else {
            // fallback: create our own history file
            $dir = $this->configDir ?: ConfigPaths::getCurrentConfigDir();
            $this->setHistoryFile($dir . '/psysh_history');
        }

        return $this->historyFile;
    }
1104997
public function redo()
    {
        end($this->history);
        for ($i=0; $i<$this->history_offset-1; $i++) {
            prev($this->history);
        }
        $index = current($this->history);
        if (!empty($index)) {
            $this->current_passage = $index;
            $this->history_offset--;
            $this->storyline[] = $this->current_passage;
        }
        return $this->getCurrentPassage();
    }
1193045
def write_to_history(**kwargs):
        
        from hyperstream import HyperStream
        hs = HyperStream(loglevel=logging.CRITICAL, file_logger=False, console_logger=False, mqtt_logger=None)
        if hs.current_session:
            hs.current_session.write_to_history(**kwargs)
974437
protected function processCustom(): bool
    {
        $uri = '/' . $this->getCleanUri();
        foreach ($this->routers as $router) {
            if (preg_match($router['pattern'], $uri, $matches)) {
                $this->setParam('_module', $router['module']);
                $this->setParam('_controller', $router['controller']);

                foreach ($router['params'] as $param => $type) {
                    if (isset($matches[$param])) {
                        $this->setParam($param, $matches[$param]);
                    }
                }
                return true;
            }
        }
        return false;
    }
292867
protected function updateHistory()
    {
        $time    = time();
        $version = $this->App::VERSION;

        if (!$this->history['first_time']) {
            $this->history['first_time'] = $time;
        }
        $this->history['last_time']          = $time;
        $this->history['last_version']       = $version;
        $this->history['versions'][$version] = $time;

        uksort($this->history['versions'], 'version_compare');
        $this->history['versions'] = array_reverse($this->history['versions'], true);

        $this->s::sysOption('install_history', $this->history);
    }
40939
public function history()
    {
        try {
            $sessions = $this->getRequestParameter('session');
            $requestOptions = $this->getRequestOptions([
                'sortby' => 'timestamp',
                'sortorder' => 'desc',
                'periodStart' => '',
                'periodEnd' => '',
            ]);

            if (!is_array($sessions)) {
                $sessions = $sessions ? explode(',', $sessions) : [];
            }
            $historyService = $this->getServiceManager()->get(TestSessionHistoryService::SERVICE_ID);
            $this->returnJson(DataTableHelper::paginate($historyService->getSessionsHistory($sessions, $requestOptions), $requestOptions));

        } catch (ServiceNotFoundException $e) {
            \common_Logger::w('No history service defined for proctoring');
            $this->returnError('Proctoring interface not available');
        }
    }
1030076
private function isCurrentlyLastPage()
    {
        if ($this->page_number_type === 'start_num') {
            if ($this->page_number_value >= ($this->total_pages*$this->items_per_page)-$this->items_per_page) {
                return true;
            }
            return false;
        } elseif ($this->page_number_type === 'page_num') {
            if ($this->page_number_value >= $this->total_pages) {
                return true;
            }
            return false;
        }
        return false;
    }
1008569
def read_history
    return super if History.disabled?
    File.exist?(history_file_path) && history.empty? &&
      File.readlines(history_file_path).each{ |e| history << e.chomp }
  end
336331
public function getHistory()
    {
        $history = array(
            1 => new MaintenanceState(json_decode($this->getDriver()->get(self::PREFIX . self::LAST_MODE), true))
        );

        $i = 2;
        while ($data = json_decode($this->getDriver()->get(self::PREFIX . $i), true)) {
            $history[$i] = new MaintenanceState($data);
            $i++;
        }
        return $history;
    }
363190
protected function cleanHistory()
    {
        $createdAt = new \DateTime();
        $logs = $this->instance->getLogs();
        foreach($logs as $log) {
            if(($createdAt->getTimestamp() - $log->getCreatedAt()->getTimestamp()) > $this->expiredTimestamp) {
                $this->instance->removeLog($log);
            }
        }
    }
675199
function getHistory()
    {
        $scrollback = '';
        for ($i = 0; $i < count($this->history); $i++) {
            for ($j = 0; $j <= $this->max_x + 1; $j++) {
                if (isset($this->history_attrs[$i][$j])) {
                    $scrollback.= $this->history_attrs[$i][$j];
                }
                if (isset($this->history[$i][$j])) {
                    $scrollback.= htmlspecialchars($this->history[$i][$j]);
                }
            }
            $scrollback.= "\r\n";
        }
        $scrollback.= $this->_getScreen();

        return '<pre style="color: white; background: black" width="' . ($this->max_x + 1) . '">' . $scrollback . '</pre>';
    }