Load data from disk

@return void
@throws KBException
542675
public static function loadData(): void
    {
        if (Search::$loaded === false) {
            $filePath = Search::$DATA_DIR."merged-ultraslim.json";
            $contents = @file_get_contents($filePath);
            if ($contents === false) {
                throw new KBException("$filePath does not exist !");
            }
            Search::$data   = json_decode($contents);
            Search::$loaded = true;
        }
    }
736976
protected function loadKeysIfNotLoaded()
    {
        if (!$this->keyProvider || $this->keysLoaded) {
            return;
        }

        $this->keysLoaded = true;

        foreach (call_user_func($this->keyProvider) as $key=>$xType) {
            $this->namedTypes[$key] = $xType;
        }
    }
480481
public function loadDatabase(string $file): void
	{
		$this->connection->transactional(function (Connection $db) use ($file) {
			$db->query('SET foreign_key_checks = 0');
			FileImporter::executeFile($db, $file);
			$db->query('SET foreign_key_checks = 1');
		});
	}
1237914
private function load()
    {
        $this->cached = [];
        $entities = $this->daoGeneric->getEntities($this->entityName);
        foreach ($entities as $one) {
            $id = $one[ETypeBase::A_ID];
            $code = $one[ETypeBase::A_CODE];
            $this->cached[$code] = $id;
        }
    }
359598
protected function load()
	{
		$this->rules = [];
		$rules = DiscHelper::loadFromFile($this->ruleFile);
		foreach ($rules as $name => $ruleData) {
			$this->rules[$name] = unserialize($ruleData);
		}
	}
940197
private function loadKeyProperties()
    {
        $this->keyProperties = array();
        foreach( $this->dataTypes as $name => $dataType ) {
            if( $dataType->isPrimaryKey() ) {
                $this->keyProperties[] = $name;
            }
        }
    }
845823
public function load()
	{
		if (!($this->get('db') instanceof \Hubzero\Database\Driver))
		{
			return;
		}

		// Initialise variables.
		$db = $this->get('db');

		$query = $db->getQuery()
			->select('m.id')
			->select('m.menutype')
			->select('m.title')
			->select('m.alias')
			->select('m.note')
			->select('m.path', 'route')
			->select('m.link')
			->select('m.type')
			->select('m.level')
			->select('m.language')
			->select('m.browserNav')
			->select('m.access')
			->select('m.params')
			->select('m.home')
			->select('m.img')
			->select('m.template_style_id')
			->select('m.component_id')
			->select('m.parent_id')
			->select('e.element', 'component')
			->from('#__menu', 'm')
			->join('#__extensions AS e', 'e.extension_id', 'm.component_id', 'left')
			->whereEquals('m.published', 1)
			->where('m.parent_id', '>', 0)
			->whereEquals('m.client_id', 0)
			->order('m.lft', 'asc');

		// Set the query
		$db->setQuery($query->toString());

		$this->_items = $db->loadObjectList('id');

		foreach ($this->_items as &$item)
		{
			// Get parent information.
			$parent_tree = array();
			if (isset($this->_items[$item->parent_id]))
			{
				$parent_tree  = $this->_items[$item->parent_id]->tree;
			}

			// Create tree.
			$parent_tree[] = $item->id;
			$item->tree = $parent_tree;

			// Create the query array.
			$url = str_replace('index.php?', '', $item->link);
			$url = str_replace('&amp;', '&', $url);

			parse_str($url, $item->query);
		}
	}
97271
private function loadResources()
    {
        if ($this->class !== null && $this->classFilterSet === false) {
            $this->addClassFilter();
        }

        /** @var common_persistence_SqlPersistence $persistence */
        $persistence = $this->getModel()->getPersistence();
        $platform = $persistence->getPlatForm();
        $query = $platform->getQueryBuilder()
            ->select('*')
            ->from('statements')
            ->andWhere('id > ' . $this->lastId)
            ->orderBy('id');

        if ($this->cacheSize > 0) {
            $query->setMaxResults($this->cacheSize);
        }

        $query = $this->filter->applyFilters($query);
        $results = $query->execute();

        if ($this->cacheSize > 0) {
            $this->endOfClass = $results->rowCount() < $this->cacheSize;
        }

        foreach ($results->fetchAll() as $result) {
            $this->resources[] = $result;
            $this->lastId = $result['id'] > $this->lastId ? $result['id'] : $this->lastId;
        }
    }
203545
protected function load()
    {
        $json = file_get_contents($this->filename);
        if (false === $json) {
            // @codeCoverageIgnoreStart
            throw new RuntimeException('Unable to open file ' . $this->filename);
            // @codeCoverageIgnoreEnd
        }

        $this->unserialize($json);
        $this->cookies = $this->cookies ?: array();
    }
629108
private synchronized void load() {
    Map<String, HadoopServer> map = new TreeMap<String, HadoopServer>();
    for (File file : saveDir.listFiles()) {
      try {
        HadoopServer server = new HadoopServer(file);
        map.put(server.getLocationName(), server);

      } catch (Exception exn) {
        System.err.println(exn);
      }
    }
    this.servers = map;
  }
181304
private function load()
    {
        // reset phrases
        $this->phrases = array();
        $this->loaded = true;

        // set file path
        $langDataPath = FS2LANG . '/' . $this->local . '/' . $this->type . '.txt';

        // include language data file
        if (file_exists($langDataPath)) {
            // load file
            $langData = file_get_contents($langDataPath);
            $langData = str_replace(array("\r\n", "\r"), "\n", $langData); // unify linebreaks
            $this->import($langData);

            // get lines
            $langData = preg_replace("/#.*?\n/is", '', $langData);
            $langData = explode("\n", $langData);

            // Run through lines
            foreach ($langData as $line) {
                preg_match("#([a-z0-9_-]+?)\s*?:\s*(.*)#is", $line, $match);
                if (count($match) >= 2) {
                    $this->add($match[1], $match[2]);
                }
                unset($match);
            }
        } else {
            Throw new \Exception('Language File not found: ' . $langDataPath);
        }
    }
1155847
def load_kb_mappings_file(kbname, kbfile, separator):
    """"""
    num_added = 0
    with open(kbfile) as kb_fd:
        for line in kb_fd:
            if not line.strip():
                continue
            try:
                key, value = line.split(separator)
            except ValueError:
                # bad split, pass
                current_app.logger.error("Error splitting: {0}".format(line))
                continue
            add_kb_mapping(kbname, key, value)
            num_added += 1
    return num_added
1108156
public function load()
    {
        foreach ($this->definitions as $tag => $definition) {
            $this->extendContainer($tag, $definition);
        }
    }
682474
public function __load()
    {
        if (! file_exists($file = $this->getDatabaseFileName())) {
            return collect();
        }

        return collect(json_decode(file_get_contents($file), true));
    }
1214185
protected function loadData(): void
	{
		$data = $this->store->read($this->sessionId);

		$this->sessionData = $data === false ? [] : $data;
	}
1036009
function load($data = [])
    {
        foreach ($this as $k => $v) {
            if ($k == 'table' || $k == 'where') {
                continue;
            }
            if (isset($data[$k])) {
                $this->$k = $data[$k];
            }
        }
    }
1332386
public function load()
    {
        $surebert = $this->request->args;

        if (empty($surebert)) {

            $surebert = Array('sb');
        }

        if ($surebert[0] == 'sb') {
            echo "var sbBase = '/surebert/load/';\n";
        }
        echo $this->concatFiles($surebert);
    }