Рекурсивный акроним словосочетания «PHP: Hypertext Preprocessor»
Добро пожаловать на форум PHP программистов!
За последние 24 часа нас посетили 17202 программиста и 1833 робота. Сейчас ищут 1696 программистов ...
File_HtAccess::setAuthUserFile()
Вернуться к: File_HtAccess
File_HtAccess::setAuthUserFile()
File_HtAccess::setAuthUserFile() – set the value of authuserfile property
Synopsis
void File_HtAccess::setAuthUserFile ( string $file )
Sets the value of authuserfile property. AuthUserFile is the password file which contains username:password pairs for Basic authentication. You must give full path to the password file in order for it to work.
Parameter
-
string $file - absolute pathname to the password file.
Return value
void
Note
This function can not be called statically.
Example
Using File_HtAccess::setAuthUserFile()
<?php
require_once('File/HtAccess.php');
/* set the password file to /etc/htpasswd */
$fh = new File_HtAccess('.htaccess');
$fh->load();
$fh->setAuthUserFile('/etc/htpasswd');
$fh->save();
/* set the password file to .htpasswd in current working directory */
$file = getcwd() . '/.htpasswd';
$fh = new File_HtAccess('.htaccess');
$fh->load();
$fh->setAuthUserFile($file);
$fh->save();
?>
Вернуться к: File_HtAccess