Phar::hasMetadata

(PHP >= 5.3.0, PECL phar >= 1.2.0)
Returns whether phar has global meta-data
public bool Phar::hasMetadata ( void )

Returns whether phar has global meta-data set.

Returns:

Returns TRUE if meta-data has been set, and FALSE if not.

Examples:
A Phar::hasMetadata() example
<?php
try {
    $phar = new Phar('myphar.phar');
    var_dump($phar->hasMetadata());
    $phar->setMetadata(array('thing' => 'hi'));
    var_dump($phar->hasMetadata());
    $phar->delMetadata();
    var_dump($phar->hasMetadata());
} catch (Exception $e) {
    // handle error
}
?>

The above example will output:

bool(false)
bool(true)
bool(false)
See also:

Phar::getMetadata() -

Phar::setMetadata() -

Phar::delMetadata() -

doc_php
2016-02-24 15:55:15
Comments
Leave a Comment

Please login to continue.