@param string $pathfile

@return \FFMpeg\FFProbe\DataMapping\Stream
493734
protected function getStream($pathfile)
    {
        if (!isset($this->streams[$pathfile])) {
            try {
                $this->streams[$pathfile] = $this->ffmpeg->open($pathfile)->getStreams()->first();
            } catch (\RuntimeException $e) {
                throw new NotFoundDataException(
                    sprintf('Unable to provide data for "%s"', $pathfile),
                    $e->getCode(),
                    $e
                );
            }
        }

        return $this->streams[$pathfile];
    }
551381
public function createVideoFromImages($path = 'data/etape*.jpg', $target = false, $framerate = '25', $fps = 25)
    {
        try {
            // don't want this service to be a singleton. I have to reset the ffmpeg parameters for each call.
            $this->serviceLocator->setShared('playgroundcore_phpvideotoolkit', false);

            $this->serviceLocator->get('playgroundcore_phpvideotoolkit')
            ->addPreInputCommand('-y')
            ->addPreInputCommand('-framerate', $framerate)
            ->addPreInputCommand('-pattern_type', 'glob')
            ->addCommand('-i', $path)
            ->addCommand('-c:v', 'libx264')
            ->addCommand('-vf', 'fps='. $fps)
            ->addCommand('-pix_fmt', 'yuv420p')
            ->setOutputPath($target)
            ->execute();
        } catch (FfmpegProcessOutputException $e) {
            throw new \PHPVideoToolkit\InvalidArgumentException('Error when merging videos');
        } catch (\PHPVideoToolkit\Exception $e) {
            throw new \PHPVideoToolkit\InvalidArgumentException('Error when merging videos');
        }

        return $target;
    }
820647
public function download(string $path)
	{
		// To get specific file data pass in the value you want e.g. /Name 
		$requestUrl = $this->siteUrl.'/sites/'.$this->siteName.'/_api/Web/GetFileByServerRelativeUrl(\''.$this->folderPath.$path.'\')';
		
		$options = [
			'headers' => $this->requestHeaders,
		];
		
		$response = $this->send('GET', $requestUrl, $options);
		
		return StreamWrapper::getResource($response->getBody());
	}
1282191
public function read($filename, $pathToFile = null)
    {
        if(!$this->fileExists($filename, $pathToFile))
            throw new \Exception("File, '{$filename}', does not exist.");

        if ($pathToFile==null) {
            return file_get_contents($this->_filePath."/".$filename);
        } else {
            return file_get_contents($pathToFile."/".$filename);
        }
    }
844848
public static function createImage($imageFile)
    {
        $editorName = self::detectAvailableEditor();
        if ('Imagick' === $editorName) {
            return ImagickImage::createFromFile($imageFile);
        } else {
            return GdImage::createFromFile($imageFile);
        }
    }
1109811
public function resolve($pathOrFile)
    {
        if (is_dir($pathOrFile)) {
            $pathOrFile .= DIRECTORY_SEPARATOR . '.docheader';
        }

        if (! is_file($pathOrFile)) {
            throw DocHeaderFileConfiguration::notFound($pathOrFile);
        }

        return $pathOrFile;
    }
365143
public function process(File $phpcsFile, $stackPtr)
    {
        if ($this->supportsBelow('5.6') !== true) {
            return;
        }

        $tokens = $phpcsFile->getTokens();

        $ignore = array(
            \T_DOUBLE_COLON    => true,
            \T_OBJECT_OPERATOR => true,
            \T_FUNCTION        => true,
            \T_CONST           => true,
        );

        $prevToken = $phpcsFile->findPrevious(\T_WHITESPACE, ($stackPtr - 1), null, true);
        if (isset($ignore[$tokens[$prevToken]['code']]) === true) {
            // Not a call to a PHP function.
            return;
        }

        $functionLc = strtolower($tokens[$stackPtr]['content']);
        if ($functionLc !== 'define') {
            return;
        }

        $secondParam = $this->getFunctionCallParameter($phpcsFile, $stackPtr, 2);
        if (isset($secondParam['start'], $secondParam['end']) === false) {
            return;
        }

        $targetNestingLevel = 0;
        if (isset($tokens[$secondParam['start']]['nested_parenthesis'])) {
            $targetNestingLevel = \count($tokens[$secondParam['start']]['nested_parenthesis']);
        }

        $array = $phpcsFile->findNext(array(\T_ARRAY, \T_OPEN_SHORT_ARRAY), $secondParam['start'], ($secondParam['end'] + 1));
        if ($array !== false) {
            if ((isset($tokens[$array]['nested_parenthesis']) === false && $targetNestingLevel === 0) || \count($tokens[$array]['nested_parenthesis']) === $targetNestingLevel) {
                $phpcsFile->addError(
                    'Constant arrays using define are not allowed in PHP 5.6 or earlier',
                    $array,
                    'Found'
                );
            }
        }
    }
472080
public static function readCSV($csvFile)
    {
        ini_set('auto_detect_line_endings', true);
        $file_handle = fopen($csvFile, 'r');
        while (!feof($file_handle)) {
            $line_of_text[] = fgetcsv($file_handle, 1024);
        }
        fclose($file_handle);
        return $line_of_text;
    }
693532
protected function startChildProcess(string $pathToFile) : Process
    {
        $pathToConfig = $this->config['config_path'];
        $startupCommand = 'exec php ' . $pathToFile . ' -c ' . $pathToConfig;
        $process = new Process($startupCommand);
        $process->start($this->loop);

        // listen to output from child process:
        $process->stdout->on('data', function ($output) {
            $this->onChildProcessOut($output);
        });

        $process->on('exit', function ($exitCode, $termSignal) {
            $this->onChildProcessExit($exitCode, $termSignal);
        });

        return $process;
    }
132763
public function load($pathToFile)
    {
        $config = [
            'data' => null,
            'extras' => [
                'isUpdated'  => false,
                'fileName'   => str_replace('\\', '/', $pathToFile),
                'fileExists' => file_exists($pathToFile)]
        ];

        $this->searchCache($pathToFile, $config);
        if (null === $config['data']) {
            $config['extras']['isUpdated'] = true;
            if (file_exists($pathToFile)) {
                switch (substr($pathToFile, strrpos($pathToFile, '.'))) {
                    case '.yml':
                        $config['data'] = Yaml::parse(file_get_contents($pathToFile));
                        break;

                    case '.json':
                        $data = file_get_contents($pathToFile);
                        $config['data'] = json_decode($data, true);
                        break;

                    default:
                        $config['data'] = require $pathToFile;
                }

                $this->saveCache($config, $pathToFile, $this->cacheDepth);
            } else {
                $config['data'] = [];
            }
        } else {
        }
        return $config;
    }
348882
public function addLoadedFile(string $name, string $pathFile)
    {
        $properties                     = $this->getProperties();
        $loadedFiles                    = $properties['loadedFiles'];
        $names                          = array_column($loadedFiles, 'name');
        if (!in_array($name, $names)) {
            $key                        = '1ld';
            if (!empty($loadedFiles)) {
                $loadedFiles                = ksort($loadedFiles);
                /** @var array $loadedFiles */
                $key                        = ((int) array_key_last($loadedFiles) + 1).'ld';
            }
            $item                       = [];
            $item['name']               = $name;
            $item['pathFile']           = $pathFile;
            $item['mime']               = mime_content_type($pathFile);
//            $loadedFiles[$name]         = $pathFile;
            $loadedFiles[$key]          = $item;
            $properties['loadedFiles']  = $loadedFiles;
            $this->setProperties($properties);
            return $this;
        }
        return false;
    }
790332
public static function fromFile($path)
    {
        return new self($path, filesize($path), \DateTime::createFromFormat('U', filemtime($path)));
    }
893118
public static function mapExtensionToType($dataFile) {
        $ext = substr(strrchr($dataFile, '.'), 1);
        $ext = strtolower($ext);
        switch ($ext) {
            case 'xls':
            case 'xlsx':
                return 'Excel';
            break;
            case 'json':
                return 'Json';
            break;
            default:
                throw new Garp_Content_Import_Exception("Could not find importer for type $ext");
            break;
        }
    }
927239
public function streamFile($file)
    {
        $body = $this->builder->messages()->stream($file);
        return $this->response($body);
    }
1197177
private function ensureSymlink($pathFile)
    {
        if (false === $this->symlinker->hasSymlink($pathFile)) {
            $this->symlinker->symlink($pathFile);
        }
    }
167771
public static function setCachePath($pathCacheFile)
    {
        self::$cacheEnable = false;

        if (!empty($pathCacheFile) && file_exists($pathCacheFile)) {
            self::$cacheEnable = true;
            self::$cachePath   = $pathCacheFile;
        }
        elseif (!empty($pathCacheFile) && !file_exists(dirname($pathCacheFile))) {
            self::$cacheEnable = false;
            self::$cachePath   = $pathCacheFile;
        }
        elseif (!empty($pathCacheFile) && touch($pathCacheFile)) {
            unlink($pathCacheFile);
            self::$cacheEnable = true;
            self::$cachePath   = $pathCacheFile;
        }
    }
200804
public static function loadFromFile($yamlFile)
    {
        if (!is_file($yamlFile)) {
            throw new InvalidArgumentException(sprintf('The file %s not exists!', $yamlFile));
        }

        return Yaml::parse(file_get_contents($yamlFile));
    }