@@ -10,9 +10,19 @@ directory to be recreated remotely via FTP.
10
10
.. note :: SFTP and SSL FTP protocols are not supported, only standard
11
11
FTP.
12
12
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
+
14
24
Initializing the Class
15
- **********************
25
+ ======================
16
26
17
27
Like most other classes in CodeIgniter, the FTP class is initialized in
18
28
your controller using the $this->load->library function::
@@ -79,53 +89,54 @@ In this example a local directory is mirrored on the server.
79
89
80
90
$this->ftp->close();
81
91
82
- ******************
83
- Function Reference
84
- ******************
92
+ ***************
93
+ Class Reference
94
+ ***************
85
95
86
- $this->ftp->connect()
87
- =====================
96
+ .. class :: CI_FTP
88
97
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()])
92
99
93
- Here is an example showing how you set preferences manually::
100
+ :param array $config: Connection values
101
+ :returns: bool
94
102
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.
96
106
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::
103
108
104
- $this->ftp->connect($config );
109
+ $this->load->library('ftp' );
105
110
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;
108
117
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);
113
119
114
- Available connection options
115
- ****************************
120
+ **Setting FTP Preferences in a Config File **
116
121
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
+ ================== ===================================
126
139
127
- $this->ftp->upload()
128
- ====================
129
140
130
141
Uploads a file to your server. You must supply the local path and the
131
142
remote path, and you can optionally set the mode and permissions.
0 commit comments