@param string $file

@return static
334095
public function load($file = '@root/.env')
    {
        $this->_file = $file;

        $file = $this->alias->resolve($file);
        $parsed_file = $file . '.php';
        if (is_file($parsed_file)) {
            /** @noinspection PhpIncludeInspection */
            $env = require $parsed_file;
        } elseif (is_file($file)) {
            $lines = file($file, FILE_SKIP_EMPTY_LINES | FILE_IGNORE_NEW_LINES);
            if ($lines === false) {
                throw new RuntimeException(['read `:file` failed', 'file' => $file]);
            }
            $env = $this->parse($lines);
        } else {
            throw new FileNotFoundException(['.env file is not found: :file', 'file' => $file]);
        }

        /** @noinspection AdditionOperationOnArraysInspection */
        $this->_env += $env;

        if ($this->_toEnv) {
            /** @noinspection AdditionOperationOnArraysInspection */
            $_ENV += $env;
        }

        return $this;
    }
1227933
public function withTag($file)
    {
        $extension = pathinfo($file, PATHINFO_EXTENSION);

        try {
            $manifest = $this->readManifestFile();
        } catch (\Exception $e) {
            Craft::log(printf($e->getMessage()), LogLevel::Info, true);
            return $file;
        }

        // if no manifest, return the regular asset
        if (!$manifest) {
            if ($extension == 'js') {
                return '<script src="' . $this->buildPath . '/' . $file . '"></script>';
            }

            return '<link rel="stylesheet" href="' . $file . '">';
        }

        if ($extension == 'js') {
            return '<script src="' . $this->buildPath . '/' . $manifest[$file] . '"></script>';
        }

        return '<link rel="stylesheet" href="' . $this->buildPath . '/' . $manifest[$file] . '">';
    }
276777
public function setFile(File $file)
    {
        $this->file = $file;

        if ($this->file) {
            $this->updatedAt = new \DateTime('now');
        }

        return $this;
    }
941696
public function process($file) {

		ob_start();
		extract($this -> viewmodel -> getVariables(), EXTR_REFS);
		include($file);
		$this -> output = ob_get_clean();

		return $this;
	}
222572
public function loadConfig($file)
    {
        $config;

        switch (pathinfo($file, PATHINFO_EXTENSION)) {
        case 'json':
            $config = json_decode(file_get_contents($file));
            break;
        case 'php':
            $config = include $file;
            break;
        default:
            return $this;
        }

        $this->doCallback('configurationLoaded', array($config, $this));
        
        return $config;
    }
801332
public function load($file, $extension = 'json')
	{
		$this->file = $file;
		$this->extension = $extension;

		return $this;
	}
86423
public function load($file)
    {
        if (file_exists($file)) {
            $this->feed = ZendReader::importFile($file);
        } else {
            $this->feed = ZendReader::import($file);
        }

        return $this;
    }
156093
public function setFile(File $file = null)
    {
        $this->file = $file;

        if (!empty($file)) {
            $size = @getimagesize($file->getPathname());

            if (is_array($size)) {
                list($this->width, $this->height) = $size;
            }

            $this->refreshUpdatedAt();
        }

        return $this;
    }
1208157
public function setFile(File $file = null)
    {
        $this->file = $file;
        // Until php7/uploaderbundle 1.7
        if ($file instanceof UploadedFile) {
            $this->setMimeType($file->getMimeType());
            $this->setName($file->getClientOriginalName());
            $this->setSize($file->getSize());
        }
        
        return $this;
    }
395466
public function loadFile($file)
    {
        if (!is_file($file)) {
            throw new \RuntimeException(sprintf('File: %s not found.', $file));
        }

        $this->body = function () use ($file) {
            return file_get_contents($file);
        };

        $this->setFilename(pathinfo($file, PATHINFO_BASENAME));

        return $this;
    }
1143132
protected static function normalizeFilesTree(array $file)
    {
        if(!is_array($file['tmp_name']))
            return new static(
                $file['name'], $file['type'], $file['tmp_name'], $file['error'], $file['size']
                );

        $normalizedFiles = array();

        foreach(array_keys($file['tmp_name']) as $key)
            $normalizedFiles[$key] = static::normalizeFilesTree(array(
                'tmp_name' => $file['tmp_name'][$key],
                'name' => $file['name'][$key],
                'type' => $file['type'][$key],
                'error' => $file['error'][$key],
                'size' => $file['size'][$key]
                ));

        return $normalizedFiles;
    }
1283529
public function create(string $file) : ModularParser
    {
        $clone = clone $this;
        $clone->valid = null;
        $clone->file = false;
        $clone->class = null;
        return $clone->setFileToLoad($file);
    }
88180
public static function for_file($file)
    {
        if (!$file || (is_string($file) && !file_exists($file))) {
            return null;
        }

        // Ensure we have a File instance to work with
        if (is_string($file)) {
            /** @var File $fileObject */
            $fileObject = File::create();
            $fileObject->setFromLocalFile($file);
            $file = $fileObject;
        }

        $extension = $file->getExtension();
        $mime = $file->getMimeType();

        foreach (self::get_extractor_classes() as $className) {
            $extractor = self::get_extractor($className);

            // Skip unavailable extractors
            if (!$extractor->isAvailable()) {
                continue;
            }

            // Check extension
            if ($extension && $extractor->supportsExtension($extension)) {
                return $extractor;
            }

            // Check mime
            if ($mime && $extractor->supportsMime($mime)) {
                return $extractor;
            }
        }
    }
218506
public function setTemplateFile($file)
    {
        $this->onRender[] = function() use ($file) {
            $this->getTemplate()->add('gridoTemplate', $this->getTemplate()->getFile());
            $this->getTemplate()->setFile($file);
        };

        return $this;
    }
381922
private function compile($file)
    {
        $this->dispatchEvent('before.compile', $file);

        $compiled = $this->getCompiler()->compile(file_get_contents($file));

        $this->dispatchEvent('after.compile', $file);

        return $compiled;
    }
835538
public function handle($file)
    {
        if (!$mime = $this->getMimeForEmit($file->getExtension())) {
            return $file;
        }
        if (!$file_loc = $file->getLocation()) {
            return $file;
        }
        $file->setMime($mime);
        $file->setFound();
        $fp   = fopen($file_loc, 'r');
        $file->setResource($fp);

        return $file;
    }
2144
public static function fromConfigFile($file)
	{
		if(!is_file($file))
		{
			throw new \RuntimeException(sprintf('Config file "%s" does not exist', $file));
		}
		
		$config = new Configuration(static::processConfigFileData(require $file));
		
		return new ConnectionManager($config->getConfig('ConnectionManager'));
	}