The Phar class provides a high-level interface to accessing and creating PHAR archives.

See also:

Static variables

@:phpClassConststaticfinalread onlyBZ2:Int

@:phpClassConststaticfinalread onlyCOMPRESSED:Int

@:phpClassConststaticfinalread onlyGZ:Int

@:phpClassConststaticfinalread onlyMD5:Int

@:phpClassConststaticfinalread onlyNONE:Int

@:phpClassConststaticfinalread onlyOPENSSL:Int

@:phpClassConststaticfinalread onlyPHAR:Int

@:phpClassConststaticfinalread onlyPHP:Int

@:phpClassConststaticfinalread onlyPHPS:Int

@:phpClassConststaticfinalread onlySHA1:Int

@:phpClassConststaticfinalread onlySHA256:Int

@:phpClassConststaticfinalread onlySHA512:Int

@:phpClassConststaticfinalread onlyTAR:Int

@:phpClassConststaticfinalread onlyZIP:Int

Static methods

staticfinalapiVersion():String

@:value({ type : 0 })staticfinalcanCompress(type:Int = 0):Bool

staticfinalcanWrite():Bool

staticfinalcreateDefaultStub(?index:String, ?webIndex:String):String

@:value({ executable : true })staticfinalisValidPharFilename(filename:String, executable:Bool = true):Bool

staticfinalloadPhar(filename:String, ?alias:String):Bool

@:value({ dataoffset : 0 })staticfinalmapPhar(?alias:String, dataoffset:Int = 0):Bool

staticfinalmount(pharpath:String, externalpath:String):Void

@:value({ retphar : true })staticfinalrunning(retphar:Bool = true):String

staticfinalunlinkArchive(archive:String):Bool

@:value({ index : "index.php" })staticfinalwebPhar(?alias:String, index:String = "index.php", ?f404:String, ?mimetypes:NativeAssocArray<String>, ?callable:String ‑> EitherType<String, Bool>):Void

Constructor

new(fname:String, ?flags:Int, ?alias:String)

Methods

addFile(file:String, ?localname:String):Void

addFromString(localname:String, contents:String):Void

compress(compression:Int, ?extension:String):Phar

compressFiles(compression:Int):Void

convertToData(?format:Int, ?compression:Int, ?extension:String):PharData

convertToExecutable(?format:Int, ?compression:Int, ?extension:String):Phar

copy(oldfile:String, newfile:String):Bool

@:value({ overwrite : false })extractTo(pathto:String, ?files:EitherType<String, NativeIndexedArray<String>>, overwrite:Bool = false):Bool

offsetSet(offset:String, value:Dynamic):Void

setDefaultStub(?index:String, ?webindex:String):Bool

setMetadata(metadata:Any):Void

setSignatureAlgorithm(sigtype:Int, ?privatekey:String):Void

@:value({ len : -1 })setStub(stub:String, len:Int = -1):Bool