Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pharfileinfo.chmod(3) [php man page]

PHARFILEINFO.CHMOD(3)							 1						     PHARFILEINFO.CHMOD(3)

PharFileInfo::chmod - Sets file-specific permission bits

SYNOPSIS
public void PharFileInfo::chmod (int $permissions) DESCRIPTION
PharFileInfo.chmod(3) allows setting of the executable file permissions bit, as well as read-only bits. Writeable bits are ignored, and set at runtime based on the phar.readonly INI variable. 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. PARAMETERS
o $permissions - permissions (see chmod(3)) RETURN VALUES
No value is returned. EXAMPLES
Example #1 A PharFileInfo.chmod(3) example <?php // make sure it doesn't exist @unlink('brandnewphar.phar'); try { $p = new Phar('brandnewphar.phar', 0, 'brandnewphar.phar'); $p['file.sh'] = '#!/usr/local/lib/php <?php echo "hi"; ?>'; // set executable bit $p['file.sh']->chmod(0555); var_dump($p['file.sh']->isExecutable()); } catch (Exception $e) { echo 'Could not create/modify phar: ', $e; } ?> The above example will output: bool(true) PHP Documentation Group PHARFILEINFO.CHMOD(3)

Check Out this Related 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)
Man Page

14 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

permissions

Can someone pleas tell me if there is something funny when it comes to unix permissions and PHP. When php creates a file in unix the owner is nobody...does this raise any issues, and if it does could someone please tell me a web site where I could read more about this. Thanks alot. John (2 Replies)
Discussion started by: jmg5
2 Replies

2. UNIX for Dummies Questions & Answers

CHMOD settings

Right, I'm really new to the UNIX stuff, and the main reason for posting is as follows: I am attempting to install postnuke on the local council webserver. for web server stats search for http://www.haybridge.worcs.sch.uk here and I am being asked to change the CHMOD settings for two of the... (3 Replies)
Discussion started by: womble
3 Replies

3. UNIX for Dummies Questions & Answers

directory permissions and CHMOD

I am working on a new UNIX box that has been delivered to us, and noticed that the /home directory has 555 permissions on it (dr-xr-xr-x). Any attempt to create write permissions fails on this directory (such as chmod 777), responding only with a message; chmod: WARNING: can't change home ... (3 Replies)
Discussion started by: ncarmstrong
3 Replies

4. UNIX for Dummies Questions & Answers

chmod...

Hey everyone, I was wondering if there was a quicker way to chmod a lot of files than doing what im currently doing. At the moment, im doing chmod 777 *filename* - but I have a lot of files, sub-directories, sub-files etc etc. And at the moment I see I have to chmod every single file... (3 Replies)
Discussion started by: mo0ness
3 Replies

5. UNIX for Advanced & Expert Users

chmod (permissions) * not working on remote server

Hi gurus ! I am developing a FTP script which will copy all the files from one server to another server and then I need to use CHMOD 755 * to set permissions of all the files just copied to the remote server. mput * chmod 755 * CHMOD gives me an error CHMOD works fine If I specify... (3 Replies)
Discussion started by: sdlayeeq
3 Replies

6. Solaris

help in changing the access level for directories

Hi all, can some one help me in chmod command, and let me know the various combinations for this command. for : eg chmod -R 777 <dir names> this gives all rights to all but i want the specific access levels kindly help me out in this issue. Thank you, lakshmanan (2 Replies)
Discussion started by: lakshmananl
2 Replies

7. UNIX for Dummies Questions & Answers

Need Help Understanding a Unix Command

Trying to install something. Can someone explain what this means? chmod -R a+r . chmod -R a+w logo.gif tempdir/ templates_c/ I recognize that file permissions are being changed (chmod), but beyond that, it's Greek to me. (6 Replies)
Discussion started by: chris86
6 Replies

8. Shell Programming and Scripting

change file type to hidden using chmod command

I want to make a hidden file with chmod command. Example: I have a file name inputfile.txt -rw-r--r-- 1 xxxxxx xxxxxx 1388 Sep 12 05:41 inputfile.txt I want to hide that file using chmod command. Please tell me if it is possible or there is some other way to do this. Thanks... (2 Replies)
Discussion started by: rinku
2 Replies

9. Shell Programming and Scripting

FIND/CHMOD combined

I am trying to change permission for all subdirectories and files inside folder1 so this is what i came with after many seraches on the internet. man find and man chmod mirc and few articles. find .public_html/folder1 -print0 | xargs -0 chmod 777 what's wrong with this command? it is FTP... (33 Replies)
Discussion started by: smoother
33 Replies

10. Solaris

chmod -R 777 in /usr Solaris 9 = Major Screwup

Hello Everyone: One of our admins here accidently ran chmod -R 777 in the /usr folder on a V440 running Solaris 9. After that no one could run any command and could not login. I fixed most of the things by re-restricting some rights and applying the correct rights. Now there is a problem... (3 Replies)
Discussion started by: muntaser_zaheer
3 Replies

11. UNIX for Dummies Questions & Answers

a permission question

what permissions are needed in order to run an executable file if you ae not the ownner? read, and excute? would it be chmod 717? (5 Replies)
Discussion started by: trob
5 Replies

12. Linux

chmod will not drwxrw----

If I: chmod 740 Documents/ Documents/ = drwxr----- If I: chmod 750 Documents/ Documents/ = drwxr-x--- How does that work? I want to achieve drwxrw---- (5 Replies)
Discussion started by: Kolusion
5 Replies

13. UNIX for Dummies Questions & Answers

chmod ug-s /System/Library/CoreServices/RemoteManagement/ARDAgent.app/.... NOT PERMITTED

After much reflecting I decided that I don't want to have a remote managemente in my computer and I digited in Terminal from the Administrator Account: chmod ug-s /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/MacOS/ARDAgent But the answer is: NOT PERMITTED Why? Is it not... (6 Replies)
Discussion started by: Vera
6 Replies

14. UNIX for Dummies Questions & Answers

The professional way to use chmod ?

Oracle Linux 6.4 with bash Question from a beginner To change permissions using chmod, I can use 2 methods. Since I don't know the terminology, I am calling them Method1 and Method2. In the below example, both Method1 and Method2 do the same thing. Which one is you favourite method ? #... (5 Replies)
Discussion started by: omega3
5 Replies