PHP
Phar

Phar::hasMetadata

Phar::hasMetadata

(PHP >= 5.3.0, PECL phar >= 1.2.0)

Phar::hasMetadata — Returns whether phar has global meta-data

Description

public bool Phar::hasMetadata ( void )

Returns whether phar has global meta-data set.

Parameters

No parameters.

Return Values

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

Examples

Example #1 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() - Returns phar archive meta-data

  • Phar::setMetadata() - Sets phar archive meta-data

  • Phar::delMetadata() - Deletes the global metadata of the phar

← Phar::getVersion

Phar::interceptFileFuncs →

© 1997–2017 The PHP Documentation Group

Licensed under the Creative Commons Attribution License v3.0 or later.

https://secure.php.net/manual/en/phar.hasmetadata.php