Loads DBF file if supported.

@return bool
979486
private function _openDBFFile()
    {
        if (! self::supportsDbase()) {
            $this->DBFFile = null;

            return true;
        }
        $dbf_name = $this->_getFilename('.dbf');
        if (is_readable($dbf_name)) {
            $this->DBFFile = @dbase_open($dbf_name, 0);
            if (! $this->DBFFile) {
                $this->setError(sprintf('It wasn\'t possible to open the DBase file "%s"', $dbf_name));

                return false;
            }
        } else {
            $this->setError(sprintf('It wasn\'t possible to find the DBase file "%s"', $dbf_name));

            return false;
        }

        return true;
    }
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;
	}
604772
protected function _loadFromDb()
    {
        $sArticleId = $this->getArticle()->getId();

        if (!$this->isAdmin() && \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blVariantInheritAmountPrice') && $this->getArticle()->getParentId()) {
            $sArticleId = $this->getArticle()->getParentId();
        }

        if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blMallInterchangeArticles')) {
            $sShopSelect = '1';
        } else {
            $sShopSelect = " `oxshopid` = " . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote(\OxidEsales\Eshop\Core\Registry::getConfig()->getShopId()) . " ";
        }

        $sSql = "SELECT * FROM `oxprice2article` WHERE `oxartid` = " . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($sArticleId) . " AND $sShopSelect ORDER BY `oxamount` ";

        return \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC)->getAll($sSql);
    }
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);
    }
1277100
public function load()
    {
        if (! file_exists($file = $this->getFileName())) {
            return collect();
        }

        return collect(json_decode(file_get_contents($file), true));
    }
630624
protected function loadAgentFile()
    {
        if (($found = is_file(PATH_FRAMEWORK . 'Config/UserAgents.php'))) {
            include(PATH_FRAMEWORK . 'Config/UserAgents.php');
        }

        if ($found !== true) {
            return false;
        }

        $return = false;

        if (isset($platforms)) {
            static::$platforms = $platforms;
            unset($platforms);
            $return = true;
        }

        if (isset($browsers)) {
            static::$browsers = $browsers;
            unset($browsers);
            $return = true;
        }

        if (isset($mobiles)) {
            static::$mobiles = $mobiles;
            unset($mobiles);
            $return = true;
        }

        if (isset($robots)) {
            static::$robots = $robots;
            unset($robots);
            $return = true;
        }

        return $return;
    }
481815
private function hasDatabaseDriver()
    {
        if (!count($this->getDatabaseDrivers())) {
            $this->console->error(
                'At least 1 PDO driver is required. Either sqlite, mysql or pgsql, check your php.ini file'
            );
            $this->errors = true;
        }
        return false;
    }
1252381
public function load() {
        $this->dictProvider->setLangsPath($this->path);
        $dict = $this->dictProvider->load($this->getUserLangs());
        $this->loadedLang = $this->dictProvider->getLoadedLang();

        if ($dict === null) {
            throw new CantLoadDictionaryException(CantLoadDictionaryException::NO_MATCHING_FILES);
        }

        $this->setlocale();

        return $dict;
    }
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;
    }
411522
public function load()
    {
        $file = new File($this->filePath);
        $fileExt = $file->getExtension();
        $fileConfClass = $this->getConfigFileClass($fileExt);
        if (class_exists($fileConfClass)) {
            $fileConf = new $fileConfClass($file);

            return $fileConf;
        }

        throw new ConfNotSupportedException($this->filePath);
    }
1325677
private function loadDatabases()
	{
		$databaseKeys = $this->config->get('databases:keys')?: [];

		if (!isset($databaseKeys['database'])) $databaseKeys[] = 'database'; // Default database config key

		foreach ($databaseKeys as $databaseKey) {
			$database = $this->config->get($databaseKey);
			if ($database !== false) $this->initConnection($database, $databaseKey);
			$this->config->destroy($databaseKey);
			unset($database);
		}
    }
465195
def load_dbf(self, shapefile_name):
        
        dbf_ext = 'dbf'
        try:
            self.dbf = open("%s.%s" % (shapefile_name, dbf_ext), "rb")
        except IOError:
            try:
                self.dbf = open("%s.%s" % (shapefile_name, dbf_ext.upper()), "rb")
            except IOError:
                pass
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);
		}
	}
236076
private function _loadHeaders()
    {
        if (Util::loadData('N', $this->readSHP(4)) != self::MAGIC) {
            $this->setError('Not a SHP file (file code mismatch)');

            return false;
        }

        /* Skip 20 unused bytes */
        $this->readSHP(20);

        $this->fileLength = Util::loadData('N', $this->readSHP(4));

        /* We currently ignore version */
        $this->readSHP(4);

        $this->shapeType = Util::loadData('V', $this->readSHP(4));

        $this->boundingBox = [];
        $this->boundingBox['xmin'] = Util::loadData('d', $this->readSHP(8));
        $this->boundingBox['ymin'] = Util::loadData('d', $this->readSHP(8));
        $this->boundingBox['xmax'] = Util::loadData('d', $this->readSHP(8));
        $this->boundingBox['ymax'] = Util::loadData('d', $this->readSHP(8));
        $this->boundingBox['zmin'] = Util::loadData('d', $this->readSHP(8));
        $this->boundingBox['zmax'] = Util::loadData('d', $this->readSHP(8));
        $this->boundingBox['mmin'] = Util::loadData('d', $this->readSHP(8));
        $this->boundingBox['mmax'] = Util::loadData('d', $this->readSHP(8));

        if (self::supportsDbase()) {
            $this->DBFHeader = $this->_loadDBFHeader();
        }

        return true;
    }
815625
public function load() {
        $ext = mb_strtolower(pathinfo($this->_path, PATHINFO_EXTENSION));

        switch ($ext) {
            case 'php':
                return include $this->_path;
            break;
            case 'json':
                return json_decode(file_get_contents($this->_path), true);
            break;
            case 'ini':
                return parse_ini_file($this->_path, true);
            break;
            case 'txt':
                return file($this->_path, FILE_IGNORE_NEW_LINES);
            break;
        }

        throw new UnsupportedTypeException(sprintf('Unsupported FileLoader file type %s', $ext));
    }
1142350
public function loadProviderFiles()
    {
        //debug $this->logMessage('ProviderCommunication::loadProviderFile: START','botdetection_debug');
        $lastWeek = time() - (7 * 24 * 60 * 60);

        if (false === $this->allowUrlOpen) 
        {
            $this->logMessage('ProviderCommunication::loadProviderFiles allowUrlOpen = false!', 'botdetection_debug');

            return false;
        }

        foreach($this->referrerProvider as $source => $url) 
        {
            if (false === file_exists($this->cachePath .'/'. strtolower($source) . '.txt') || 
                 $lastWeek > filemtime($this->cachePath .'/'. strtolower($source) . '.txt') 
               )
            {
                //debug $this->logMessage('ProviderCommunication::loadProviderFile: '.$source,'botdetection_debug');
                $fileProvider = fopen($this->cachePath .'/'. strtolower($source) . '.txt', 'wb+');
                fwrite($fileProvider, file_get_contents($url));
                fclose($fileProvider);
            }
        }
        //debug $this->logMessage('ProviderCommunication::loadProviderFile: END','botdetection_debug');
        return true;
    }
961069
function get_dbh()
    {
        if (!$this->db) {
            if ($dsn = $this->app->config->get('virtuser_query_dsn')) {
                // connect to the virtuser database
                $this->db = rcube_db::factory($dsn);
                $this->db->set_debug((bool)$this->app->config->get('sql_debug'));
                $this->db->db_connect('r'); // connect in read mode
            }
            else {
                $this->db = $this->app->get_dbh();
            }
        }

        return $this->db;
    }