XBRL-Package.php
public static function fromFile( string $filename, $className )
	{
		$zipArchive = new ZipArchive();

		try
		{
			if ( $zipArchive->open( $filename ) !== true )
			{
				$zipArchive = false;
				throw new Exception("An attempt has been made to open an invalid zip file");
			}
			return self::fromZip( $zipArchive, $className );
		}
		catch ( Exception $ex )
		{
			if ( $zipArchive ) $zipArchive->close();
			throw XBRL_TaxonomyPackageException::withError( "tpe:invalidArchiveFormat", $ex->getMessage() );
		}

		return false;
	}
public static function fromFile( string $filename, $className )
	{
		$zipArchive = new ZipArchive();

		try
		{
			if ( $zipArchive->open( $filename ) !== true )
			{
				$zipArchive = false;
				throw new Exception("An attempt has been made to open an invalid zip file");
			}
			return self::fromZip( $zipArchive, $className );
		}
		catch ( Exception $ex )
		{
			if ( $zipArchive ) $zipArchive->close();
			throw XBRL_TaxonomyPackageException::withError( "tpe:invalidArchiveFormat", $ex->getMessage() );
		}

		return false;
	}
public static function fromFile ( string $ filename , $ className ) { $ zipArchive = new ZipArchive ( ) ; try { if ( $ zipArchive -> open ( $ filename ) !== true ) { $ zipArchive = false ; throw new Exception ( "An attempt has been made to open an invalid zip file" ) ; } return self :: fromZip ( $ zipArchive , $ className ) ; } catch ( Exception $ ex ) { if ( $ zipArchive ) $ zipArchive -> close ( ) ; throw XBRL_TaxonomyPackageException :: withError ( "tpe:invalidArchiveFormat" , $ ex -> getMessage ( ) ) ; } return false ; }
Open a package from a file
@param string $filename
@param string $className
return XBRL_Package
@throws Exception
Open a package from a file