File_HtAccess::getRequire()
Synopsis
array File_HtAccess::getRequire (
)
Описание
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.
Замечание
This function can not be called statically.
Пример
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 */
?>