loads a file and it's meta data
@param string $file
@param int $ttl
963399
public function load($file,$ttl = 0)
	{
		$this->reset();
		$cache = \Cache::instance();
		$this->file = $file;
		$this->changed = false;
		$this->ttl = $ttl;
		$cacheHash = $this->getCacheHash($file);
		if ($this->f3->get('CACHE') && $ttl && ($cached = $cache->exists(
			$cacheHash,$content)) && $cached[0] + $ttl > microtime(TRUE)
		) {
			// load from cache
			$this->content = $content;
			$this->meta = $this->metaHandle->load($file,$ttl);
		} elseif ($this->fs->exists($file)) {
			// load from FS
			$this->meta = $this->metaHandle->load($file,$ttl);
			// if caching is on, save content to cache backend, otherwise it gets lazy loaded
			if ($this->f3->get('CACHE') && $ttl) {
				$this->content = $this->fs->read($file);
				$cache->set($cacheHash, $this->content, $ttl);
			}
		}
	}
1350530
function load_file($file)
    {
        if (!file_exists($file) || !is_readable($file)) return false;
        $data = file($file);
        foreach ($data as $line) {
            $line = trim($line);
            if (($line == '') || ($line == '#')) continue;
            $line = preg_split('/\s+/', $line, 2);
            if (count($line) < 2) continue;
            $exts = $line[1];
            // if there's a comment on this line, remove it
            $hash_pos = strpos($exts, '#');
            if ($hash_pos !== false) $exts = substr($exts, 0, $hash_pos);
            $this->set($line[0], $exts);
        }
        return true;
    }
931030
public function save($ttl = 0)
	{
		$ttl = ($ttl)?:$this->ttl;
		if (empty($this->file)) {
			trigger_error('Unable to save. No file specified.');
			return false;
		}
		if(is_null($this->content)) {
			trigger_error(sprintf('Unable to save. Contents of file `%s´ is NULL.',$this->file));
			return false;
		}
		if ($this->changed) {
			$this->fs->write($this->file, (string) $this->content);
			if ($this->f3->get('CACHE')) {
				$cache = \Cache::instance();
				$cacheHash = $this->getCacheHash($this->file);
				if ($this->ttl)
					$cache->set($cacheHash,$this->content,$this->ttl);
				elseif ($cache->exists($cacheHash))
					$cache->clear($cacheHash);
			}
		}
		$this->changed = false;
		$this->metaHandle->save($this->file,$this->meta,$ttl);
		return true;
	}
1351261
public function addFile($file) {
        $baseName = basename($file, '.php');

        $components = explode('.', $baseName);
        $language = $components[1];

        $data = require($file);

        $this->add($data, $language);
    }
392080
public function load($file)
	{
		if(!$this->fs->exists($file))
		{
			throw new Exceptions\FileNotExists($file);
		}

		$this->file = $file;
		$this->info->load($file);
		$this->extension = $this->info->extension;
		$this->directory = $this->info->directory;
		$this->filename = $this->info->filename;

		$this->extracter->load($file, $this->extension)
						->extract();

		$this->params = $this->extracter->params();
	}
249409
protected static function load($file)
    {
        if (null !== static::DIRECTORY) {
            return file_get_contents(__DIR__.'/../data/'.static::DIRECTORY.'/'.$file.'.json');
        }

        return file_get_contents(__DIR__.'/../data/'.$file.'.json');
    }
1338555
private function _loadPatchFile($file, $location, $minimumLevel, $maximumLevel)
    {
        if ($sql = file_get_contents($file)) {
            if ($this->encoding && ($this->encoding !== mb_internal_encoding())) {
                $sql = mb_convert_encoding($sql, mb_internal_encoding(), $this->encoding);
            }

            $levels = preg_split('/--\s*(GEMS\s+)?VERSION:?\s*/', $sql);

            // SQL before first -- VERSION: is ignored.
            array_shift($levels);

            foreach ($levels as $level) {
                list($levelnrtext, $leveltext) = explode("\n", $level, 2);

                // no loading of unused patches
                $levelnr = intval($levelnrtext);
                if ($levelnr && ($levelnr >= $minimumLevel) && ($levelnr <= $maximumLevel)) {

                    $patches = preg_split('/--\s*PATCH:?\s*/', $leveltext);

                    // SQL before first -- PATCH: is ignored.
                    array_shift($patches);

                    foreach ($patches as $patch) {
                        // First line now contains patch name
                        list($name, $statements) = explode("\n", $patch, 2);

                        $name = substr(trim($name), 0, 30);

                        // \MUtil_Echo::r($statements, $name);
                        foreach (\MUtil_Parser_Sql_WordsParser::splitStatements($statements, false) as $i => $statement) {
                            $this->_loaded_patches[] = array(
                                    'gpa_level'    => $levelnr,
                                    'gpa_location' => $location,
                                    'gpa_name'     => $name,
                                    'gpa_order'    => $i,
                                    'gpa_sql'      => $statement,
                                );
                        }
                    }

                }
            }
        }
    }
957777
public static function process($file = NULL){

        $exists = isset( self::$data[ self::$level ] );

        if( $exists ){
            $variables = self::$data[ self::$level ];

            foreach( $variables as $key => $value ){
                global $$key;
                $$key = $value;
            }
        }

        if( $file ){
            require $file;
        }

    }
58033
function load($filter=NULL,array $options=NULL,$ttl=0) {
		$this->reset();
		return ($this->query=$this->find($filter,$options,$ttl)) &&
			$this->skip(0)?$this->query[$this->ptr]:FALSE;
	}
895626
public function set_file($file) {
        if (!file_exists($file) || (!is_readable($file))) {
            throw new progressive_parser_exception('invalid_file_to_parse');
        }
        $this->file = $file;
        $this->contents = null;
    }
87246
protected function _decodeFile( $fileName, &$ttl = null )
    {
        if ( !is_file( $fileName ) || false === ( $_json = file_get_contents( $fileName ) ) || empty( $_json ) )
        {
            return false;
        }

        if ( false === ( $_stored = json_decode( $_json, true ) ) || JSON_ERROR_NONE != json_last_error() || !is_array( $_stored ) )
        {
            return false;
        }

        if ( array_key_exists( '.ttl', $_stored ) )
        {
            $ttl = (integer)$_stored['.ttl'];
        }
        else
        {
            $ttl = -1;
        }

        return
            array_key_exists( '.data', $_stored )
                ? ( @unserialize( $_stored['.data'] ) ?: $_stored['.data'] )
                : null;
    }
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');
		});
	}
657936
public function load($file) {
		$this->_origin = $file;
		if(!is_null($file)) {
			if(file_exists($file)) {
				if (is_null($this->_name)) {
					$bits = explode('/', $file);
					$this->_name = preg_replace('~\.tmpl~', '', array_pop($bits));
				}
				$this->_contents = file_get_contents($file);
				$this->_dir = dirname($file);
			}
			else {
				throw new \InvalidArgumentException("file does not exist (". $file .")");
			}
		}
		return $this;
	}
450178
public function load($file, array $data = array())
    {
        $this->queries = array();
        $this->data = $data;

        include $file;

        return $this;
    }
1368925
public function read($file)
    {
        $this->filePath = $file;
        $this->lines = file($this->filePath, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
    }
777083
public function save($data, $ttl = null)
    {
        if (empty($this->stack)) {
            throw new CacheException("Cache::load() must be called before Cache::save()");
        }
        $id = array_pop($this->stack);
        return $this->add($id, $data, $ttl);
    }
291075
public function scan($file)
    {
        // If no decision is already made about this file
        if (!isset($this->states[$file])) {
            $this->display(' -> Scanning '.$file.'...');
            $this->states[$file] = self::NO_PARSE;
            $entry = $this->metas->get($file);
            $rst = $this->getRST($file);

            if (!$entry || !file_exists($rst) || $entry['ctime'] < filectime($rst)) {
                // File was never seen or changed and thus need to be parsed
                $this->addToParseQueue($file);
            } else {
                // Have a look to the file dependencies to knoww if you need to parse
                // it or not
                $depends = $entry['depends'];

                if (isset($entry['parent'])) {
                    $depends[] = $entry['parent'];
                }

                foreach ($depends as $dependency) {
                    $this->scan($dependency);

                    // If any dependency needs to be parsed, this file needs also to be
                    // parsed
                    if ($this->states[$dependency] == self::PARSE) {
                        $this->addToParseQueue($file);
                    }
                }
            }
        }
    }