load

@param string $file

@throws \RuntimeException
@return  null|string
191212
public function load($file)
    {
        if (!is_file($file)) {
            if (!$found = $this->findFile($file)) {
                $paths = array_values(iterator_to_array(clone $this->paths));

                $paths = implode(" / ", $paths);

                throw new \RuntimeException(sprintf('Language file: %s not found. Paths in queue: %s', $file, $paths));
            }
        } else {
            $found = $file;
        }

        return file_get_contents($found);
    }
1105728
protected function getFileContents($file)
    {
        // If the file is not readable
        if (!is_readable($file)) {
            throw new RuntimeException(
                sprintf(RuntimeException::INVALID_FILE_STR, $file),
                RuntimeException::INVALID_FILE
            );
        }

        return file_get_contents($file);
    }
295529
public function loadFile($file = null)
    {
        if (null === $file) {
            $file = $this->getDefaultPath();
        }

        $json = $this->json->decodeFile($file);

        if (isset($json->import)) {
            if (!Path::isAbsolute($json->import)) {
                $json->import = Path::join(
                    array(
                        dirname($file),
                        $json->import
                    )
                );
            }

            $json = (object) array_merge(
                (array) $this->json->decodeFile($json->import),
                (array) $json
            );
        }

        $this->json->validate(
            $this->json->decodeFile(BOX_SCHEMA_FILE),
            $json
        );

        return new Configuration($file, $json);
    }
948036
public function load($file)
    {
        $loader = new PhpConfig();
        $templates = $loader->read($file);
        $this->add($templates);
    }
553609
private function load($file)
    {
        if (!isset($this->commands[$file])) {
            $this->commands[$file] = Yaml::parse($file);
        }
        return $this->commands[$file];
    }
1214844
public function load($file){
        $realPath = realpath($file);

        if (!$realPath || !file_exists($realPath)) {
            throw new FileNotFoundException($realPath);
        }

        $this->cookies = file_get_contents($realPath);     
    }
459702
protected function loadFile($file)
    {
        if (!stream_is_local($file)) {
            throw new \InvalidArgumentException(sprintf('Procedure file is not a local file: "%s"', $file));
        }

        if (!file_exists($file)) {
            throw new NotExistsException(sprintf('Procedure file does not exist: "%s"', $file));
        }

        return file_get_contents($file);
    }
917836
public function up($file)
    {
        if (false === ($contents = file_get_contents($file->getPathName()))) {
            throw new RuntimeException($file->getPathName() . ' is not found.');
        }
        $queries = explode(';', $contents);
        try {
            $dbh = $this->pdo->connection(true);
            $dbh->beginTransaction();
            foreach($queries as $query) {
                $cleanedQuery = trim($query);
                if ('' === $cleanedQuery) {
                    continue;
                }
                $stmt = $dbh->prepare($cleanedQuery);
                $stmt->execute();
            }
            $dbh->commit();
        } catch(\PDOException $e) {
            $dbh->rollBack();
            throw new RuntimeException($e->getMessage() . PHP_EOL . $query);
        }

        $this->copyToAppliedDir($file);
    }
384588
protected function loadFile($file)
    {
        if (class_exists('Symfony\Component\Config\Util\XmlUtils')) {
            $dom = XmlUtils::loadFile($file);
            $this->validate($dom);

            return $dom;
        }

        return parent::loadFile($file);
    }
266955
public function loadFile( $file ) {

		if ( empty( $this->files ) )
			$this->files = $this->readDirRecursive(
				$this->base_dir,
				'*' . $this->extension
			);

		if ( ! in_array( $file, $this->files ) )
			return FALSE;

		require_once $file;

		return TRUE;
	}
894850
function load(string $file = null)
    {
        if ($file == null) {
            $file = static::$configFile;
        }
        if (!file_exists($file)) {
            return false;
        }

        $a = json_decode(file_get_contents($file));

        if (isset($a->css)) {
            $this->css = $a->css;
        }

        if (isset($a->js)) {
            $this->js = $a->js;
        }
        
        if (isset($a->jss)) {
            $this->jss = $a->jss;
        }
        
        return true;
    }
1251984
protected function loadConfigFile($file)
    {
        $path = $this->getConfigPath() . '/' . $file;

        if (file_exists($path)) {
            $config = include $path;
            return is_array($config) ? $config : null;
        }

        return null;
    }
206107
public function load($file)
    {
        $this->temporaryFileManager->enterModule('Templating');
        $this->temporaryFileManager->load($file . '.php');
        $this->temporaryFileManager->exitModule();
    }
267852
private function load()
    {
        if (! isset($this->runtime_file_content)) {
            $this->runtime_file_content = json_decode(@file_get_contents($this->getFilePath()), true);
        }

        return $this->runtime_file_content;
    }
815297
protected function readFile(string $file) : array
    {
        if (!file_exists($file)) {
            throw new \InvalidArgumentException(
                sprintf(
                    'Configuration %s is not exists',
                    $file
                ),
                E_WARNING
            );
        }

        if (!is_array(($configs = $this->parseFromFile($file)))) {
            throw new \RuntimeException(
                sprintf(
                    'Invalid %s configuration from file: %s',
                    ltrim(strrchr(get_class($this), '\\'), '\\'),
                    $file
                ),
                E_NOTICE
            );
        }

        return $configs;
    }
1258586
private function loadFile ($file)
	{
		if (!isset ($this->files[$file]))
		{
			$filename = $this->folder . $file . '.php';

			// First load these
			if (file_exists ($filename))
			{
				$this->files[$file] = include ($filename);
			}

			// Now overload with environment values
			if (isset ($this->environment))
			{
				$filename = $this->folder . $this->environment . '/' . $file . '.php';
				if (file_exists ($filename))
				{
					$this->merge ($file, include ($filename));
				}
			}

		}
	}
1049308
protected function loadFile($file)
    {
        if (!stream_is_local($file)) {
            throw new InvalidArgumentException(sprintf('This is not a local file "%s".', $file));
        }

        if (!file_exists($file)) {
            throw new InvalidArgumentException(sprintf('The service file "%s" is not valid.', $file));
        }

        if (null === $this->jsonParser) {
            $this->jsonParser = new Json();
        }

        return $this->validate($this->jsonParser->decode(file_get_contents($file), true), $file);
    }