Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .phan/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

return [
'directory_list' => [
'src',
'web',
'bin',
],
'exclude_analysis_directory_list' => [
'vendor/',
],
];
16 changes: 16 additions & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
;

return PhpCsFixer\Config::create()
->setRules([
'@PSR2' => true,
'@Symfony' => true,
'ordered_imports' => true,
'array_syntax' => ['syntax' => 'short'],
'ordered_class_elements' => true,
])
->setFinder($finder)
;
41 changes: 20 additions & 21 deletions bin/BackendTest.php
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
<?php

/**
* Copyright 2013 François Kooman <fkooman@tuxed.net>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

require_once dirname(__DIR__) . '/vendor/autoload.php';
* Copyright 2013 François Kooman <fkooman@tuxed.net>.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require_once dirname(__DIR__).'/vendor/autoload.php';

if ($argc < 2) {
echo "specify userId as a parameter" . PHP_EOL;
echo 'specify userId as a parameter'.PHP_EOL;
exit(1);
}

use fkooman\Config\Config;
use fkooman\VootProvider\Config\Config;

$config = Config::fromIniFile(dirname(__DIR__) . '/config/voot.ini');
$config = Config::fromIniFile(dirname(__DIR__).'/config/voot.ini');

$vootStorageBackend = "fkooman\\VootProvider\\" . $config->getValue('storageBackend');
$vootStorageBackend = 'fkooman\\VootProvider\\'.$config->getValue('storageBackend');

try {
$vootStorage = new $vootStorageBackend($config);
Expand All @@ -39,5 +38,5 @@
var_dump($groupMembers);
}
} catch (Exception $e) {
echo $e->getMessage() . PHP_EOL;
echo $e->getMessage().PHP_EOL;
}
49 changes: 24 additions & 25 deletions bin/addUsers.php
Original file line number Diff line number Diff line change
@@ -1,38 +1,37 @@
<?php

/**
* Copyright 2013 François Kooman <fkooman@tuxed.net>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

require_once dirname(__DIR__) . '/vendor/autoload.php';

use fkooman\Config\Config;
* Copyright 2013 François Kooman <fkooman@tuxed.net>.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require_once dirname(__DIR__).'/vendor/autoload.php';

use fkooman\VootProvider\Config\Config;
use fkooman\VootProvider\PdoVootStorage;

$config = Config::fromIniFile(dirname(__DIR__) . '/config/voot.ini');
$config = Config::fromIniFile(dirname(__DIR__).'/config/voot.ini');

$storage = new PdoVootStorage($config);

$data = file_get_contents(dirname(__DIR__) . '/schema/user_attributes.json');
$data = file_get_contents(dirname(__DIR__).'/schema/user_attributes.json');
$d = json_decode($data, true);

foreach ($d as $v) {
$storage->addUser($v['id'], $v['displayName'], $v['mail']);
}

$data = file_get_contents(dirname(__DIR__) . '/schema/group_membership.json');
$data = file_get_contents(dirname(__DIR__).'/schema/group_membership.json');
$d = json_decode($data, true);

foreach ($d as $v) {
Expand All @@ -45,13 +44,13 @@
function roleToInt($role)
{
switch ($role) {
case "member":
case 'member':
return 10;
case "admin":
case 'admin':
return 50;
case "manager":
case 'manager':
return 20;
default:
die("invalid role");
die('invalid role');
}
}
12 changes: 8 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,21 @@
}
],
"autoload": {
"psr-0": {
"psr-4": {
"fkooman\\VootProvider\\": "src/"
}
},
"description": "VOOT Provider",
"license": "Apache-2.0",
"name": "fkooman/php-voot-provider",
"require": {
"ext-filter": "*",
"ext-json": "*",
"ext-ldap": "*",
"fkooman/php-lib-config": "0.2.*",
"fkooman/php-lib-rest": "0.3.*",
"php": ">=5.3.3"
"ext-pcre": "*",
"ext-pdo": "*",
"ext-spl": "*",
"php": ">=5.4",
"symfony/polyfill-php56": "^1.3"
}
}
Loading