Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pharfileinfo.getmetadata(3) [php man page]

PHARFILEINFO.GETMETADATA(3)						 1					       PHARFILEINFO.GETMETADATA(3)

PharFileInfo::getMetadata - Returns file-specific meta-data saved with a file

SYNOPSIS
public mixed PharFileInfo::getMetadata (void ) DESCRIPTION
Return meta-data that was saved in the Phar archive's manifest for this file. PARAMETERS
RETURN VALUES
any PHP variable that can be serialized and is stored as meta-data for the file, or NULL if no meta-data is stored. EXAMPLES
Example #1 A PharFileInfo.getMetadata(3) example <?php // make sure it doesn't exist @unlink('brandnewphar.phar'); try { $p = new Phar(dirname(__FILE__) . '/brandnewphar.phar', 0, 'brandnewphar.phar'); $p['file.txt'] = 'hello'; $p['file.txt']->setMetadata(array('user' => 'bill', 'mime-type' => 'text/plain')); var_dump($p['file.txt']->getMetadata()); } catch (Exception $e) { echo 'Could not create/modify brandnewphar.phar: ', $e; } ?> The above example will output: array(2) { ["user"]=> string(4) "bill" ["mime-type"]=> string(10) "text/plain" } SEE ALSO
PharFileInfo.setMetadata(3), PharFileInfo.hasMetadata(3), PharFileInfo.delMetadata(3), Phar.setMetadata(3), Phar.hasMetadata(3), Phar.get- Metadata(3). PHP Documentation Group PHARFILEINFO.GETMETADATA(3)

Check Out this Related Man Page

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)
Man Page

5 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to concatinate two strings

hi all plz let me know how to concatinate two strings. requirement is "I need send a mail with some data available in data.txt and data in variable" ex: abc.txt contains "abcdefghjikmnb" x="QWERTY" now i need concatinate data in file and data in variable x and send a mail. thanks &... (2 Replies)
Discussion started by: balireddy_77
2 Replies

2. UNIX for Dummies Questions & Answers

Searching a text file and assigning it to a variable

Hi Gurus, I am new to unix.I have a requirement as below I have text file like a.txt which contains a.txt hi hello process update status Ok to Proceed no issues good data arrangement My requirement here is i need to read the file and check for the words "OK to Proceed" and if... (2 Replies)
Discussion started by: pssandeep
2 Replies

3. Programming

[PHP] asking how to make plain text database searching system

hi, i want to ask, how to make a plain text database (u need to call and search all the data manually) in PHP. i am going to apply it in UNIX os. anyone have any idea how to do it? most of the data only using mysql while i am forbid to do so. (2 Replies)
Discussion started by: grandios
2 Replies

4. Shell Programming and Scripting

Count per line in txt file

In a txt file called, eso.txt, I have: ...... 3 where process_status_flag = 70 and LISTENER_ID in (930.00, 931.00, 932.00, 933.00, 934.00) 4 group by LISTENER_ID 5 order by LISTENER_ID; LISTENER COUNT ----------... (3 Replies)
Discussion started by: Daniel Gate
3 Replies

5. UNIX for Dummies Questions & Answers

How to grep the exact string / word ?

Hi All, I have a text / log file which contains strings like meta777, 77, meta, 777. Now I want to write a script which can detect a string 'meta#777' in a text file & number of occurence of 'meta', number of #, number 7, 77, 777. I'm using grep -e '77' filename but no luck. It is returning... (5 Replies)
Discussion started by: adc22
5 Replies