summaryrefslogtreecommitdiffstats
path: root/user_guide_src
diff options
context:
space:
mode:
authorDerek Jones <derek.jones@ellislab.com>2013-08-07 00:38:21 +0200
committerDerek Jones <derek.jones@ellislab.com>2013-08-07 00:38:26 +0200
commitb799a0b3f09238fe46892b811025e7bf2ac81b19 (patch)
treeaec0a40495813385b5da13ea7c8d75ca0ff00b3e /user_guide_src
parentc0b55d53004105bca7f7979931d46fd848e21be0 (diff)
Partial update to FTP docs
Diffstat (limited to 'user_guide_src')
-rw-r--r--user_guide_src/source/libraries/ftp.rst87
1 files changed, 49 insertions, 38 deletions
diff --git a/user_guide_src/source/libraries/ftp.rst b/user_guide_src/source/libraries/ftp.rst
index 05a3fdcc8..fd82590b9 100644
--- a/user_guide_src/source/libraries/ftp.rst
+++ b/user_guide_src/source/libraries/ftp.rst
@@ -10,9 +10,19 @@ directory to be recreated remotely via FTP.
.. note:: SFTP and SSL FTP protocols are not supported, only standard
FTP.
-**********************
+.. contents::
+ :local:
+
+.. raw:: html
+
+ <div class="custom-index container"></div>
+
+**************************
+Working with the FTP Class
+**************************
+
Initializing the Class
-**********************
+======================
Like most other classes in CodeIgniter, the FTP class is initialized in
your controller using the $this->load->library function::
@@ -79,53 +89,54 @@ In this example a local directory is mirrored on the server.
$this->ftp->close();
-******************
-Function Reference
-******************
+***************
+Class Reference
+***************
-$this->ftp->connect()
-=====================
+.. class:: CI_FTP
-Connects and logs into to the FTP server. Connection preferences are set
-by passing an array to the function, or you can store them in a config
-file.
+ .. method:: connect([$config = array()])
-Here is an example showing how you set preferences manually::
+ :param array $config: Connection values
+ :returns: bool
- $this->load->library('ftp');
+ Connects and logs into to the FTP server. Connection preferences are set
+ by passing an array to the function, or you can store them in a config
+ file.
- $config['hostname'] = 'ftp.example.com';
- $config['username'] = 'your-username';
- $config['password'] = 'your-password';
- $config['port'] = 21;
- $config['passive'] = FALSE;
- $config['debug'] = TRUE;
+ Here is an example showing how you set preferences manually::
- $this->ftp->connect($config);
+ $this->load->library('ftp');
-Setting FTP Preferences in a Config File
-****************************************
+ $config['hostname'] = 'ftp.example.com';
+ $config['username'] = 'your-username';
+ $config['password'] = 'your-password';
+ $config['port'] = 21;
+ $config['passive'] = FALSE;
+ $config['debug'] = TRUE;
-If you prefer you can store your FTP preferences in a config file.
-Simply create a new file called the ftp.php, add the $config array in
-that file. Then save the file at config/ftp.php and it will be used
-automatically.
+ $this->ftp->connect($config);
-Available connection options
-****************************
+ **Setting FTP Preferences in a Config File**
-- **hostname** - the FTP hostname. Usually something like:
- ftp.example.com
-- **username** - the FTP username.
-- **password** - the FTP password.
-- **port** - The port number. Set to 21 by default.
-- **debug** - TRUE/FALSE (boolean). Whether to enable debugging to
- display error messages.
-- **passive** - TRUE/FALSE (boolean). Whether to use passive mode.
- Passive is set automatically by default.
+ If you prefer you can store your FTP preferences in a config file.
+ Simply create a new file called the ftp.php, add the $config array in
+ that file. Then save the file at config/ftp.php and it will be used
+ automatically.
+
+ **Available connection options**
+
+ ================== ===================================
+ Option Name Description
+ ================== ===================================
+ **hostname** the FTP hostname. Usually something like: ftp.example.com
+ **username** the FTP username
+ **password** the FTP password
+ **port** The port number. Set to 21 by default.
+ **debug** TRUE/FALSE (boolean). Whether to enable debugging to display error messages.
+ **passive** TRUE/FALSE (boolean). Whether to use passive mode. Passive is set automatically by default.
+ ================== ===================================
-$this->ftp->upload()
-====================
Uploads a file to your server. You must supply the local path and the
remote path, and you can optionally set the mode and permissions.