Automatic_Upgrader_Skin::request_filesystem_credentials()
最后更新于:2021-11-25 19:11:44
Automatic_Upgrader_Skin::request_filesystem_credentials( bool|GC_Error$error=false, string$context=”, bool$allow_relaxed_file_ownership=false)Determines whether the upgrader needs FTP/SSH details in order to connect to the filesystem.
参数
- $error
-
(bool|GC_Error) (Optional) Whether the current request has failed to connect, or an error object.
Default value: false
- $context
-
(string) (Optional) Full path to the directory that is tested for being writable.
Default value: ”
- $allow_relaxed_file_ownership
-
(bool) (Optional) Whether to allow Group/World writable.
Default value: false
响应
(bool) True on success, false on failure.
源文件
文件: gc-admin/includes/class-automatic-upgrader-skin.php
public function request_filesystem_credentials( $error = false, $context = '', $allow_relaxed_file_ownership = false ) {
if ( $context ) {
$this->options['context'] = $context;
}
/*
* TODO: Fix up request_filesystem_credentials(), or split it, to allow us to request a no-output version.
* This will output a credentials form in event of failure. We don't want that, so just hide with a buffer.
*/
ob_start();
$result = parent::request_filesystem_credentials( $error, $context, $allow_relaxed_file_ownership );
ob_end_clean();
return $result;
}