Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simplesamlphp
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Perun
Perun ProxyIdP
v1
simplesamlphp
Commits
f704703e
Commit
f704703e
authored
Feb 17, 2016
by
Jaime Perez Crespo
Browse files
Options
Downloads
Patches
Plain Diff
Reformat the files in bin/.
parent
0528937a
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
bin/importPdoMetadata.php
+17
-17
17 additions, 17 deletions
bin/importPdoMetadata.php
bin/initMDSPdo.php
+13
-13
13 additions, 13 deletions
bin/initMDSPdo.php
bin/memcacheSync.php
+118
-116
118 additions, 116 deletions
bin/memcacheSync.php
bin/pwgen.php
+15
-15
15 additions, 15 deletions
bin/pwgen.php
with
163 additions
and
161 deletions
bin/importPdoMetadata.php
+
17
−
17
View file @
f704703e
This diff is collapsed.
Click to expand it.
bin/initMDSPdo.php
+
13
−
13
View file @
f704703e
...
@@ -19,7 +19,7 @@ foreach ($config['metadata.sources'] as $source) {
...
@@ -19,7 +19,7 @@ foreach ($config['metadata.sources'] as $source) {
$result
=
$metadataStorageHandler
->
initDatabase
();
$result
=
$metadataStorageHandler
->
initDatabase
();
if
(
$result
===
false
)
{
if
(
$result
===
false
)
{
echo
"Failed to intialize metadata database."
.
PHP_EOL
;
echo
"Failed to in
i
tialize metadata database."
.
PHP_EOL
;
}
else
{
}
else
{
echo
"Successfully initialized metadata database."
.
PHP_EOL
;
echo
"Successfully initialized metadata database."
.
PHP_EOL
;
}
}
...
...
This diff is collapsed.
Click to expand it.
bin/memcacheSync.php
+
118
−
116
View file @
f704703e
...
@@ -38,7 +38,7 @@ $keys = array();
...
@@ -38,7 +38,7 @@ $keys = array();
foreach
(
$stats
as
$group
)
{
foreach
(
$stats
as
$group
)
{
foreach
(
$group
as
$server
=>
$state
)
{
foreach
(
$group
as
$server
=>
$state
)
{
if
(
$state
===
FALSE
)
{
if
(
$state
===
false
)
{
echo
(
"WARNING: Server "
.
$server
.
" is down.
\n
"
);
echo
(
"WARNING: Server "
.
$server
.
" is down.
\n
"
);
$warnServerDown
++
;
$warnServerDown
++
;
continue
;
continue
;
...
@@ -61,7 +61,7 @@ $skipped = 0;
...
@@ -61,7 +61,7 @@ $skipped = 0;
$sync
=
0
;
$sync
=
0
;
foreach
(
$keys
as
$key
)
{
foreach
(
$keys
as
$key
)
{
$res
=
SimpleSAML_Memcache
::
get
(
$key
);
$res
=
SimpleSAML_Memcache
::
get
(
$key
);
if
(
$res
===
NULL
)
{
if
(
$res
===
null
)
{
$skipped
+=
1
;
$skipped
+=
1
;
}
else
{
}
else
{
$sync
+=
1
;
$sync
+=
1
;
...
@@ -88,10 +88,12 @@ if($warnBigSlab > 0) {
...
@@ -88,10 +88,12 @@ if($warnBigSlab > 0) {
/**
/**
* Fetch all keys available in an server.
* Fetch all keys available in an server.
*
*
* @param $server The server, as a string with <hostname>:<port>.
* @param string $server The server, as a string with <hostname>:<port>.
* @return An array with all the keys available on the server.
*
* @return array An array with all the keys available on the server.
*/
*/
function
getServerKeys
(
$server
)
{
function
getServerKeys
(
$server
)
{
$server
=
explode
(
':'
,
$server
);
$server
=
explode
(
':'
,
$server
);
$host
=
$server
[
0
];
$host
=
$server
[
0
];
$port
=
(
int
)
$server
[
1
];
$port
=
(
int
)
$server
[
1
];
...
@@ -100,14 +102,14 @@ function getServerKeys($server) {
...
@@ -100,14 +102,14 @@ function getServerKeys($server) {
$socket
=
fsockopen
(
$host
,
$port
);
$socket
=
fsockopen
(
$host
,
$port
);
echo
(
"Connected. Finding keys.
\n
"
);
echo
(
"Connected. Finding keys.
\n
"
);
if
(
fwrite
(
$socket
,
"stats slabs
\r\n
"
)
===
FALSE
)
{
if
(
fwrite
(
$socket
,
"stats slabs
\r\n
"
)
===
false
)
{
echo
(
"Error requesting slab dump from server.
\n
"
);
echo
(
"Error requesting slab dump from server.
\n
"
);
exit
(
1
);
exit
(
1
);
}
}
// Read list of slabs
// Read list of slabs
$slabs
=
array
();
$slabs
=
array
();
while
(
(
$line
=
fgets
(
$socket
))
!==
FALSE
)
{
while
(
(
$line
=
fgets
(
$socket
))
!==
false
)
{
$line
=
rtrim
(
$line
);
$line
=
rtrim
(
$line
);
if
(
$line
===
'END'
)
{
if
(
$line
===
'END'
)
{
break
;
break
;
...
@@ -115,7 +117,7 @@ function getServerKeys($server) {
...
@@ -115,7 +117,7 @@ function getServerKeys($server) {
if
(
preg_match
(
'/^STAT (\d+):/'
,
$line
,
$matches
))
{
if
(
preg_match
(
'/^STAT (\d+):/'
,
$line
,
$matches
))
{
$slab
=
(
int
)
$matches
[
1
];
$slab
=
(
int
)
$matches
[
1
];
if
(
!
in_array
(
$slab
,
$slabs
,
TRUE
))
{
if
(
!
in_array
(
$slab
,
$slabs
,
true
))
{
$slabs
[]
=
$slab
;
$slabs
[]
=
$slab
;
}
}
}
}
...
@@ -125,7 +127,7 @@ function getServerKeys($server) {
...
@@ -125,7 +127,7 @@ function getServerKeys($server) {
$keys
=
array
();
$keys
=
array
();
foreach
(
$slabs
as
$slab
)
{
foreach
(
$slabs
as
$slab
)
{
if
(
fwrite
(
$socket
,
"stats cachedump "
.
$slab
.
" 1000000
\r\n
"
)
===
FALSE
)
{
if
(
fwrite
(
$socket
,
"stats cachedump "
.
$slab
.
" 1000000
\r\n
"
)
===
false
)
{
echo
(
"Error requesting cache dump from server.
\n
"
);
echo
(
"Error requesting cache dump from server.
\n
"
);
exit
(
1
);
exit
(
1
);
}
}
...
@@ -135,7 +137,7 @@ function getServerKeys($server) {
...
@@ -135,7 +137,7 @@ function getServerKeys($server) {
*/
*/
$resultSize
=
0
;
$resultSize
=
0
;
while
(
(
$line
=
fgets
(
$socket
))
!==
FALSE
)
{
while
(
(
$line
=
fgets
(
$socket
))
!==
false
)
{
$resultSize
+=
strlen
(
$line
);
$resultSize
+=
strlen
(
$line
);
$line
=
rtrim
(
$line
);
$line
=
rtrim
(
$line
);
...
...
This diff is collapsed.
Click to expand it.
bin/pwgen.php
+
15
−
15
View file @
f704703e
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment