public function extractFromFile($filePath)
    {
        if (!is_file($filePath)) {

            throw new FileNotFoundException($filePath);
        }

        $extension = pathinfo($filePath, PATHINFO_EXTENSION);
        $this->checkDirectory();

        $extractorAdapterNamespace = $this->getAdapterNamespaceGivenExtension($extension);

        $extractorAdapter = $this
            ->instanceExtractorAdapter($extractorAdapterNamespace);

        if (!$extractorAdapter->isAvailable()) {

            throw new AdapterNotAvailableException($extractorAdapter->getIdentifier());
        }

        return $extractorAdapter->extract($filePath);
    }
public function extractFromFile($filePath)
    {
        if (!is_file($filePath)) {

            throw new FileNotFoundException($filePath);
        }

        $extension = pathinfo($filePath, PATHINFO_EXTENSION);
        $this->checkDirectory();

        $extractorAdapterNamespace = $this->getAdapterNamespaceGivenExtension($extension);

        $extractorAdapter = $this
            ->instanceExtractorAdapter($extractorAdapterNamespace);

        if (!$extractorAdapter->isAvailable()) {

            throw new AdapterNotAvailableException($extractorAdapter->getIdentifier());
        }

        return $extractorAdapter->extract($filePath);
    }
public function extractFromFile ( $ filePath ) { if ( ! is_file ( $ filePath ) ) { throw new FileNotFoundException ( $ filePath ) ; } $ extension = pathinfo ( $ filePath , PATHINFO_EXTENSION ) ; $ this -> checkDirectory ( ) ; $ extractorAdapterNamespace = $ this -> getAdapterNamespaceGivenExtension ( $ extension ) ; $ extractorAdapter = $ this -> instanceExtractorAdapter ( $ extractorAdapterNamespace ) ; if ( ! $ extractorAdapter -> isAvailable ( ) ) { throw new AdapterNotAvailableException ( $ extractorAdapter -> getIdentifier ( ) ) ; } return $ extractorAdapter -> extract ( $ filePath ) ; }
Extract files from compressed file

@param string $filePath Compressed file path

@return Finder Finder instance with all files added

@throws ExtensionNotSupportedException Exception not found
@throws AdapterNotAvailableException   Adapter not available
@throws FileNotFoundException          File not found
Extract files from compressed file