Skip to content

Commit

Permalink
Wrapper class for JClientHelper to get rid of static methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Kubik-Rubik committed Oct 17, 2014
1 parent 605237d commit 5e6e8e2
Showing 1 changed file with 84 additions and 0 deletions.
84 changes: 84 additions & 0 deletions libraries/joomla/client/helper/wrapper.php
@@ -0,0 +1,84 @@
<?php
/**
* @package Joomla.Platform
* @subpackage Client
*
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/

defined('JPATH_PLATFORM') or die;

/**
* Wrapper class for JClientHelper
*
* @package Joomla.Platform
* @subpackage Client
* @since 3.4
*/
class JClientHelperWrapper
{
/**
* Helper wrapper method for getCredentials
*
* @param string $client Client name, currently only 'ftp' is supported
* @param boolean $force Forces re-creation of the login credentials. Set this to
*
* @return array Client layer configuration options, consisting of at least
*
* @see JClientHelper::getCredentials()
* @since 3.4
*/
public function getCredentials($client, $force = false)
{
return JClientHelper::getCredentials($client, $force);
}

/**
* Helper wrapper method for setCredentials
*
* @param string $client Client name, currently only 'ftp' is supported
* @param string $user Username
* @param string $pass Password
*
* @return boolean True if the given login credentials have been set and are valid
*
* @see JClientHelper::setCredentials()
* @since 3.4
*/
public function setCredentials($client, $user, $pass)
{
return JClientHelper::setCredentials($client, $user, $pass);
}

/**
* Helper wrapper method for hasCredentials
*
* @param string $client Client name, currently only 'ftp' is supported
*
* @return boolean True if login credentials are available
*
* @see JClientHelper::hasCredentials()
* @since 3.4
*/
public function hasCredentials($client)
{
return JClientHelper::hasCredentials($client);
}

/**
* Helper wrapper method for setCredentialsFromRequest
*
* @param string $client The name of the client.
*
* @return mixed True, if FTP settings; JError if using legacy tree
*
* @see JUserHelper::setCredentialsFromRequest()
* @since 3.4
* @throws InvalidArgumentException if credentials invalid
*/
public function setCredentialsFromRequest($client)
{
return JClientHelper::setCredentialsFromRequest($client);
}
}

0 comments on commit 5e6e8e2

Please sign in to comment.