@param string            $key
@param string|array|null $file

@return mixed
497962
protected static function optimizeGet(string $key, $file = null)
    {
        $object = self::$__optimizeInstance ?? self::optimizeInstance();
        $prefix = static::$__prefix ? static::$__prefix . '|' . static::class : static::class;

        return $object->get($prefix, $key, $file);
    }
172691
public function addPostFile($key, $file, $content = null)
    {
        $this->setMethod('POST');
        $this->setBody(null);
        if ($content === null && is_file($file)) {
            $content = @file_get_contents($file);
        }
        $this->_postFiles[$key] = [basename($file), $content];
    }
546179
private function getFileContents($file) {
    if (file_exists($file) === FALSE) {
      return NULL;
    }

    $contents = file_get_contents($file);
    if ($contents === FALSE) {
      return NULL;
    }

    return $contents;
  }
706391
public Object getFileMetadata(String file, String key) {
    Map<String, Object> fileKeys = fileLevel.get(file);
    if (fileKeys == null) {
      return null;
    }

    return fileKeys.get(key);
  }
299695
public static function loadKeyFromCertificateFile($file)
    {
        Assertion::true(file_exists($file), sprintf('File "%s" does not exist.', $file));
        $content = file_get_contents($file);

        return self::loadKeyFromCertificate($content);
    }
522259
public function get($key)
    {
        $filePath = $this->storageFolder . $key;
        if (file_exists($filePath)) {
            return file_get_contents($filePath);
        }

        return null;
    }
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;
        }

    }
375359
public function request($type, $file = null)
    {
        // check if not checked
        $this->check();

        // check if is cached
        if(isset($this->cache[sha1($file)][$type]))
        {
            return $this->cache[sha1($file)][$type];
        }

        // command arguments
        $arguments = $this->getArguments($type, $file);

        // check the request
        $file = parent::checkRequest($type, $file);

        // add last argument
        if($file)
        {
            $arguments[] = escapeshellarg($file);
        }

        // build command
        $jar = escapeshellarg($this->path);
        $command = ($this->java ?: 'java') . " -jar $jar " . implode(' ', $arguments);

        // run command
        $response = $this->exec($command);

        // metadata response
        if($type == 'meta')
        {
            // fix for invalid? json returned only with images
            $response = str_replace(basename($file) . '"}{', '", ', $response);

            // on Windows, response comes in another charset
            if(defined('PHP_WINDOWS_VERSION_MAJOR'))
            {
                $response = utf8_encode($response);
            }

            $response = Metadata::make($response, $file);
        }

        // cache certain responses
        if(in_array($type, ['lang', 'meta']))
        {
            $this->cache[sha1($file)][$type] = $response;
        }

        return $response;
    }
1140800
public function get($key)
    {
        if (isset($this->storage[$key])) {
            return $this->storage[$key];
        }

        $file = $this->findFile($key);
        if ($file === false) {
            return false;
        }

        if ($file === 0) {
            return null;
        }

        return fopen($file, 'r');
    }
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;
            }
        }
    }
1127057
public function get($key)
    {
        $file=$this->getCacheDir().$key;
        if(file_exists($file)){
            $content=file_get_contents($file);
            $content=unserialize($content);
            return $content;
        }
        return null;
    }
1165059
public function file($key = null, $default = null)
    {
        $files = $this->getUploadedFiles();

        return is_null($key) ? $files : data_get($files, $key, $default);
    }
303584
protected static function optimizeSet($key, $value = null, $file = null)
    {
        $object = self::$__optimizeInstance ?? self::optimizeInstance();
        $prefix = static::$__prefix ? static::$__prefix . '|' . static::class : static::class;

        return $object->set($prefix, $key, $value, $file);
    }
343779
public static function capture($files = null)
    {
        $files = $files ?? $_FILES;
        if (!is_array($files)) {
            return null;
        }

        $keys = array_keys($files);
        sort($keys);
        $multi = $keys !== ['error', 'name', 'size', 'tmp_name', 'type'];
        if (!$multi && is_array($files['name'])) {
            $multi = true;
            $files = array_map(function ($index) use ($files) {
                return array_combine(array_keys($files), array_column($files, $index));
            }, array_keys($files['name']));
        }

        if ($multi) {
            return array_filter(array_map([static::class, 'capture'], $files));
        }

        return new static($files['tmp_name'], $files['name'], $files['type'], $files['error']);
    }
1063928
public function file(string $key = null, $default = null)
    {
        if (is_null($key)) {
            return $this->getUploadedFiles();
        }
        return $this->getUploadedFiles()[$key] ?? $default;
    }
600831
public function retrieve(string $key)
  {
    $file = $this->file;

    if (file_exists($file)) {
      $data = unserialize($this->decrypt(file_get_contents($file)));

      if (isset($data[$key])) {
        return $data[$key];
      }
    }

    return null;
  }
1240369
public function load($file, $data = null)
    {
        $data = array_merge($this->data, (array) $data);

        $renderer = $this->createSelf();

        return $renderer->render($file, $data);
    }