PHARFILEINFO.DELMETADATA(3) 1 PHARFILEINFO.DELMETADATA(3)
PharFileInfo::delMetadata - Deletes the metadata of the entry
SYNOPSIS
public bool PharFileInfo::delMetadata (void )
DESCRIPTION
Deletes the metadata of the entry, if any.
PARAMETERS
No parameters.
RETURN VALUES
Returns TRUE if successful, FALSE if the entry had no metadata. As with all functionality that modifies the contents of a phar, the
phar.readonly INI variable must be off in order to succeed if the file is within a Phar archive. Files within PharData archives do not have
this restriction.
ERRORS
/EXCEPTIONS
Throws PharException if errors occurred while flushing changes to disk, and BadMethodCallException if write access is disabled.
EXAMPLES
Example #1
A PharFileInfo.delMetaData(3) example
<?php
try {
$a = new Phar('myphar.phar');
$a['hi'] = 'hi';
var_dump($a['hi']->delMetadata());
$a['hi']->setMetadata('there');
var_dump($a['hi']->delMetadata());
var_dump($a['hi']->delMetadata());
} catch (Exception $e) {
// handle errors
}
?>
The above example will output:
bool(false)
bool(true)
bool(false)
SEE ALSO
PharFileInfo.setMetadata(3), PharFileInfo.hasMetadata(3), PharFileInfo.getMetadata(3), Phar.setMetadata(3), Phar.hasMetadata(3), Phar.get-
Metadata(3).
PHP Documentation Group PHARFILEINFO.DELMETADATA(3)