File_HtAccess
[ class tree: File_HtAccess ] [ index: File_HtAccess ] [ all elements ]

Class: File_HtAccess

Source Location: /File_HtAccess-1.2.0/HtAccess.php

Class Overview


Class for manipulating .htaccess files


Author(s):

Version:

  • 1.0.0

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 78]
Class for manipulating .htaccess files

A class which provided common methods to manipulate Apache / NCSA style .htaccess files.

Example 1 (modifying existing file):

$h = new File_HtAccess('.htaccess'); $h->load(); $h->setRequire('valid-user'); $h->save();

Example 2 (modifying existing file):

$h = new File_HtAccess('.htaccess'); $h->load(); $h->addRequire('newuser'); $h->save();

Example 3 (creating a new file):

$params['authname'] = 'Private'; $params['authtype'] = 'Basic'; $params['authuserfile'] = '/path/to/.htpasswd'; $params['authgroupfile'] = '/path/to/.htgroup'; $params['require'] = array('group', 'admins');

$h = new File_HtAccess('/path/to/.htaccess', $params); $h->save();



[ Top ]


Class Variables

$additional = array()

[line 88]


Type:   mixed


[ Top ]

$authdigestfile =

[line 85]


Type:   mixed


[ Top ]

$authdigestgroupfile =

[line 86]


Type:   mixed


[ Top ]

$authgroupfile =

[line 84]


Type:   mixed


[ Top ]

$authname =

[line 81]


Type:   mixed


[ Top ]

$authtype =

[line 82]


Type:   mixed


[ Top ]

$authuserfile =

[line 83]


Type:   mixed


[ Top ]

$file =

[line 80]


Type:   mixed


[ Top ]

$require = array()

[line 87]


Type:   mixed


[ Top ]



Method Detail

File_HtAccess (Constructor)   [line 99]

object File_HtAccess File_HtAccess( [string $file = '.htaccess'], [array $params = ''])

Constructor
  • Access: public

Parameters:

string   $file   — 
array   $params   — 

[ Top ]

addAdditional   [line 311]

void addAdditional( [string $additional = ''])

Add a value to additional property
  • Access: public

Parameters:

string   $additional   — 

[ Top ]

addRequire   [line 267]

void addRequire( string $require)

Add a value to require property
  • Access: public

Parameters:

string   $require   — 

[ Top ]

delRequire   [line 285]

void delRequire( string $require)

Delete a value from require property
  • Access: public

Parameters:

string   $require   — 

[ Top ]

getAdditional   [line 418]

mixed getAdditional( [string $type = ''])

Get the value(s) of additional property
  • Return: string or array, defaults to an array
  • Access: public

Parameters:

string   $type   —  whether to return an array or string

[ Top ]

getAuthDigestFile   [line 378]

string getAuthDigestFile( )

Get the value of authdigestfile property
  • Access: public

[ Top ]

getAuthDigestGroupFile   [line 389]

string getAuthDigestGroupFile( )

Get the value of authdigestgroupfile property
  • Access: public

[ Top ]

getAuthGroupFile   [line 367]

string getAuthGroupFile( )

Get the value of authgroupfile property
  • Access: public

[ Top ]

getAuthName   [line 333]

string getAuthName( )

Get the value of authname property
  • Access: public

[ Top ]

getAuthType   [line 344]

string getAuthType( )

Get the value of authtype property
  • Access: public

[ Top ]

getAuthUserFile   [line 355]

string getAuthUserFile( )

Get the value of authuserfile property
  • Access: public

[ Top ]

getContent   [line 472]

string getContent( )

Returns the .htaccess File content
  • Access: public

[ Top ]

getFile   [line 434]

string getFile( )

Get the value of file property
  • Access: public

[ Top ]

getRequire   [line 401]

mixed getRequire( [string $type = ''])

Get the value(s) of require property
  • Return: string or array, defaults to an array
  • Access: public

Parameters:

string   $type   —  whether to return an array or string

[ Top ]

load   [line 113]

mixed load( )

Load the given .htaccess file
  • Return: true on success, PEAR_Error on failure
  • Access: public

[ Top ]

save   [line 446]

mixed save( )

Save the .htaccess file
  • Return: true on success, PEAR_Error on failure
  • See: PEAR_Error
  • Access: public

[ Top ]

setAdditional   [line 300]

void setAdditional( [array $additional = ''])

Set the value of additional property

Additional property is used for all the extra things in .htaccess file which don't have specific accessor method for them.

  • Access: public

Parameters:

array   $additional   — 

[ Top ]

setAuthDigestFile   [line 227]

void setAuthDigestFile( [string $file = ''])

Set the value of authdigestfile property
  • Access: public

Parameters:

string   $file   — 

[ Top ]

setAuthDigestGroupFile   [line 238]

void setAuthDigestGroupFile( [string $file = ''])

Set the value of authdigestgroupfile property
  • Access: public

Parameters:

string   $file   — 

[ Top ]

setAuthGroupFile   [line 216]

void setAuthGroupFile( [string $file = ''])

Set the value of authgroupfile property
  • Access: public

Parameters:

string   $file   — 

[ Top ]

setAuthName   [line 183]

void setAuthName( [string $name = 'Restricted'])

Set the value of authname property
  • Access: public

Parameters:

string   $name   — 

[ Top ]

setAuthType   [line 194]

void setAuthType( [string $type = 'Basic'])

Set the value of authtype propery
  • Access: public

Parameters:

string   $type   — 

[ Top ]

setAuthUserFile   [line 205]

void setAuthUserFile( [string $file = ''])

Set the value of authuserfile propery
  • Access: public

Parameters:

string   $file   — 

[ Top ]

setFile   [line 322]

void setFile( file $file)

Set the value of file property
  • Access: public

Parameters:

file   $file   — 

[ Top ]

setProperties   [line 167]

void setProperties( array $params)

Set class properties
  • Access: public

Parameters:

array   $params   — 

[ Top ]

setRequire   [line 253]

void setRequire( [mixed $require = ''])

Set the value of require property

Parameter can be given as an array or string. If given as a string the value will be exploded in to an array by using space as a separator.

  • Access: public

Parameters:

mixed   $require   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:49:14 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.