Move Helper to PSR-4

This commit is contained in:
Joas Schilling 2016-05-12 16:28:21 +02:00
parent 391531851c
commit 7db6b487f5
No known key found for this signature in database
GPG Key ID: 70A0B324C41C0946
16 changed files with 20 additions and 23 deletions

View File

@ -30,7 +30,7 @@ OCP\JSON::checkAppEnabled('user_ldap');
OCP\JSON::callCheck();
$prefix = (string)$_POST['ldap_serverconfig_chooser'];
$helper = new \OCA\user_ldap\lib\Helper();
$helper = new \OCA\User_LDAP\Helper();
if($helper->deleteServerConfiguration($prefix)) {
OCP\JSON::success();
} else {

View File

@ -25,7 +25,7 @@ OCP\JSON::checkAdminUser();
OCP\JSON::checkAppEnabled('user_ldap');
OCP\JSON::callCheck();
$helper = new \OCA\user_ldap\lib\Helper();
$helper = new \OCA\User_LDAP\Helper();
$serverConnections = $helper->getServerConfigurationPrefixes();
sort($serverConnections);
$lk = array_pop($serverConnections);

View File

@ -27,7 +27,7 @@
OCP\App::registerAdmin('user_ldap', 'settings');
$helper = new \OCA\user_ldap\lib\Helper();
$helper = new \OCA\User_LDAP\Helper();
$configPrefixes = $helper->getServerConfigurationPrefixes(true);
$ldapWrapper = new OCA\User_LDAP\LDAP();
$ocConfig = \OC::$server->getConfig();
@ -64,7 +64,7 @@ if(count($configPrefixes) > 0) {
\OCP\Util::connectHook(
'\OCA\Files_Sharing\API\Server2Server',
'preLoginNameUsedAsUserName',
'\OCA\user_ldap\lib\Helper',
'\OCA\User_LDAP\Helper',
'loginName2UserName'
);

View File

@ -21,7 +21,7 @@
*
*/
use OCA\user_ldap\lib\Helper;
use OCA\User_LDAP\Helper;
use OCA\User_LDAP\LDAP;
use OCA\User_LDAP\User_Proxy;
use OCA\User_LDAP\Mapping\UserMapping;

View File

@ -30,14 +30,14 @@ use Symfony\Component\Console\Output\OutputInterface;
use OCA\User_LDAP\User\DeletedUsersIndex;
use OCA\User_LDAP\Mapping\UserMapping;
use OCA\user_ldap\lib\Helper as LDAPHelper;
use OCA\User_LDAP\Helper as LDAPHelper;
use OCA\User_LDAP\User_Proxy;
class CheckUser extends Command {
/** @var \OCA\User_LDAP\User_Proxy */
protected $backend;
/** @var \OCA\User_LDAP\lib\Helper */
/** @var \OCA\User_LDAP\Helper */
protected $helper;
/** @var \OCA\User_LDAP\User\DeletedUsersIndex */

View File

@ -26,11 +26,11 @@ namespace OCA\User_LDAP\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use \OCA\user_ldap\lib\Helper;
use \OCA\User_LDAP\Helper;
use \OCA\user_ldap\lib\Configuration;
class CreateEmptyConfig extends Command {
/** @var \OCA\User_LDAP\lib\Helper */
/** @var \OCA\User_LDAP\Helper */
protected $helper;
/**

View File

@ -27,10 +27,10 @@ use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use \OCA\user_ldap\lib\Helper;
use \OCA\User_LDAP\Helper;
class DeleteConfig extends Command {
/** @var \OCA\User_LDAP\lib\Helper */
/** @var \OCA\User_LDAP\Helper */
protected $helper;
/**

View File

@ -30,7 +30,7 @@ use Symfony\Component\Console\Output\OutputInterface;
use OCA\User_LDAP\User_Proxy;
use OCA\User_LDAP\Group_Proxy;
use OCA\user_ldap\lib\Helper;
use OCA\User_LDAP\Helper;
use OCA\User_LDAP\LDAP;
use OCP\IConfig;

View File

@ -27,7 +27,7 @@ use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use \OCA\user_ldap\lib\Helper;
use OCA\User_LDAP\Helper;
use \OCA\user_ldap\lib\Configuration;
class SetConfig extends Command {

View File

@ -28,11 +28,11 @@ use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use \OCA\user_ldap\lib\Helper;
use \OCA\User_LDAP\Helper;
use \OCA\user_ldap\lib\Configuration;
class ShowConfig extends Command {
/** @var \OCA\User_LDAP\lib\Helper */
/** @var \OCA\User_LDAP\Helper */
protected $helper;
/**

View File

@ -27,7 +27,7 @@ use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use \OCA\user_ldap\lib\Helper;
use \OCA\User_LDAP\Helper;
use \OCA\user_ldap\lib\Connection;
class TestConfig extends Command {

View File

@ -25,9 +25,7 @@
*
*/
namespace OCA\user_ldap\lib;
use OCA\User_LDAP\User_Proxy;
namespace OCA\User_LDAP;
class Helper {

View File

@ -25,7 +25,7 @@ namespace OCA\User_LDAP\Jobs;
use \OC\BackgroundJob\TimedJob;
use \OCA\user_ldap\User_LDAP;
use \OCA\User_LDAP\User_Proxy;
use \OCA\user_ldap\lib\Helper;
use \OCA\User_LDAP\Helper;
use \OCA\User_LDAP\LDAP;
use \OCA\User_LDAP\User\DeletedUsersIndex;
use \OCA\User_LDAP\Mapping\UserMapping;

View File

@ -34,7 +34,6 @@ namespace OCA\User_LDAP;
use OC\ServerNotAvailableException;
use OCA\user_ldap\lib\Access;
use OCA\user_ldap\lib\Configuration;
use OCA\user_ldap\lib\Helper;
class Wizard extends LDAPUtility {
static protected $l;

View File

@ -31,7 +31,7 @@ OC_Util::checkAdminUser();
// fill template
$tmpl = new OCP\Template('user_ldap', 'settings');
$helper = new \OCA\user_ldap\lib\Helper();
$helper = new \OCA\User_LDAP\Helper();
$prefixes = $helper->getServerConfigurationPrefixes();
$hosts = $helper->getServerConfigurationHosts();

View File

@ -35,7 +35,7 @@ class Test_CleanUp extends \PHPUnit_Framework_TestCase {
->getMock();
$mocks['ocConfig'] = $this->getMock('\OCP\IConfig');
$mocks['db'] = $this->getMock('\OCP\IDBConnection');
$mocks['helper'] = $this->getMock('\OCA\user_ldap\lib\Helper');
$mocks['helper'] = $this->getMock('\OCA\User_LDAP\Helper');
return $mocks;
}