Load data from Vatsim network.

@return bool
4885
public function loadData()
    {
        try {
            LoggerFactory::$file = $this->config['logFile'];
            LoggerFactory::$level = $this->config['logLevel'];
            $data = $this->getDataSync();
            $data->setDefaults();
            $data->cacheDir = $this->config['cacheDir'];
            $data->cacheOnly = $this->config['cacheOnly'];
            $data->dataExpire = $this->config['dataExpire'];
            $data->refreshInterval = $this->config['dataRefresh'];
            $data->forceRefresh = $this->config['forceDataRefresh'];

            // use statussync for non-cache mode
            if (!$data->cacheOnly) {
                $status = $this->prepareSync();
                $data->registerUrlFromStatus($status, 'dataUrls');
            }

            $this->results = $data->loadData();
        } catch (\Exception $e) {
            $this->exceptionStack[] = $e;

            return false;
        }

        return true;
    }
1346138
protected function _loadAllTraversable()
    {
        $data = parent::_loadAllTraversable();
        $dataExportWhitelist = $this->getDataExportWhitelist();
        foreach($data as $key=>$row) {
            if (in_array($row['group'], $this->excludeGroups)) {
                unset($data[$key]);
                continue;
            }
            $data[$key]['exportTable'] = true;
            $data[$key]['respondentData'] = true;
            if (in_array($row['name'], $dataExportWhitelist)) {
                $data[$key]['respondentData'] = false;
            }
        }
        return $data;
    }
433832
public function loadUserFromToken()
    {
        $token = $this->httpSession()->get($this->getTokenName());
        if (!$token) {
            return false;
        }

        return $this->decryptUserData($token);
    }
1289885
public function load()
	{
		if ($this->mysql === null)
		{
			return false;
		}

		$query = $this->mysql->prepare('SELECT `items`, `data` FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :id');
		$query->bindValue(':id', $this->id);
		if ($query->execute() && ($row = $query->fetch()))
		{
			$data = unserialize($row[1]);

			if (isset($this->options['items'][0]))
			{
				$items = (int) $this->options['items'][0];
			}
			else
			{
				$items = (int) $row[0];
			}

			if ($items !== 0)
			{
				if (isset($data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]))
				{
					$feed =& $data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0];
				}
				elseif (isset($data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]))
				{
					$feed =& $data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0];
				}
				elseif (isset($data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]))
				{
					$feed =& $data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0];
				}
				elseif (isset($data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]))
				{
					$feed =& $data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0];
				}
				else
				{
					$feed = null;
				}

				if ($feed !== null)
				{
					$sql = 'SELECT `data` FROM `' . $this->options['extras']['prefix'] . 'items` WHERE `feed_id` = :feed ORDER BY `posted` DESC';
					if ($items > 0)
					{
						$sql .= ' LIMIT ' . $items;
					}

					$query = $this->mysql->prepare($sql);
					$query->bindValue(':feed', $this->id);
					if ($query->execute())
					{
						while ($row = $query->fetchColumn())
						{
							$feed['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['entry'][] = unserialize($row);
						}
					}
					else
					{
						return false;
					}
				}
			}
			return $data;
		}
		return false;
	}
729316
function load_data ($input = null) {
		$data = null;
		$file = null;
		if ( $input === null ) {
			$file = $this->file;
		} elseif ( file_exists($input) ) {
			$file = $input;
		} else {
			$data = $input;
		}
		if ( !empty($data) || $data = $this->_rfile($file) ) {
			if ( $this->file != $file ) $this->file = $file;
			if ( preg_match('/\.php$/i', $file) && preg_match('/<\?.*?\?>(.*)/ims', $data, $strip) ) {
				$data = ltrim($strip[1]);
			}
			if ( $this->convert_encoding ) $data = iconv($this->input_encoding, $this->output_encoding, $data);
			if ( substr($data, -1) != "\n" ) $data .= "\n";
			$this->file_data = &$data;
			return true;
		}
		return false;
	}
1281383
protected function loadCache()
    {
        if (file_exists($this->cacheFile)) {
            $this->routes = require $this->cacheFile;
            $this->cacheLoaded = true;
            return true;
        }

        return false;
    }
1077858
public function actionLoad()
    {
        if (!Yii::$app->request->isAjax) {
            return $this->redirect(['forum/index']);
        }

        $result = ['messages' => '', 'more' => 0];

        if (!Podium::getInstance()->user->isGuest) {
            $loggedId = User::loggedId();
            $id = Yii::$app->request->post('message');
            $message = Message::find()->where(['id' => $id])->limit(1)->one();
            if ($message && ($message->sender_id == $loggedId || $message->isMessageReceiver($loggedId))) {
                $stack = 0;
                $reply = clone $message;
                while ($reply->reply && $stack < 5) {
                    $result['more'] = 0;
                    if ($reply->reply->sender_id == $loggedId && $reply->reply->sender_status == Message::STATUS_DELETED) {
                        $reply = $reply->reply;
                        continue;
                    }
                    $result['messages'] .= $this->renderPartial('load', ['reply' => $reply]);
                    $reply = $reply->reply;
                    if ($reply) {
                        $result['more'] = $reply->id;
                    }
                    $stack++;
                }
            }
        }
        return Json::encode($result);
    }
1163266
public static function loadWfInOne()
    {
        if (static::$isWfInOneLoaded) {
            return true;
        }

        $inOneFile = ROOT_DIR . '/data/temp/wf_main_in_one.php';

        if (is_file($inOneFile) && date('Y-m-d', filemtime($inOneFile)) == date('Y-m-d')) {
            static::$isWfInOneLoaded = include_once $inOneFile;
            return static::$isWfInOneLoaded;
        }

        if (!is_writeable(dirname($inOneFile))) {
            return false;
        }

        // 待合并预加载的类
        $libClasses = [
            // app
            '\\wf\\app\\ApplicationAbstrct',
            '\\wf\\app\\Benchmark',
            '\\wf\\app\\Config',
            '\\wf\\app\\Hook',
            '\\wf\\app\\HookInterface',
            '\\wf\\app\\I18n',
            '\\wf\\app\\Object',
            '\\wf\\app\\ServiceLocator',
            '\\wf\\app\\Session',
            '\\wf\\app\\Version',

            // mvc
            '\\wf\\app\\web\\Application',
            '\\wf\\app\\web\\Controller',
            '\\wf\\app\\web\\Dispatcher',
            '\\wf\\app\\web\\Message',
            '\\wf\\app\\web\\Output',
            '\\wf\\app\\web\\Request',
            '\\wf\\app\\web\\Response',
            '\\wf\\route\\RouteAbstract',
            '\\wf\\route\\adapter\\Simple',
            '\\wf\\model\\Model',
            '\\wf\\model\\Error',
            '\\wf\\template\\EngineInterface',
            '\\wf\\template\\adapter\\Wind',

            // cache
            '\\wf\\cache\\CacheInterface',
            '\\wf\\cache\\CacheAbstract',
            '\\wf\\cache\\adapter\\File',
            '\\wf\\cache\\adapter\\Memcache',
            '\\wf\\cache\\adapter\\Memcached',
            '\\wf\\cache\\adapter\\Redis',

            // db
            '\\wf\\db\\DBInterface',
            '\\wf\\db\\DBAbstract',
            '\\wf\\db\\Finder',
            '\\wf\\db\\QueryBuilder',
            '\\wf\\db\\adapter\\MySQLi',
            '\\wf\\db\\adapter\\PDOMySQL',

            // logger
            '\\wf\\logger\\LoggerInterface',
            '\\wf\\logger\\LoggerAbstract',
            '\\wf\\logger\\adapter\\File',
        ];

        $liteContent = "<?php\n";

        foreach ($libClasses as $class) {
            $file = static::getClassFile($class);
            if (!$file) {
                continue;
            }

            // 类文件源码内容
            $clsCode = file_get_contents($file);
            $clsCode = clearSourceToken($clsCode, [T_COMMENT, T_DOC_COMMENT, T_INCLUDE_ONCE, T_REQUIRE_ONCE]); // 清空注释、require_once、include_once
            $clsCode = substr(trim($clsCode), 5); // 去掉文件开头的 <?php
            $clsCode = trim($clsCode);

            // 去掉php结束符 ？>
            if (substr($clsCode, -2) == '?>'){
                $clsCode = substr($clsCode, 0, -2);
            }

            // 处理namespace
            if(strpos($clsCode,'namespace ') === 0) {
                $clsCode = preg_replace('/namespace\s+(.*?);/','namespace \\1{', $clsCode, 1);
            } else {
                $clsCode = 'namespace {' . $clsCode;
            }
            $clsCode .= '}';

            //$liteContent .= "\n# {$class}\n". $clsCode;
            $liteContent .= $clsCode;
        }

        // 处理空行、空格
        $sourceLineArr = explode("\n", $liteContent);
        foreach ($sourceLineArr as $lineNumber => $lineText) {
            // 去掉前后空格
            $lineText = trim($lineText);

            // 去掉空行
            if (strlen($lineText) == 0) {
                unset($sourceLineArr[$lineNumber]);
                continue;
            }

            // 多个连续空格保留一个
            $lineText = preg_replace("/\s+/", ' ', $lineText);
            $sourceLineArr[$lineNumber] = $lineText;
        }
        $liteContent = implode("\n", $sourceLineArr);

        if(file_put_contents($inOneFile, $liteContent)) {
            static::$isWfInOneLoaded = include_once $inOneFile;
            return static::$isWfInOneLoaded;
        }

        return false;
    }
121929
public function load()
    {
        $data = [];

        if (is_file($this->filePath)) {
            $data = json_decode(file_get_contents($this->filePath), true);
        }

        return $data;
    }
1214185
protected function loadData(): void
	{
		$data = $this->store->read($this->sessionId);

		$this->sessionData = $data === false ? [] : $data;
	}
712678
public function load()
    {
        if ($this->_configData === null) {
            $this->initScope();
            $this->_configData = $this->_getConfig(false);
        }

        return $this->_configData;
    }
351544
public function load()
    {
        if (!$this->esprima) {

            $this->esprima = $this->loadFile(
                $this->locator->locate($this->file)
            );
        }

        return $this->esprima;
    }
158577
protected static function load()
    {
        need(root().'app/http/Filter.php');

        $filter = instance(\App\Http\Filter::class);

        self::$filters['app'] = $filter::$middleware;
        self::$filters['route'] = $filter::$routeMiddleware;

        return self::$filters;
    }
55986
public function load()
    {
        $shmid = shm_attach($this->sysvKey, $this->shmSize, $this->perm);
        if ($shmid === false) {
            throw new \RuntimeException(
                'Failed to attach to the shared memory'
            );
        }
        if (! shm_has_var($shmid, self::VAR_KEY)) {
            $result = new JobConfig();
        } else {
            $result = shm_get_var($shmid, self::VAR_KEY);
        }
        shm_detach($shmid);

        if ($result === false) {
            throw new \RuntimeException(
                'Failed to deserialize data from shared memory'
            );
        }
        return $result;
    }
951716
protected function _loadavg()
    {
        if (CommonFunctions::rfts('/proc/loadavg', $buf, 1, 4096, PSI_OS != 'Android')) {
            $result = preg_split("/\s/", $buf, 4);
            // don't need the extra values, only first three
            unset($result[3]);
            $this->sys->setLoad(implode(' ', $result));
        } elseif (CommonFunctions::executeProgram('uptime', '', $buf) && preg_match("/load average: (.*), (.*), (.*)$/", $buf, $ar_buf)) {
            $this->sys->setLoad($ar_buf[1].' '.$ar_buf[2].' '.$ar_buf[3]);
        }
        if (PSI_LOAD_BAR) {
            $this->sys->setLoadPercent($this->_parseProcStat('cpu'));
        }
    }
943478
public function getData()
    {
        $this->validate('merId', 'password', 'merUrlIdx');
        $data = array(
            'mer_id'            => $this->getMerId(),
            'password'          => $this->getPassword(),
            'mer_url_idx'       => $this->getMerUrlIdx(),
            'client_ip'         => $this->getClientIp(),
        );
        return $data;
    }
634062
public function load()
    {
        // Check for existence only once and save the result
        $exists = is_file($this->file);

        if ($this->autoCreate == false && !$exists) {
            throw new RuntimeException('File does not exist');
        } else if ($this->autoCreate == true && !$exists) {
            // Create new empty file
            touch($this->file);

            $this->loaded = true;
            // There's no need to fetch content from the empty file
            return array();
        }

        $content = file_get_contents($this->file);
        $content = $this->serializer->unserialize($content);

        if (!$content) {
            $content = array();
        }

        $this->content = $content;
        $this->loaded = true;
    }