Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
1c054e4b
Commit
1c054e4b
authored
Apr 20, 2010
by
webchick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#727282
by heyrocker, jhodgdon: Document hook_filetransfer_backends().
parent
7bb6753e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
0 deletions
+47
-0
modules/system/system.api.php
modules/system/system.api.php
+47
-0
No files found.
modules/system/system.api.php
View file @
1c054e4b
...
...
@@ -3232,6 +3232,53 @@ function hook_countries_alter(&$countries) {
// Quebec has seceded from Canada. Add to country list.
$countries
[
'QC'
]
=
'Quebec'
;
}
/**
* Provide information on available file transfer backends.
*
* File transfer backends are used by modules to transfer files from remote
* locations to Drupal sites. For instance, update.module uses a file transfer
* backend to download new versions of modules and themes from drupal.org.
*
* @return
* An associative array of information about the file transfer backend(s).
* being provided. This array can contain the following keys:
* - title: Title of the backend to be shown to the end user.
* - class: Name of the PHP class which implements this backend.
* - settings_form: An optional callback function that provides additional
* configuration information required by this backend (for instance a port
* number.)
* - weight: Controls what order the backends are presented to the user.
*
* @see authorize.php
* @see FileTransfer
*/
function
hook_filetransfer_backends
()
{
$backends
=
array
();
// This is the default, will be available on most systems.
if
(
function_exists
(
'ftp_connect'
))
{
$backends
[
'ftp'
]
=
array
(
'title'
=>
t
(
'FTP'
),
'class'
=>
'FileTransferFTP'
,
'settings_form'
=>
'system_filetransfer_backend_form_ftp'
,
'weight'
=>
0
,
);
}
// SSH2 lib connection is only available if the proper PHP extension is
// installed.
if
(
function_exists
(
'ssh2_connect'
))
{
$backends
[
'ssh'
]
=
array
(
'title'
=>
t
(
'SSH'
),
'class'
=>
'FileTransferSSH'
,
'settings_form'
=>
'system_filetransfer_backend_form_ssh'
,
'weight'
=>
20
,
);
}
return
$backends
;
}
/**
* @} End of "addtogroup hooks".
*/
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment