From 5645479c622eb36cf9869797896dc0921568c4a9 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 17 May 2012 14:32:19 +0300 Subject: Clean up the libraries --- system/libraries/Ftp.php | 2 -- 1 file changed, 2 deletions(-) (limited to 'system/libraries/Ftp.php') diff --git a/system/libraries/Ftp.php b/system/libraries/Ftp.php index 8aa1650d2..3cfe1b2b6 100644 --- a/system/libraries/Ftp.php +++ b/system/libraries/Ftp.php @@ -44,7 +44,6 @@ class CI_FTP { public $debug = FALSE; public $conn_id = FALSE; - public function __construct($config = array()) { if (count($config) > 0) @@ -539,7 +538,6 @@ class CI_FTP { return FALSE; } - // -------------------------------------------------------------------- /** -- cgit v1.2.3-24-g4f1b From d261b1e89c3d4d5191036d5a5660ef6764e593a0 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Sat, 2 Jun 2012 11:12:16 +0100 Subject: Replaced `==` with `===` and `!=` with `!==` in /system/libraries --- system/libraries/Ftp.php | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'system/libraries/Ftp.php') diff --git a/system/libraries/Ftp.php b/system/libraries/Ftp.php index 3cfe1b2b6..461e884fb 100644 --- a/system/libraries/Ftp.php +++ b/system/libraries/Ftp.php @@ -93,7 +93,7 @@ class CI_FTP { if (FALSE === ($this->conn_id = @ftp_connect($this->hostname, $this->port))) { - if ($this->debug == TRUE) + if ($this->debug === TRUE) { $this->_error('ftp_unable_to_connect'); } @@ -102,7 +102,7 @@ class CI_FTP { if ( ! $this->_login()) { - if ($this->debug == TRUE) + if ($this->debug === TRUE) { $this->_error('ftp_unable_to_login'); } @@ -110,7 +110,7 @@ class CI_FTP { } // Set passive mode if needed - if ($this->passive == TRUE) + if ($this->passive === TRUE) { ftp_pasv($this->conn_id, TRUE); } @@ -141,7 +141,7 @@ class CI_FTP { { if ( ! is_resource($this->conn_id)) { - if ($this->debug == TRUE) + if ($this->debug === TRUE) { $this->_error('ftp_no_connection'); } @@ -167,7 +167,7 @@ class CI_FTP { */ public function changedir($path = '', $supress_debug = FALSE) { - if ($path == '' OR ! $this->_is_conn()) + if ($path === '' OR ! $this->_is_conn()) { return FALSE; } @@ -176,7 +176,7 @@ class CI_FTP { if ($result === FALSE) { - if ($this->debug == TRUE && $supress_debug == FALSE) + if ($this->debug === TRUE && $supress_debug === FALSE) { $this->_error('ftp_unable_to_changedir'); } @@ -197,7 +197,7 @@ class CI_FTP { */ public function mkdir($path = '', $permissions = NULL) { - if ($path == '' OR ! $this->_is_conn()) + if ($path === '' OR ! $this->_is_conn()) { return FALSE; } @@ -206,7 +206,7 @@ class CI_FTP { if ($result === FALSE) { - if ($this->debug == TRUE) + if ($this->debug === TRUE) { $this->_error('ftp_unable_to_makdir'); } @@ -260,7 +260,7 @@ class CI_FTP { if ($result === FALSE) { - if ($this->debug == TRUE) + if ($this->debug === TRUE) { $this->_error('ftp_unable_to_upload'); } @@ -307,7 +307,7 @@ class CI_FTP { if ($result === FALSE) { - if ($this->debug == TRUE) + if ($this->debug === TRUE) { $this->_error('ftp_unable_to_download'); } @@ -338,9 +338,9 @@ class CI_FTP { if ($result === FALSE) { - if ($this->debug == TRUE) + if ($this->debug === TRUE) { - $this->_error('ftp_unable_to_' . ($move == FALSE ? 'rename' : 'move')); + $this->_error('ftp_unable_to_' . ($move === FALSE ? 'rename' : 'move')); } return FALSE; } @@ -381,7 +381,7 @@ class CI_FTP { if ($result === FALSE) { - if ($this->debug == TRUE) + if ($this->debug === TRUE) { $this->_error('ftp_unable_to_delete'); } @@ -429,7 +429,7 @@ class CI_FTP { if ($result === FALSE) { - if ($this->debug == TRUE) + if ($this->debug === TRUE) { $this->_error('ftp_unable_to_delete'); } @@ -459,7 +459,7 @@ class CI_FTP { if ($result === FALSE) { - if ($this->debug == TRUE) + if ($this->debug === TRUE) { $this->_error('ftp_unable_to_chmod'); } -- cgit v1.2.3-24-g4f1b From 625c43a2f451191d0195f6311dd3a7ea94439988 Mon Sep 17 00:00:00 2001 From: vlakoff Date: Wed, 27 Jun 2012 03:28:55 +0200 Subject: Fix a PHPDoc error in FTP Class The second parameter of the "chmod" method is an octal integer. --- system/libraries/Ftp.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries/Ftp.php') diff --git a/system/libraries/Ftp.php b/system/libraries/Ftp.php index 461e884fb..76f5e151a 100644 --- a/system/libraries/Ftp.php +++ b/system/libraries/Ftp.php @@ -445,7 +445,7 @@ class CI_FTP { * Set file permissions * * @param string the file path - * @param string the permissions + * @param int the permissions * @return bool */ public function chmod($path, $perm) -- cgit v1.2.3-24-g4f1b From 5fd3ae8d33a4f5d3159b86683b9a670e973a63f5 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 24 Oct 2012 14:55:35 +0300 Subject: [ci skip] style and phpdoc-related changes (rel #1295) --- system/libraries/Ftp.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'system/libraries/Ftp.php') diff --git a/system/libraries/Ftp.php b/system/libraries/Ftp.php index 76f5e151a..ae85fdf37 100644 --- a/system/libraries/Ftp.php +++ b/system/libraries/Ftp.php @@ -44,6 +44,12 @@ class CI_FTP { public $debug = FALSE; public $conn_id = FALSE; + /** + * Constructor + * + * @param array $config = array() + * @return void + */ public function __construct($config = array()) { if (count($config) > 0) @@ -474,6 +480,7 @@ class CI_FTP { /** * FTP List files in the specified directory * + * @param string $path = '.' * @return array */ public function list_files($path = '.') -- cgit v1.2.3-24-g4f1b From c5536aac5752054f7f76e448d58b86407d8f574e Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 1 Nov 2012 17:33:58 +0200 Subject: Manually apply PR #1594 (fixing phpdoc page-level generation/warnings) Also partially fixes issue #1295, fixes inconsistencies in some page-level docblocks and adds include checks in language files. --- system/libraries/Ftp.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'system/libraries/Ftp.php') diff --git a/system/libraries/Ftp.php b/system/libraries/Ftp.php index ae85fdf37..b9954c7f2 100644 --- a/system/libraries/Ftp.php +++ b/system/libraries/Ftp.php @@ -1,4 +1,4 @@ - Date: Thu, 1 Nov 2012 22:56:26 +0200 Subject: [ci skip] DocBlocks for Email, Ftp, Unit_test and Javascript libraries Partially fixes issue #1295 --- system/libraries/Ftp.php | 103 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 74 insertions(+), 29 deletions(-) (limited to 'system/libraries/Ftp.php') diff --git a/system/libraries/Ftp.php b/system/libraries/Ftp.php index b9954c7f2..60c03b5ad 100644 --- a/system/libraries/Ftp.php +++ b/system/libraries/Ftp.php @@ -37,18 +37,63 @@ defined('BASEPATH') OR exit('No direct script access allowed'); */ class CI_FTP { + /** + * FTP Server hostname + * + * @var string + */ public $hostname = ''; + + /** + * FTP Username + * + * @var string + */ public $username = ''; + + /** + * FTP Password + * + * @var string + */ public $password = ''; + + /** + * FTP Server port + * + * @var int + */ public $port = 21; + + /** + * Passive mode flag + * + * @var bool + */ public $passive = TRUE; + + /** + * Debug flag + * + * Specifies whether to display error messages. + * + * @var bool + */ public $debug = FALSE; + + /** + * Connection + * + * @var resource + */ public $conn_id = FALSE; + // -------------------------------------------------------------------- + /** * Constructor * - * @param array $config = array() + * @param array $config * @return void */ public function __construct($config = array()) @@ -66,7 +111,7 @@ class CI_FTP { /** * Initialize preferences * - * @param array + * @param array $config * @return void */ public function initialize($config = array()) @@ -88,7 +133,7 @@ class CI_FTP { /** * FTP Connect * - * @param array the connection values + * @param array $config Connection values * @return bool */ public function connect($config = array()) @@ -168,8 +213,8 @@ class CI_FTP { * so we do it by trying to change to a particular directory. * Internally, this parameter is only used by the "mirror" function below. * - * @param string - * @param bool + * @param string $path + * @param bool $supress_debug * @return bool */ public function changedir($path = '', $supress_debug = FALSE) @@ -198,8 +243,8 @@ class CI_FTP { /** * Create a directory * - * @param string - * @param int + * @param string $path + * @param int $permissions * @return bool */ public function mkdir($path = '', $permissions = NULL) @@ -234,10 +279,10 @@ class CI_FTP { /** * Upload a file to the server * - * @param string - * @param string - * @param string - * @param int + * @param string $locpath + * @param string $rempath + * @param string $mode + * @param int $permissions * @return bool */ public function upload($locpath, $rempath, $mode = 'auto', $permissions = NULL) @@ -288,9 +333,9 @@ class CI_FTP { /** * Download a file from a remote server to the local server * - * @param string - * @param string - * @param string + * @param string $rempath + * @param string $locpath + * @param string $mode * @return bool */ public function download($rempath, $locpath, $mode = 'auto') @@ -329,9 +374,9 @@ class CI_FTP { /** * Rename (or move) a file * - * @param string - * @param string - * @param bool + * @param string $old_file + * @param string $new_file + * @param bool $move * @return bool */ public function rename($old_file, $new_file, $move = FALSE) @@ -360,8 +405,8 @@ class CI_FTP { /** * Move a file * - * @param string - * @param string + * @param string $old_file + * @param string $new_file * @return bool */ public function move($old_file, $new_file) @@ -374,7 +419,7 @@ class CI_FTP { /** * Rename (or move) a file * - * @param string + * @param string $filepath * @return bool */ public function delete_file($filepath) @@ -404,7 +449,7 @@ class CI_FTP { * Delete a folder and recursively delete everything (including sub-folders) * containted within it. * - * @param string + * @param string $filepath * @return bool */ public function delete_dir($filepath) @@ -451,8 +496,8 @@ class CI_FTP { /** * Set file permissions * - * @param string the file path - * @param int the permissions + * @param string $path File path + * @param int $perm Permissions * @return bool */ public function chmod($path, $perm) @@ -481,7 +526,7 @@ class CI_FTP { /** * FTP List files in the specified directory * - * @param string $path = '.' + * @param string $path * @return array */ public function list_files($path = '.') @@ -504,8 +549,8 @@ class CI_FTP { * Whatever the directory structure of the original file path will be * recreated on the server. * - * @param string path to source with trailing slash - * @param string path to destination - include the base folder with trailing slash + * @param string $locpath Path to source with trailing slash + * @param string $rempath Path to destination - include the base folder with trailing slash * @return bool */ public function mirror($locpath, $rempath) @@ -551,7 +596,7 @@ class CI_FTP { /** * Extract the file extension * - * @param string + * @param string $filename * @return string */ protected function _getext($filename) @@ -570,7 +615,7 @@ class CI_FTP { /** * Set the upload type * - * @param string + * @param string $ext Filename extension * @return string */ protected function _settype($ext) @@ -617,7 +662,7 @@ class CI_FTP { /** * Display error message * - * @param string + * @param string $line * @return void */ protected function _error($line) -- cgit v1.2.3-24-g4f1b From 838a9d69a9139b6bcd6f8765fdd2d58b929e70ad Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 3 Dec 2012 14:37:47 +0200 Subject: [ci skip] Cleaned some spaces --- system/libraries/Ftp.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'system/libraries/Ftp.php') diff --git a/system/libraries/Ftp.php b/system/libraries/Ftp.php index 60c03b5ad..7f58fee7b 100644 --- a/system/libraries/Ftp.php +++ b/system/libraries/Ftp.php @@ -460,7 +460,7 @@ class CI_FTP { } // Add a trailing slash to the file path if needed - $filepath = preg_replace('/(.+?)\/*$/', '\\1/', $filepath); + $filepath = preg_replace('/(.+?)\/*$/', '\\1/', $filepath); $list = $this->list_files($filepath); @@ -636,7 +636,6 @@ class CI_FTP { 'xml' ); - return in_array($ext, $text_types) ? 'ascii' : 'binary'; } -- cgit v1.2.3-24-g4f1b