1 <?php
 2 /**
 3  * @package     Joomla.Platform
 4  * @subpackage  Client
 5  *
 6  * @copyright   Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
 7  * @license     GNU General Public License version 2 or later; see LICENSE
 8  */
 9 
10 defined('JPATH_PLATFORM') or die;
11 
12 /**
13  * Wrapper class for JClientHelper
14  *
15  * @package     Joomla.Platform
16  * @subpackage  Client
17  * @since       3.4
18  */
19 class JClientWrapperHelper
20 {
21     /**
22      * Helper wrapper method for getCredentials
23      *
24      * @param   string   $client  Client name, currently only 'ftp' is supported
25      * @param   boolean  $force   Forces re-creation of the login credentials. Set this to
26      *
27      * @return  array    Client layer configuration options, consisting of at least
28      *
29      * @see     JClientHelper::getCredentials()
30      * @since   3.4
31      */
32     public function getCredentials($client, $force = false)
33     {
34         return JClientHelper::getCredentials($client, $force);
35     }
36 
37     /**
38      * Helper wrapper method for setCredentials
39      *
40      * @param   string  $client  Client name, currently only 'ftp' is supported
41      * @param   string  $user    Username
42      * @param   string  $pass    Password
43      *
44      * @return boolean  True if the given login credentials have been set and are valid
45      *
46      * @see     JClientHelper::setCredentials()
47      * @since   3.4
48      */
49     public function setCredentials($client, $user, $pass)
50     {
51         return JClientHelper::setCredentials($client, $user, $pass);
52     }
53 
54     /**
55      * Helper wrapper method for hasCredentials
56      *
57      * @param   string  $client  Client name, currently only 'ftp' is supported
58      *
59      * @return boolean  True if login credentials are available
60      *
61      * @see     JClientHelper::hasCredentials()
62      * @since   3.4
63      */
64     public function hasCredentials($client)
65     {
66         return JClientHelper::hasCredentials($client);
67     }
68 
69     /**
70      * Helper wrapper method for setCredentialsFromRequest
71      *
72      * @param   string  $client  The name of the client.
73      *
74      * @return  mixed  True, if FTP settings; JError if using legacy tree
75      *
76      * @see     JUserHelper::setCredentialsFromRequest()
77      * @since   3.4
78      * @throws  InvalidArgumentException if credentials invalid
79      */
80     public function setCredentialsFromRequest($client)
81     {
82         return JClientHelper::setCredentialsFromRequest($client);
83     }
84 }
85