summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authoradmin <devnull@localhost>2006-10-27 09:41:28 +0200
committeradmin <devnull@localhost>2006-10-27 09:41:28 +0200
commit631f17b88124619dd27a04509970da155a3fc1b7 (patch)
treec84802140bb4efd2280f71efdc768cc568920db2 /system
parent865b4b32ff813156c577e336114ae67b4be1a259 (diff)
Diffstat (limited to 'system')
-rw-r--r--system/libraries/Ftp.php32
1 files changed, 26 insertions, 6 deletions
diff --git a/system/libraries/Ftp.php b/system/libraries/Ftp.php
index 6c1bad8e1..a0c6895bf 100644
--- a/system/libraries/Ftp.php
+++ b/system/libraries/Ftp.php
@@ -31,7 +31,6 @@ class CI_FTP {
var $password = '';
var $port = 21;
var $passive = TRUE;
- var $secure = FALSE;
var $debug = FALSE;
var $conn_id;
@@ -80,11 +79,18 @@ class CI_FTP {
* FTP Connect
*
* @access public
+ * @param array the connection values
+ * @param bool whether to use a secure or standard connection
* @return bool
*/
- function connect()
- {
- $method = ($this->secure == FALSE) ? 'ftp_connect' : 'ftp_ssl_connect';
+ function connect($config = array(), $secure = FALSE)
+ {
+ if (count($config) > 0)
+ {
+ $this->initialize($config);
+ }
+
+ $method = ($secure == FALSE) ? 'ftp_connect' : 'ftp_ssl_connect';
if (FALSE === ($this->conn_id = @$method($this->hostname, $this->port)))
{
@@ -112,6 +118,20 @@ class CI_FTP {
return TRUE;
}
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Secure FTP Connect
+ *
+ * @access public
+ * @param array the connection values
+ * @return bool
+ */
+ function sconnect($config = array())
+ {
+ return $this->connect($config, TRUE);
+ }
// --------------------------------------------------------------------
@@ -297,8 +317,8 @@ class CI_FTP {
* Read a directory and recreate it remotely
*
* This function recursively reads a folder and everything it contains (including
- * sub-folders) and creates a mirror via FTP based on it. Whatever directory structure
- * is in the original file path will be recreated in the zip file.
+ * sub-folders) and creates a mirror via FTP based on it. Whatever the directory structure
+ * of the original file path will be recreated on the server.
*
* @access public
* @param string path to source with trailing slash