public static function getInstance($host = '127.0.0.1', $port = '21', array $options = array(), $user = null, $pass = null)
	{
		$signature = $user . ':' . $pass . '@' . $host . ":" . $port;

		// Create a new instance, or set the options of an existing one
		if (!isset(self::$instances[$signature]) || !is_object(self::$instances[$signature]))
		{
			self::$instances[$signature] = new static($options);
		}
		else
		{
			self::$instances[$signature]->setOptions($options);
		}

		// Connect to the server, and login, if requested
		if (!self::$instances[$signature]->isConnected())
		{
			$return = self::$instances[$signature]->connect($host, $port);

			if ($return && $user !== null && $pass !== null)
			{
				self::$instances[$signature]->login($user, $pass);
			}
		}

		return self::$instances[$signature];
	}
public static function getInstance($host = '127.0.0.1', $port = '21', array $options = array(), $user = null, $pass = null)
	{
		$signature = $user . ':' . $pass . '@' . $host . ":" . $port;

		// Create a new instance, or set the options of an existing one
		if (!isset(self::$instances[$signature]) || !is_object(self::$instances[$signature]))
		{
			self::$instances[$signature] = new static($options);
		}
		else
		{
			self::$instances[$signature]->setOptions($options);
		}

		// Connect to the server, and login, if requested
		if (!self::$instances[$signature]->isConnected())
		{
			$return = self::$instances[$signature]->connect($host, $port);

			if ($return && $user !== null && $pass !== null)
			{
				self::$instances[$signature]->login($user, $pass);
			}
		}

		return self::$instances[$signature];
	}
public static function getInstance ( $ host = '127.0.0.1' , $ port = '21' , array $ options = array ( ) , $ user = null , $ pass = null ) { $ signature = $ user . ':' . $ pass . '@' . $ host . ":" . $ port ; // Create a new instance, or set the options of an existing one if ( ! isset ( self :: $ instances [ $ signature ] ) || ! is_object ( self :: $ instances [ $ signature ] ) ) { self :: $ instances [ $ signature ] = new static ( $ options ) ; } else { self :: $ instances [ $ signature ] -> setOptions ( $ options ) ; } // Connect to the server, and login, if requested if ( ! self :: $ instances [ $ signature ] -> isConnected ( ) ) { $ return = self :: $ instances [ $ signature ] -> connect ( $ host , $ port ) ; if ( $ return && $ user !== null && $ pass !== null ) { self :: $ instances [ $ signature ] -> login ( $ user , $ pass ) ; } } return self :: $ instances [ $ signature ] ; }
Returns the global FTP connector object, only creating it
if it doesn't already exist.

You may optionally specify a username and password in the parameters. If you do so,
you may not login() again with different credentials using the same object.
If you do not use this option, you must quit() the current connection when you
are done, to free it for use by others.

@param   string  $host     Host to connect to
@param   string  $port     Port to connect to
@param   array   $options  Array with any of these options: type=>[FTP_AUTOASCII|FTP_ASCII|FTP_BINARY], timeout=>(int)
@param   string  $user     Username to use for a connection
@param   string  $pass     Password to use for a connection

@return  FtpClient  The FTP Client object.

@since   1.0
Returns the global FTP connector object only creating it if it doesn t already exist .