File_HtAccess::getRequire()

File_HtAccess::getRequire() – get the value(s) of require property

Synopsis

array File_HtAccess::getRequire ( )

Description

Get the value(s) of require property as an array. Require property contains the usernames or groups users who are allowed to access protected resources. Value valid-user means all users listed in password file are allowed to access.

Parameter

  • string $type - if 'string' return value will be a string with usernames separated by a space character. Otherwise return value will be an array(). Defaults to an array.

Return value

mixed string or array depending on $type parameter.

Note

This function can not be called statically.

Example

Using File_HtAccess::getrequire()

<?php
require_once('File/HtAccess.php');

/* add user tuupola and viemero to list of users to be granted access */
$fh = new File_HtAccess('.htaccess');
$fh->addRequire('tuupola');
$fh->addRequire('viemero');

$require1 $fh->getRequire();
$require2 $fh->getRequire('string');

print_r($require1);

/* Array              */
/* (                  */
/*    [0] => tuupola  */
/*    [1] => viemero  */
/* )                  */

print_r($require2);

/* tuupola viemero    */

?>
remove a value from require property (Previous) set the values of objects properties (Next)
Last updated: Sat, 16 Feb 2019 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

There are no user contributed notes for this page.