Skip to content

Commit b799a0b

Browse files
author
Derek Jones
committed
Partial update to FTP docs
1 parent c0b55d5 commit b799a0b

File tree

1 file changed

+49
-38
lines changed
  • user_guide_src/source/libraries

1 file changed

+49
-38
lines changed

user_guide_src/source/libraries/ftp.rst

Lines changed: 49 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,19 @@ directory to be recreated remotely via FTP.
1010
.. note:: SFTP and SSL FTP protocols are not supported, only standard
1111
FTP.
1212

13-
**********************
13+
.. contents::
14+
:local:
15+
16+
.. raw:: html
17+
18+
<div class="custom-index container"></div>
19+
20+
**************************
21+
Working with the FTP Class
22+
**************************
23+
1424
Initializing the Class
15-
**********************
25+
======================
1626

1727
Like most other classes in CodeIgniter, the FTP class is initialized in
1828
your controller using the $this->load->library function::
@@ -79,53 +89,54 @@ In this example a local directory is mirrored on the server.
7989

8090
$this->ftp->close();
8191

82-
******************
83-
Function Reference
84-
******************
92+
***************
93+
Class Reference
94+
***************
8595

86-
$this->ftp->connect()
87-
=====================
96+
.. class:: CI_FTP
8897

89-
Connects and logs into to the FTP server. Connection preferences are set
90-
by passing an array to the function, or you can store them in a config
91-
file.
98+
.. method:: connect([$config = array()])
9299

93-
Here is an example showing how you set preferences manually::
100+
:param array $config: Connection values
101+
:returns: bool
94102

95-
$this->load->library('ftp');
103+
Connects and logs into to the FTP server. Connection preferences are set
104+
by passing an array to the function, or you can store them in a config
105+
file.
96106

97-
$config['hostname'] = 'ftp.example.com';
98-
$config['username'] = 'your-username';
99-
$config['password'] = 'your-password';
100-
$config['port'] = 21;
101-
$config['passive'] = FALSE;
102-
$config['debug'] = TRUE;
107+
Here is an example showing how you set preferences manually::
103108

104-
$this->ftp->connect($config);
109+
$this->load->library('ftp');
105110

106-
Setting FTP Preferences in a Config File
107-
****************************************
111+
$config['hostname'] = 'ftp.example.com';
112+
$config['username'] = 'your-username';
113+
$config['password'] = 'your-password';
114+
$config['port'] = 21;
115+
$config['passive'] = FALSE;
116+
$config['debug'] = TRUE;
108117

109-
If you prefer you can store your FTP preferences in a config file.
110-
Simply create a new file called the ftp.php, add the $config array in
111-
that file. Then save the file at config/ftp.php and it will be used
112-
automatically.
118+
$this->ftp->connect($config);
113119

114-
Available connection options
115-
****************************
120+
**Setting FTP Preferences in a Config File**
116121

117-
- **hostname** - the FTP hostname. Usually something like:
118-
ftp.example.com
119-
- **username** - the FTP username.
120-
- **password** - the FTP password.
121-
- **port** - The port number. Set to 21 by default.
122-
- **debug** - TRUE/FALSE (boolean). Whether to enable debugging to
123-
display error messages.
124-
- **passive** - TRUE/FALSE (boolean). Whether to use passive mode.
125-
Passive is set automatically by default.
122+
If you prefer you can store your FTP preferences in a config file.
123+
Simply create a new file called the ftp.php, add the $config array in
124+
that file. Then save the file at config/ftp.php and it will be used
125+
automatically.
126+
127+
**Available connection options**
128+
129+
================== ===================================
130+
Option Name Description
131+
================== ===================================
132+
**hostname** the FTP hostname. Usually something like: ftp.example.com
133+
**username** the FTP username
134+
**password** the FTP password
135+
**port** The port number. Set to 21 by default.
136+
**debug** TRUE/FALSE (boolean). Whether to enable debugging to display error messages.
137+
**passive** TRUE/FALSE (boolean). Whether to use passive mode. Passive is set automatically by default.
138+
================== ===================================
126139

127-
$this->ftp->upload()
128-
====================
129140

130141
Uploads a file to your server. You must supply the local path and the
131142
remote path, and you can optionally set the mode and permissions.

0 commit comments

Comments
 (0)