<commit_before><?php
/**
 * Extends the 'kFileTransferMgr' class & implements a file transfer manager using the FTP protocol.
 * For additional comments please look at the 'kFileTransferMgr' class.
 * 
 * @package infra
 * @subpackage Storage
 */
class ftpMgr extends kFileTransferMgr
{

	// instances of this class should be created usign the 'getInstance' of the 'kFileTransferMgr' class
	protected function __construct()
	{
		// do nothing
	}


	/**********************************************************************/
	/* Implementation of abstract functions from class 'kFileTransferMgr' */
	/**********************************************************************/

	// ftp connect to server:port
	protected function doConnect($ftp_server, &$ftp_port)
	{
		// try connecting to server
		if (!$ftp_port || $ftp_port == 0) {
			$ftp_port = 21;
		}
		return ftp_connect($ftp_server, $ftp_port);
	}


	// login to an existing connection with given user/pass
	protected function doLogin($ftp_user, $ftp_pass, $ftp_passive_mode = TRUE)
	{
		// try to login
		$res = ftp_login($this->getConnection(), $ftp_user, $ftp_pass);
//		if ($res) {
//			// set FTP passive mode
//			$res = ftp_pasv($this->getConnection() , $ftp_passive_mode);
//		}
		return $res;
	}


	// login using a public key - not supported in FTP
	protected function doLoginPubKey($user, $pubKeyFile, $privKeyFile, $passphrase = null)
	{
		return false; // NOT SUPPORTED
	}

<commit_msg>def: 4285 "x" is not included as an allowed character in the unix regex <commit_after><?php
/**
 * Extends the 'kFileTransferMgr' class & implements a file transfer manager using the FTP protocol.
 * For additional comments please look at the 'kFileTransferMgr' class.
 * 
 * @package infra
 * @subpackage Storage
 */
class ftpMgr extends kFileTransferMgr
{

	// instances of this class should be created usign the 'getInstance' of the 'kFileTransferMgr' class
	protected function __construct()
	{
		// do nothing
	}


	/**********************************************************************/
	/* Implementation of abstract functions from class 'kFileTransferMgr' */
	/**********************************************************************/

	// ftp connect to server:port
	protected function doConnect($ftp_server, &$ftp_port)
	{
		// try connecting to server
		if (!$ftp_port || $ftp_port == 0) {
			$ftp_port = 21;
		}
		return ftp_connect($ftp_server, $ftp_port);
	}


	// login to an existing connection with given user/pass
	protected function doLogin($ftp_user, $ftp_pass, $ftp_passive_mode = TRUE)
	{
		// try to login
		$res = ftp_login($this->getConnection(), $ftp_user, $ftp_pass);
		if ($res) {
			// set FTP passive mode
			ftp_pasv($this->getConnection() , $ftp_passive_mode);
		}
		return $res;
	}


	// login using a public key - not supported in FTP
	protected function doLoginPubKey($user, $pubKeyFile, $privKeyFile, $passphrase = null)
	{
		return false; // NOT SUPPORTED
	}


{'fraction_non_alphanumeric': 0.1985743380855397, 'fraction_numerical': 0.0033944331296673455, 'mean_word_length': 4.234458259325044, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5826684', 'n_tokens_mistral': 959, 'n_tokens_neox': 873, 'n_words': 273}