Move Configuration to PSR-4

This commit is contained in:
Joas Schilling 2016-05-12 16:37:49 +02:00
parent af0a6961b1
commit aa7b600383
No known key found for this signature in database
GPG key ID: 70A0B324C41C0946
10 changed files with 14 additions and 15 deletions

View file

@ -34,12 +34,12 @@ $nk = 's'.str_pad($ln+1, 2, '0', STR_PAD_LEFT);
$resultData = array('configPrefix' => $nk);
$newConfig = new \OCA\user_ldap\lib\Configuration($nk, false);
$newConfig = new \OCA\User_LDAP\Configuration($nk, false);
if(isset($_POST['copyConfig'])) {
$originalConfig = new \OCA\user_ldap\lib\Configuration($_POST['copyConfig']);
$originalConfig = new \OCA\User_LDAP\Configuration($_POST['copyConfig']);
$newConfig->setConfiguration($originalConfig->getConfiguration());
} else {
$configuration = new \OCA\user_ldap\lib\Configuration($nk, false);
$configuration = new \OCA\User_LDAP\Configuration($nk, false);
$newConfig->setConfiguration($configuration->getDefaults());
$resultData['defaults'] = $configuration->getDefaults();
}

View file

@ -42,7 +42,7 @@ if(!isset($_POST['ldap_serverconfig_chooser'])) {
$prefix = (string)$_POST['ldap_serverconfig_chooser'];
$ldapWrapper = new \OCA\User_LDAP\LDAP();
$configuration = new \OCA\user_ldap\lib\Configuration($prefix);
$configuration = new \OCA\User_LDAP\Configuration($prefix);
$con = new \OCA\User_LDAP\Connection($ldapWrapper, '', null);
$con->setConfiguration($configuration->getConfiguration());

View file

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

View file

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

View file

@ -28,8 +28,8 @@ 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\Helper;
use \OCA\user_ldap\lib\Configuration;
use OCA\User_LDAP\Helper;
use OCA\User_LDAP\Configuration;
class ShowConfig extends Command {
/** @var \OCA\User_LDAP\Helper */

View file

@ -26,7 +26,7 @@
*
*/
namespace OCA\user_ldap\lib;
namespace OCA\User_LDAP;
/**
* @property int ldapPagingSize holds an integer

View file

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

View file

@ -67,7 +67,7 @@ $tmpl->assign('toc', $toc);
$tmpl->assign('settingControls', $sControls);
// assign default values
$config = new \OCA\user_ldap\lib\Configuration('', false);
$config = new \OCA\User_LDAP\Configuration('', false);
$defaults = $config->getDefaults();
foreach($defaults as $key => $default) {
$tmpl->assign($key.'_default', $default);

View file

@ -29,7 +29,7 @@ use \OCA\User_LDAP\Wizard;
// use \OCA\User_LDAP\User_LDAP as UserLDAP;
// use \OCA\user_ldap\lib\Access;
// use \OCA\user_ldap\lib\Configuration;
// use \OCA\User_LDAP\Configuration;
// use \OCA\User_LDAP\ILDAPWrapper;
/**
@ -59,12 +59,12 @@ class WizardTest extends \Test\TestCase {
static $accMethods;
if(is_null($confMethods)) {
$confMethods = get_class_methods('\OCA\user_ldap\lib\Configuration');
$confMethods = get_class_methods('\OCA\User_LDAP\Configuration');
$connMethods = get_class_methods('\OCA\User_LDAP\Connection');
$accMethods = get_class_methods('\OCA\user_ldap\lib\Access');
}
$lw = $this->getMock('\OCA\User_LDAP\ILDAPWrapper');
$conf = $this->getMock('\OCA\user_ldap\lib\Configuration',
$conf = $this->getMock('\OCA\User_LDAP\Configuration',
$confMethods,
array($lw, null, null));

View file

@ -89,7 +89,7 @@ class Test_Configuration extends \Test\TestCase {
* @dataProvider configurationDataProvider
*/
public function testSetValue($key, $input, $expected) {
$configuration = new \OCA\user_ldap\lib\Configuration('t01', false);
$configuration = new \OCA\User_LDAP\Configuration('t01', false);
$settingsInput = array(
'ldapBaseUsers' => array(