Alter permissions on a *nix file system.

The system optionally will call clearstatcache() and it is recommended that you are familiar with this PHP method: http://php.net/manual/en/function.clearstatcache.php. Only tested on Centos5. May require a system administrator to give some permissions on your server. This is beyond the scope of this documentation.

package dstruct_filetools
todo Test and document on Ubuntu
todo Some permissions changes were needed to allow this to work. Test and document.

 Methods

Class constructor.

__construct(string $path) 

Parameters

$path

string

The path to the file or folder of interest

Exceptions

\DStructGeneralException

Update the permissions.

change(array $options) 

$options is an array with the optional elements: chmod = Octal representation of the permsission e.g. 0755 not 755 group = Group name or number owner = Owner name or number If no options are provided, the defaults in Prefs are used.

link http://php.net/manual/en/function.chmod.php

Parameters

$options

array

See main text for info.

Update the group.

changeGroup(string $setting) 

$setting is the name or number of the Group to change to. If there is no setting provided, the default in Prefs is used.

Parameters

$setting

string

chmod the file / folder.

changeMod(\octal $setting) 

Parameters

$setting

\octal

e.g. 0755 not 755

Exceptions

\DStructGeneralException

Update the owner.

changeOwner(string $setting) 

Parameters

$setting

string

Name or number of new owner

Get the current Group of file / folder.

getGroup(boolean $refreshcache) : integer
link http://php.net/manual/en/function.clearstatcache.php

Parameters

$refreshcache

boolean

Clear the stat cache?

Returns

integerThe number of the current Group

Get the current Owner of file / folder.

getOwner(boolean $refreshcache) : integer
link http://php.net/manual/en/function.clearstatcache.php

Parameters

$refreshcache

boolean

Clear the stat cache?

Returns

integerThe number of the current Owner

Refresh the info about the file / folder.

loadStatInfo(boolean $refreshcache) 
link http://php.net/manual/en/function.clearstatcache.php

Parameters

$refreshcache

boolean

Call clearstatcache()?

 Properties

 

$path : string