mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-28 15:49:57 +09:00
17515512: JanRain php-openid library included, normalization fix
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@5137 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
f541dd59b9
commit
658c0e6dbc
219 changed files with 41415 additions and 10 deletions
30
modules/member/php-openid-1.2.3/admin/adminutil.php
Normal file
30
modules/member/php-openid-1.2.3/admin/adminutil.php
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Add a directory to the include path
|
||||
*
|
||||
* @param dir: The directory to add to the path
|
||||
* @param at_start: If true, place this directory at the beginning of
|
||||
* the include path. Otherwise, place it at the end.
|
||||
*/
|
||||
function includeAdd($dir, $at_start=false)
|
||||
{
|
||||
$path = ini_get('include_path');
|
||||
if (strlen($path)) {
|
||||
$newpath = $at_start ? "$dir:$path" : "$path:$dir";
|
||||
} else {
|
||||
$newpath = $dir;
|
||||
}
|
||||
|
||||
ini_set('include_path', $newpath);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the parent directory of this module.
|
||||
*/
|
||||
function getParent()
|
||||
{
|
||||
return dirname(dirname(realpath(__FILE__)));
|
||||
}
|
||||
|
||||
?>
|
||||
81
modules/member/php-openid-1.2.3/admin/brace_style.pl
Normal file
81
modules/member/php-openid-1.2.3/admin/brace_style.pl
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
#!/usr/bin/env perl -w
|
||||
|
||||
use strict;
|
||||
|
||||
my $filename = $ARGV[0];
|
||||
|
||||
if (!$filename) {
|
||||
print "Usage: modified_otb.pl <filename>\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
my @results = ();
|
||||
my $line_num = 0;
|
||||
my ($NONE, $BRACE, $PAREN) = (0, 1, 2);
|
||||
my $looking_for = $NONE;
|
||||
my $last_func_name = "";
|
||||
|
||||
open(HANDLE, "<", $filename) or die "Cannot open $filename\n";
|
||||
|
||||
# Read the file and track the lines with length > $max_length.
|
||||
while (<HANDLE>) {
|
||||
$line_num++;
|
||||
# Subtract one because the newline doesn't count toward the
|
||||
# length.
|
||||
chomp;
|
||||
|
||||
if (!$looking_for &&
|
||||
($_ =~ /^\s*function/) &&
|
||||
($_ =~ /\{/)) {
|
||||
# Done (bad): we found a function whose opening line ends with
|
||||
# a brace, which goes against the PEAR coding guidelines.
|
||||
|
||||
($last_func_name) = $_ =~ /function\s*(.*)\(/;
|
||||
|
||||
push @results, "'$last_func_name' prototype ends with opening ".
|
||||
"brace, line $line_num";
|
||||
} elsif (!$looking_for &&
|
||||
($_ =~ /^\s*function/) &&
|
||||
($_ !~ /\)/)) {
|
||||
($last_func_name) = $_ =~ /function\s*(.*)\(/;
|
||||
$looking_for = $PAREN;
|
||||
} elsif (($looking_for == $PAREN) &&
|
||||
($_ =~ /\)/) &&
|
||||
($_ =~ /\{/)) {
|
||||
# Done (bad): function prototype and brace are on the same
|
||||
# line.
|
||||
push @results, "'$last_func_name' prototype ends with with ".
|
||||
"opening brace, line $line_num";
|
||||
$looking_for = $NONE;
|
||||
} elsif (($looking_for == $PAREN) &&
|
||||
($_ =~ /\)/) &&
|
||||
($_ !~ /\{/)) {
|
||||
$looking_for = $BRACE;
|
||||
} elsif (!$looking_for &&
|
||||
($_ =~ /^\s*function/) &&
|
||||
($_ =~ /\)/) &&
|
||||
($_ !~ /\{/)) {
|
||||
($last_func_name) = $_ =~ /function\s*(.*)\(/;
|
||||
$looking_for = $BRACE;
|
||||
} elsif (($looking_for == $BRACE) &&
|
||||
($_ eq "{")) {
|
||||
$looking_for = $NONE;
|
||||
# Done (good): the brace was found on the line after the
|
||||
# function prototype.
|
||||
} else {
|
||||
# We got here because we got a line that we're not interested
|
||||
# in.
|
||||
$looking_for = $NONE;
|
||||
}
|
||||
}
|
||||
|
||||
# If any long lines were found, notify and exit(1); otherwise,
|
||||
# exit(0).
|
||||
if (@results) {
|
||||
foreach my $result (@results) {
|
||||
print "$filename: $result\n";
|
||||
}
|
||||
exit(1);
|
||||
} else {
|
||||
exit(0);
|
||||
}
|
||||
4
modules/member/php-openid-1.2.3/admin/checkimport
Normal file
4
modules/member/php-openid-1.2.3/admin/checkimport
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#!/usr/bin/env php
|
||||
<?php
|
||||
require_once $argv[1];
|
||||
?>
|
||||
2
modules/member/php-openid-1.2.3/admin/checkimports
Normal file
2
modules/member/php-openid-1.2.3/admin/checkimports
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env bash
|
||||
./admin/findphp | xargs -L 1 ./admin/checkimport
|
||||
3
modules/member/php-openid-1.2.3/admin/darcs-ignore
Normal file
3
modules/member/php-openid-1.2.3/admin/darcs-ignore
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
~$
|
||||
^doc(/|$)
|
||||
^CHANGELOG$
|
||||
15
modules/member/php-openid-1.2.3/admin/docblocks
Normal file
15
modules/member/php-openid-1.2.3/admin/docblocks
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/env bash
|
||||
#set -e
|
||||
|
||||
bad_files=$(./admin/findphp | xargs -l1 /usr/bin/env perl admin/docblocks.pl)
|
||||
|
||||
if [ "$bad_files" ]
|
||||
then
|
||||
cat <<EOF 1>&2
|
||||
These files do not start with docblocks:
|
||||
|
||||
$bad_files
|
||||
|
||||
EOF
|
||||
exit 1
|
||||
fi
|
||||
26
modules/member/php-openid-1.2.3/admin/docblocks.pl
Normal file
26
modules/member/php-openid-1.2.3/admin/docblocks.pl
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/env perl -w
|
||||
|
||||
use strict;
|
||||
|
||||
my $filename = $ARGV[0];
|
||||
|
||||
if (!$filename) {
|
||||
print "Usage: docblocks.pl <filename>\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
my %allowed = ("" => 1,
|
||||
"<?php" => 1);
|
||||
|
||||
open(HANDLE, "<", $filename) or die "Cannot open $filename\n";
|
||||
|
||||
while (<HANDLE>) {
|
||||
chomp;
|
||||
|
||||
if ($_ =~ /\/\*\*/) {
|
||||
exit(0);
|
||||
} elsif (!$allowed{$_}) {
|
||||
print $filename."\n";
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
5
modules/member/php-openid-1.2.3/admin/findglobals
Normal file
5
modules/member/php-openid-1.2.3/admin/findglobals
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
# Find all PHP modules that are likely to have global variables
|
||||
set -e
|
||||
|
||||
./admin/findphp | xargs grep '^\$'
|
||||
8
modules/member/php-openid-1.2.3/admin/findphp
Normal file
8
modules/member/php-openid-1.2.3/admin/findphp
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
find Auth Tests \
|
||||
-name _darcs -prune -o \
|
||||
\( -type f \
|
||||
-a -name \*.php \
|
||||
-a ! -name .\* \
|
||||
\) | grep -v Tests
|
||||
13
modules/member/php-openid-1.2.3/admin/fixperms
Normal file
13
modules/member/php-openid-1.2.3/admin/fixperms
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/env bash
|
||||
cat <<EOF | xargs chmod +x
|
||||
admin/checkimport
|
||||
admin/checkimports
|
||||
admin/docblocks
|
||||
admin/findphp
|
||||
admin/findglobals
|
||||
admin/fixperms
|
||||
admin/makedoc.sh
|
||||
admin/mathlib
|
||||
admin/prepare-release
|
||||
admin/runtests
|
||||
EOF
|
||||
1
modules/member/php-openid-1.2.3/admin/library-name
Normal file
1
modules/member/php-openid-1.2.3/admin/library-name
Normal file
|
|
@ -0,0 +1 @@
|
|||
php-openid
|
||||
46
modules/member/php-openid-1.2.3/admin/longlines.pl
Normal file
46
modules/member/php-openid-1.2.3/admin/longlines.pl
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
#!/usr/bin/env perl -w
|
||||
|
||||
use strict;
|
||||
|
||||
my $filename = $ARGV[0];
|
||||
|
||||
if (!$filename) {
|
||||
print "Usage: longlines.pl <filename> [length]\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
# Set a default maximum line length.
|
||||
my $max_length = $ARGV[1] || 80;
|
||||
|
||||
my @lines = ();
|
||||
my $line_num = 0;
|
||||
|
||||
open(HANDLE, "<", $filename) or die "Cannot open $filename\n";
|
||||
|
||||
# Read the file and track the lines with length > $max_length.
|
||||
while (<HANDLE>) {
|
||||
$line_num++;
|
||||
# Subtract one because the newline doesn't count toward the
|
||||
# length.
|
||||
if (length($_) - 1 > $max_length) {
|
||||
push @lines, $line_num;
|
||||
}
|
||||
}
|
||||
|
||||
# If more than five long lines were found, truncate to five and
|
||||
# indicate that others were present, too.
|
||||
if (@lines > 5) {
|
||||
@lines = @lines[0..4];
|
||||
push @lines, "and others";
|
||||
}
|
||||
|
||||
# If any long lines were found, notify and exit(1); otherwise,
|
||||
# exit(0).
|
||||
if (@lines) {
|
||||
print $filename." (line".((@lines > 1) ? "s" : "")." ".
|
||||
join(", ", @lines)." exceed".((@lines == 1) ? "s" : "").
|
||||
" length $max_length)\n";
|
||||
exit(1);
|
||||
} else {
|
||||
exit(0);
|
||||
}
|
||||
5
modules/member/php-openid-1.2.3/admin/makedoc.sh
Normal file
5
modules/member/php-openid-1.2.3/admin/makedoc.sh
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh
|
||||
set -v
|
||||
phpdoc -p on -t doc -d Auth,admin/tutorials,Services -ti "JanRain OpenID Library" \
|
||||
--ignore \*~,BigMath.php,Discover.php,CryptUtil.php,DiffieHellman.php,HMACSHA1.php,KVForm.php,Parse.php,TrustRoot.php,HTTPFetcher.php,ParanoidHTTPFetcher.php,PlainHTTPFetcher.php,ParseHTML.php,URINorm.php,XRI.php,XRIRes.php,Misc.php \
|
||||
-dn "OpenID" -o "HTML:frames:phphtmllib"
|
||||
18
modules/member/php-openid-1.2.3/admin/mathlib
Normal file
18
modules/member/php-openid-1.2.3/admin/mathlib
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
require_once 'adminutil.php';
|
||||
includeAdd(getParent());
|
||||
|
||||
require_once 'Auth/OpenID/CryptUtil.php';
|
||||
|
||||
$lib =& Auth_OpenID_MathLibrary::getLibWrapper();
|
||||
|
||||
if ($lib === null) {
|
||||
fwrite(STDERR, 'No math library present\n');
|
||||
exit(1);
|
||||
} else {
|
||||
print $lib->type;
|
||||
}
|
||||
|
||||
?>
|
||||
4
modules/member/php-openid-1.2.3/admin/nobadbraces
Normal file
4
modules/member/php-openid-1.2.3/admin/nobadbraces
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
./admin/findphp | xargs -l1 /usr/bin/env perl admin/brace_style.pl
|
||||
14
modules/member/php-openid-1.2.3/admin/nobadcase
Normal file
14
modules/member/php-openid-1.2.3/admin/nobadcase
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
bad=$(./admin/findphp | xargs egrep -n '\b(TRUE|FALSE|NULL)\b')
|
||||
|
||||
if [ ! -z "$bad" ]
|
||||
then
|
||||
cat <<EOF 1>&2
|
||||
These files contain wrongly capitalized constants:
|
||||
|
||||
$bad
|
||||
|
||||
EOF
|
||||
exit 1
|
||||
fi
|
||||
16
modules/member/php-openid-1.2.3/admin/nolonglines
Normal file
16
modules/member/php-openid-1.2.3/admin/nolonglines
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
files_with_long_lines=$(./admin/findphp |
|
||||
xargs -l1 wc -L |
|
||||
awk '$1 > 80 { print $2 }' |
|
||||
xargs -l1 --replace=FILENAME /usr/bin/env perl admin/longlines.pl FILENAME 80)
|
||||
|
||||
if [ "$files_with_long_lines" ]
|
||||
then
|
||||
cat <<EOF 1>&2
|
||||
Found lines > 80 characters in:
|
||||
|
||||
$files_with_long_lines
|
||||
EOF
|
||||
exit 1
|
||||
fi
|
||||
16
modules/member/php-openid-1.2.3/admin/notabs
Normal file
16
modules/member/php-openid-1.2.3/admin/notabs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# Look in the local directory for PHP files that have tabs in them. If
|
||||
# there are files with tabs, print the list of files and exit with
|
||||
# non-zero status.
|
||||
|
||||
tabs=$(./admin/findphp | xargs egrep -n ' ' | sort)
|
||||
|
||||
if [ ! -z "$tabs" ]
|
||||
then
|
||||
cat <<EOF 1>&2
|
||||
Found tabs in:
|
||||
$tabs
|
||||
EOF
|
||||
exit 1
|
||||
fi
|
||||
17
modules/member/php-openid-1.2.3/admin/open_tag
Normal file
17
modules/member/php-openid-1.2.3/admin/open_tag
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
bad_files=$(./admin/findphp |
|
||||
xargs -l1 grep -H -m 1 "<?php" -c |
|
||||
grep ":0" |
|
||||
awk -F: '{ print $1 }')
|
||||
|
||||
if [ "$bad_files" ]
|
||||
then
|
||||
cat <<EOF 1>&2
|
||||
These PHP files do NOT begin with <?php :
|
||||
|
||||
$bad_files
|
||||
|
||||
EOF
|
||||
exit 1
|
||||
fi
|
||||
20
modules/member/php-openid-1.2.3/admin/otb_test.php
Normal file
20
modules/member/php-openid-1.2.3/admin/otb_test.php
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
function fail1() {
|
||||
}
|
||||
|
||||
function pass1()
|
||||
{
|
||||
}
|
||||
|
||||
function fail2(
|
||||
) {
|
||||
|
||||
}
|
||||
|
||||
function pass2(
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
?>
|
||||
24
modules/member/php-openid-1.2.3/admin/package.xml
Normal file
24
modules/member/php-openid-1.2.3/admin/package.xml
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<package version="1.0">
|
||||
<name>%(package_name)s</name>
|
||||
<summary>%(package_summary)s</summary>
|
||||
<description>
|
||||
%(package_description)s
|
||||
</description>
|
||||
<license>%(license_name)s</license>
|
||||
%(maintainers)s
|
||||
<release>
|
||||
<version>%(version)s</version>
|
||||
<date>%(date)s</date>
|
||||
<state>%(release_stability)s</state>
|
||||
<notes>
|
||||
<![CDATA[
|
||||
%(release_notes)s
|
||||
]]>
|
||||
</notes>
|
||||
%(contents_version_1)s
|
||||
</release>
|
||||
<deps>
|
||||
<dep type="php" rel="ge" version="4.3.0" />
|
||||
</deps>
|
||||
</package>
|
||||
74
modules/member/php-openid-1.2.3/admin/package2.xml
Normal file
74
modules/member/php-openid-1.2.3/admin/package2.xml
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
<?xml version="1.0"?>
|
||||
<package version="2.0" xmlns="http://pear.php.net/dtd/package-2.0"
|
||||
xmlns:tasks="http://pear.php.net/dtd/tasks-1.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0
|
||||
http://pear.php.net/dtd/tasks-1.0.xsd
|
||||
http://pear.php.net/dtd/package-2.0
|
||||
http://pear.php.net/dtd/package-2.0.xsd">
|
||||
<name>%(package_name)s</name>
|
||||
<uri>%(uri)s</uri>
|
||||
<summary>%(package_summary)s</summary>
|
||||
<description>
|
||||
%(package_description)s
|
||||
</description>
|
||||
%(leads)s
|
||||
<date>%(date)s</date>
|
||||
<version>
|
||||
<release>%(version)s</release>
|
||||
<api>%(version)s</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>%(release_stability)s</release>
|
||||
<api>%(release_stability)s</api>
|
||||
</stability>
|
||||
<license uri="%(license_uri)s">%(license_name)s</license>
|
||||
<notes>
|
||||
<![CDATA[
|
||||
%(release_notes)s
|
||||
]]>
|
||||
</notes>
|
||||
<contents>
|
||||
%(contents)s
|
||||
</contents>
|
||||
<dependencies>
|
||||
<required>
|
||||
<php>
|
||||
<min>4.3.0</min>
|
||||
</php>
|
||||
<pearinstaller>
|
||||
<min>1.4.5</min>
|
||||
</pearinstaller>
|
||||
</required>
|
||||
<optional>
|
||||
<package>
|
||||
<name>PHPUnit</name>
|
||||
<channel>pear.php.net</channel>
|
||||
<min>1.1.1</min>
|
||||
</package>
|
||||
<package>
|
||||
<name>PEAR_DB</name>
|
||||
<channel>pear.php.net</channel>
|
||||
<min>1.80</min>
|
||||
</package>
|
||||
<extension>
|
||||
<name>pgsql</name>
|
||||
</extension>
|
||||
<extension>
|
||||
<name>mysql</name>
|
||||
</extension>
|
||||
<extension>
|
||||
<name>sqlite</name>
|
||||
</extension>
|
||||
<extension>
|
||||
<name>bcmath</name>
|
||||
</extension>
|
||||
<extension>
|
||||
<name>gmp</name>
|
||||
</extension>
|
||||
</optional>
|
||||
</dependencies>
|
||||
<!-- There really isn't much we should put in the phprelease tag,
|
||||
although we should probably make a windows-specific release tag. -->
|
||||
<phprelease/>
|
||||
</package>
|
||||
155
modules/member/php-openid-1.2.3/admin/packagexml.py
Normal file
155
modules/member/php-openid-1.2.3/admin/packagexml.py
Normal file
|
|
@ -0,0 +1,155 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
import os
|
||||
import os.path
|
||||
|
||||
def makeMaintainerXML(leads):
|
||||
maintainer_template = """
|
||||
<maintainer>
|
||||
<user>%(user)s</user>
|
||||
<name>%(name)s</name>
|
||||
<email>%(email)s</email>
|
||||
<role>lead</role>
|
||||
</maintainer>
|
||||
"""
|
||||
|
||||
return "<maintainers>" + \
|
||||
"".join([maintainer_template % l for l in leads]) + \
|
||||
"</maintainers>"
|
||||
|
||||
def makeLeadXML(leads):
|
||||
lead_template = """
|
||||
<lead>
|
||||
<name>%(name)s</name>
|
||||
<user>%(user)s</user>
|
||||
<email>%(email)s</email>
|
||||
<active>%(active)s</active>
|
||||
</lead>
|
||||
"""
|
||||
|
||||
return "".join([lead_template % l for l in leads])
|
||||
|
||||
INDENT_STRING = " "
|
||||
|
||||
def buildContentsXMLFordir(dir_or_file, roles, depth=0, dir_role=None,
|
||||
all_files=False):
|
||||
"""
|
||||
Returns a list of strings, each of which is either a <file> XML
|
||||
element for the given file or a <dir> element which contains other
|
||||
<file> elements.
|
||||
"""
|
||||
|
||||
try:
|
||||
entries = os.listdir(dir_or_file)
|
||||
dir_role_s = ''
|
||||
if dir_role:
|
||||
dir_role_s = ' role="%s"' % (dir_role)
|
||||
lines = ['%s<dir name="%s"%s>' % (INDENT_STRING * depth,
|
||||
os.path.basename(dir_or_file),
|
||||
dir_role_s)]
|
||||
|
||||
for entry in entries:
|
||||
lines += buildContentsXMLFordir(dir_or_file + os.sep + entry, roles,
|
||||
depth + 1, dir_role, all_files)
|
||||
|
||||
lines.append('%s</dir>' % (INDENT_STRING * depth))
|
||||
|
||||
return lines
|
||||
except OSError:
|
||||
try:
|
||||
extension = dir_or_file.split(".")[-1]
|
||||
except:
|
||||
if not all_files:
|
||||
return []
|
||||
|
||||
if all_files and dir_role:
|
||||
return ['%s<file name="%s" role="%s" />' %
|
||||
(INDENT_STRING * depth, os.path.basename(dir_or_file), dir_role)]
|
||||
elif extension in roles: # Ends in an extension we care about
|
||||
return ['%s<file name="%s" role="%s" />' %
|
||||
(INDENT_STRING * depth, os.path.basename(dir_or_file),
|
||||
roles[extension])]
|
||||
else:
|
||||
return []
|
||||
|
||||
def buildContentsXML(roles, *dirs):
|
||||
lines = []
|
||||
|
||||
for directory in dirs:
|
||||
lines.append("\n".join(buildContentsXMLFordir(directory, roles, 1)))
|
||||
|
||||
return "\n".join(lines)
|
||||
|
||||
def buildDocsXML(*dirs):
|
||||
lines = []
|
||||
|
||||
for directory in dirs:
|
||||
lines.append("\n".join(buildContentsXMLFordir(directory, {}, 1, 'doc',
|
||||
all_files=True)))
|
||||
|
||||
return "\n".join(lines)
|
||||
|
||||
if __name__ == "__main__":
|
||||
def usage(progname):
|
||||
print "Usage: %s <package version> <xml template file> <release notes file>" % (progname)
|
||||
|
||||
import sys
|
||||
import time
|
||||
|
||||
try:
|
||||
import xmlconfig
|
||||
except:
|
||||
print "Could not import XML configuration module xmlconfig"
|
||||
sys.exit(1)
|
||||
|
||||
# Expect sys.argv[2] to be the name of the XML file template to
|
||||
# use for processing.
|
||||
try:
|
||||
template_f = open(sys.argv[2], 'r')
|
||||
except Exception, e:
|
||||
usage(sys.argv[0])
|
||||
print "Could not open template file:", str(e)
|
||||
sys.exit(1)
|
||||
|
||||
# Expect sys.argv[1] to be the version number to include in the
|
||||
# package.xml file.
|
||||
try:
|
||||
version = sys.argv[1]
|
||||
except:
|
||||
usage(sys.argv[0])
|
||||
sys.exit(2)
|
||||
|
||||
# Expect sys.argv[3] to be the name of the release notes file.
|
||||
try:
|
||||
release_file = sys.argv[3]
|
||||
release_file_h = open(release_file, 'r')
|
||||
release_notes = release_file_h.read().strip()
|
||||
release_file_h.close()
|
||||
except Exception, e:
|
||||
usage(sys.argv[0])
|
||||
print str(e)
|
||||
sys.exit(3)
|
||||
|
||||
data = xmlconfig.__dict__.copy()
|
||||
|
||||
contentsXml = buildContentsXML({'php': 'php'}, *xmlconfig.contents_dirs)
|
||||
docsXml = buildDocsXML(*xmlconfig.docs_dirs)
|
||||
|
||||
contents = '<dir name="/">\n' + contentsXml + \
|
||||
"\n" + docsXml + '\n </dir>'
|
||||
|
||||
contents_v1 = '<filelist><dir name="/" baseinstalldir="Auth">\n' + contentsXml + \
|
||||
"\n" + docsXml + '\n </dir></filelist>'
|
||||
|
||||
data['contents'] = contents
|
||||
data['contents_version_1'] = contents_v1
|
||||
data['leads'] = makeLeadXML(xmlconfig.leads)
|
||||
data['maintainers'] = makeMaintainerXML(xmlconfig.leads)
|
||||
data['date'] = time.strftime("%Y-%m-%d")
|
||||
data['version'] = version
|
||||
data['uri'] = "%s%s-%s.tgz" % (data['package_base_uri'], data['package_name'],
|
||||
version)
|
||||
data['release_notes'] = release_notes
|
||||
|
||||
template_data = template_f.read()
|
||||
print template_data % data
|
||||
119
modules/member/php-openid-1.2.3/admin/phpaliases.py
Normal file
119
modules/member/php-openid-1.2.3/admin/phpaliases.py
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
"""This script searches files for functions that are just aliases in
|
||||
PHP source code. This is not 100% reliable, so it should not be
|
||||
automated, but it's useful to run once in a while to make sure that
|
||||
all of the matches it finds are not really legitimate aliases.
|
||||
|
||||
Usage:
|
||||
|
||||
parse_aliases.py <name of alias file> [PHP source code filename]...
|
||||
"""
|
||||
|
||||
import sys
|
||||
|
||||
# Fetch this URL to get the file that is parsed into the aliases list
|
||||
alias_url = 'http://www.zend.com/phpfunc/all_aliases.php'
|
||||
|
||||
header_tok = '<!-- END OF HEADER -->';
|
||||
footer_tok = '<!-- FOOTER -->';
|
||||
|
||||
# Example line of the table that we parse:
|
||||
# '<tr bgcolor="#EFEFFF"><td><a href="function.bzclose.php">bzclose</a></td><td><a href="http://lxr.php.net/source/php-src/ext/bz2/bz2.c#48">php-src/ext/bz2/bz2.c</a></td><td><a href="function.fclose.php">fclose</a></td></tr>'
|
||||
|
||||
import re
|
||||
|
||||
line_re = re.compile(r'''
|
||||
\A
|
||||
|
||||
<tr\ bgcolor="[^">]+">
|
||||
|
||||
<td><a\ href="[^>"]+\.php">([^<>]+)</a></td>
|
||||
|
||||
<td><a\ href="[^">]+">[^<>]+</a></td>
|
||||
|
||||
<td>
|
||||
(?:
|
||||
<a\ href="[^">]+\.php">
|
||||
( [^<>]+ )
|
||||
</a>
|
||||
| ( [^<>]+ )
|
||||
)
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
\Z
|
||||
''', re.VERBOSE)
|
||||
|
||||
def parseString(s):
|
||||
_, rest = s.split(header_tok, 1)
|
||||
body, _ = rest.split(footer_tok, 1)
|
||||
|
||||
lines = body.split('\n')
|
||||
assert [s.strip() for s in lines[-2:]] == ['</table>', '']
|
||||
assert lines[0].strip().startswith('<table')
|
||||
del lines[0], lines[-2:]
|
||||
aliases = {}
|
||||
for line in lines:
|
||||
mo = line_re.match(line)
|
||||
assert mo, line
|
||||
alias, master1, master2 = mo.groups()
|
||||
if master1:
|
||||
master = master1
|
||||
else:
|
||||
assert master2
|
||||
master = master2
|
||||
aliases[alias] = master
|
||||
|
||||
return aliases
|
||||
|
||||
def parseFile(f):
|
||||
return parseString(f.read())
|
||||
|
||||
def parseFileName(fn):
|
||||
return parseFile(file(fn, 'r'))
|
||||
|
||||
def parseURL(url):
|
||||
return parseFile(urllib2.urlopen(url))
|
||||
|
||||
def getAliasRE(aliases):
|
||||
return re.compile(r'(->|\$|)\s*\b(%s)\b' % ('|'.join(aliases.keys())))
|
||||
|
||||
def checkAliasesFile(alias_re, f):
|
||||
found = []
|
||||
line_num = 1
|
||||
for line in f:
|
||||
for mo in alias_re.finditer(line):
|
||||
if mo.group(1):
|
||||
continue
|
||||
alias = mo.group(2)
|
||||
found.append((line_num, alias))
|
||||
line_num += 1
|
||||
return found
|
||||
|
||||
def checkAliases(alias_re, filename):
|
||||
return checkAliasesFile(alias_re, file(filename, 'r'))
|
||||
|
||||
def checkAliasesFiles(alias_re, filenames):
|
||||
found = []
|
||||
for filename in filenames:
|
||||
file_found = checkAliases(alias_re, filename)
|
||||
found.extend([(filename, n, a) for (n, a) in file_found])
|
||||
return found
|
||||
|
||||
def dumpResults(aliases, found, out=sys.stdout):
|
||||
for filename, n, a in found:
|
||||
print >>out, "%s:%d %s -> %s" % (filename, n, a, aliases[a])
|
||||
|
||||
def main(alias_file, *filenames):
|
||||
aliases = parseFileName(alias_file)
|
||||
alias_re = getAliasRE(aliases)
|
||||
found = checkAliasesFiles(alias_re, filenames)
|
||||
dumpResults(aliases, found)
|
||||
return found
|
||||
|
||||
if __name__ == '__main__':
|
||||
found = main(*sys.argv[1:])
|
||||
if found:
|
||||
sys.exit(1)
|
||||
12
modules/member/php-openid-1.2.3/admin/prepare-release
Normal file
12
modules/member/php-openid-1.2.3/admin/prepare-release
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# Prepare this repository for release
|
||||
|
||||
REPO_ROOT=$(dirname $(dirname $(readlink --canonicalize "$0")))
|
||||
cd "$REPO_ROOT"
|
||||
|
||||
bash ./admin/fixperms
|
||||
|
||||
./admin/makedoc.sh
|
||||
|
||||
darcs changes --from-tag=. --summary > CHANGELOG
|
||||
64
modules/member/php-openid-1.2.3/admin/runtests
Normal file
64
modules/member/php-openid-1.2.3/admin/runtests
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
HERE=$(readlink --canonicalize $(dirname "$0"))
|
||||
|
||||
test_import () {
|
||||
./admin/checkimports
|
||||
}
|
||||
|
||||
test_tabs () {
|
||||
/usr/bin/env bash "$HERE/notabs"
|
||||
}
|
||||
|
||||
test_longlines () {
|
||||
/usr/bin/env bash "$HERE/nolonglines"
|
||||
}
|
||||
|
||||
test_nobadbraces () {
|
||||
/usr/bin/env bash "$HERE/nobadbraces"
|
||||
}
|
||||
|
||||
test_nobadcase () {
|
||||
/usr/bin/env bash "$HERE/nobadcase"
|
||||
}
|
||||
|
||||
test_opentag () {
|
||||
/usr/bin/env bash "$HERE/open_tag"
|
||||
}
|
||||
|
||||
test_docblocks () {
|
||||
/usr/bin/env bash "$HERE/docblocks"
|
||||
}
|
||||
|
||||
test_php () {
|
||||
if uname -a | grep -i cygwin >/dev/null 2>/dev/null ; then
|
||||
/usr/bin/env php "$(dirname "$0")/texttest.php" --insecure-rand
|
||||
else
|
||||
/usr/bin/env php "$HERE/texttest.php"
|
||||
fi
|
||||
}
|
||||
|
||||
tests="tabs longlines nobadbraces nobadcase opentag docblocks php import"
|
||||
|
||||
failures=
|
||||
|
||||
# Run in repository root (parent of this directory)
|
||||
cd $(dirname "$HERE")
|
||||
|
||||
chmod +x ./admin/fixperms
|
||||
./admin/fixperms
|
||||
|
||||
for test_name in $tests
|
||||
do
|
||||
echo "Running test $test_name" 1>&2
|
||||
if ! eval "test_$test_name"
|
||||
then
|
||||
failures="$failures $test_name"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ! -z "$failures" ]
|
||||
then
|
||||
echo "Failures in: $failures" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
173
modules/member/php-openid-1.2.3/admin/texttest.php
Normal file
173
modules/member/php-openid-1.2.3/admin/texttest.php
Normal file
|
|
@ -0,0 +1,173 @@
|
|||
<?php
|
||||
|
||||
require_once 'Tests/TestDriver.php';
|
||||
require_once 'PHPUnit/TestResult.php';
|
||||
require_once 'Console/Getopt.php';
|
||||
|
||||
class TextTestResult extends PHPUnit_TestResult {
|
||||
function addError(&$test, &$t)
|
||||
{
|
||||
parent::addError($test, $t);
|
||||
echo "E";
|
||||
}
|
||||
|
||||
function addFailure(&$test, &$t)
|
||||
{
|
||||
parent::addFailure($test, $t);
|
||||
echo "F";
|
||||
}
|
||||
|
||||
function addPassedTest(&$test)
|
||||
{
|
||||
parent::addPassedTest($test);
|
||||
echo ".";
|
||||
}
|
||||
|
||||
function dumpBadResults()
|
||||
{
|
||||
foreach ($this->failures() as $failure) {
|
||||
echo $failure->toString();
|
||||
}
|
||||
|
||||
foreach ($this->errors() as $failure) {
|
||||
echo $failure->toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function microtime_float()
|
||||
{
|
||||
list($usec, $sec) = explode(" ", microtime());
|
||||
return ((float)$usec + (float)$sec);
|
||||
}
|
||||
|
||||
$longopts = array('no-math',
|
||||
'math-lib=',
|
||||
'insecure-rand',
|
||||
'thorough');
|
||||
|
||||
$con = new Console_Getopt;
|
||||
$args = $con->readPHPArgv();
|
||||
array_shift($args);
|
||||
$options = $con->getopt2($args, "", $longopts);
|
||||
|
||||
if (PEAR::isError($options)) {
|
||||
print $options->message . "\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
list($flags, $tests_to_run) = $options;
|
||||
|
||||
$math_type = array();
|
||||
$thorough = false;
|
||||
foreach ($flags as $flag) {
|
||||
list($option, $value) = $flag;
|
||||
switch ($option) {
|
||||
case '--insecure-rand':
|
||||
define('Auth_OpenID_RAND_SOURCE', null);
|
||||
break;
|
||||
case '--no-math':
|
||||
define('Auth_OpenID_NO_MATH_SUPPORT', true);
|
||||
break;
|
||||
case '--math-lib':
|
||||
$math_type[] = $value;
|
||||
break;
|
||||
case '--thorough':
|
||||
define('Tests_Auth_OpenID_thorough', true);
|
||||
break;
|
||||
default:
|
||||
print "Unrecognized option: $option\n";
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
// ******** Math library selection ***********
|
||||
|
||||
if ($math_type) {
|
||||
if (defined('Auth_OpenID_NO_MATH_SUPPORT')) {
|
||||
print "--no-math and --math-lib are mutually exclusive\n";
|
||||
exit(1);
|
||||
}
|
||||
require_once('Auth/OpenID/BigMath.php');
|
||||
$new_extensions = array();
|
||||
foreach ($math_type as $lib) {
|
||||
$found = false;
|
||||
foreach ($_Auth_OpenID_math_extensions as $ext) {
|
||||
if ($ext['extension'] == $lib) {
|
||||
$new_extensions[] = $ext;
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$found) {
|
||||
print "Unknown math library specified: $lib\n";
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
$_Auth_OpenID_math_extensions = $new_extensions;
|
||||
}
|
||||
|
||||
// ******** End math library selection **********
|
||||
|
||||
$suites = loadSuite($argv);
|
||||
|
||||
$totals = array(
|
||||
'run' => 0,
|
||||
'error' => 0,
|
||||
'failure' => 0,
|
||||
'time' => 0
|
||||
);
|
||||
|
||||
foreach ($suites as $suite) {
|
||||
$name = $suite->getName();
|
||||
echo "==========================================
|
||||
Test suite: $name
|
||||
------------------------------------------
|
||||
";
|
||||
|
||||
$result = new TextTestResult();
|
||||
$before = microtime_float();
|
||||
$suite->run($result);
|
||||
$after = microtime_float();
|
||||
|
||||
$run = $result->runCount();
|
||||
$error = $result->errorCount();
|
||||
$failure = $result->failureCount();
|
||||
$delta = $after - $before;
|
||||
$totals['run'] += $run;
|
||||
$totals['error'] += $error;
|
||||
$totals['failure'] += $failure;
|
||||
$totals['time'] += $delta;
|
||||
$human_delta = round($delta, 3);
|
||||
echo "\nRan $run tests in $human_delta seconds";
|
||||
if ($error || $failure) {
|
||||
echo " with $error errors, $failure failures";
|
||||
}
|
||||
echo "
|
||||
==========================================
|
||||
|
||||
";
|
||||
|
||||
$failures = $result->failures();
|
||||
foreach($failures as $failure) {
|
||||
$test = $failure->failedTest();
|
||||
$testName = $test->getName();
|
||||
$exception = $failure->thrownException();
|
||||
echo "* Failure in $testName: $exception
|
||||
|
||||
";
|
||||
}
|
||||
}
|
||||
|
||||
$before = microtime_float();
|
||||
$run = $totals['run'];
|
||||
$error = $totals['error'];
|
||||
$failure = $totals['failure'];
|
||||
$time = round($totals['time'], 3);
|
||||
echo "Ran a total of $run tests in $time seconds with $error errors, $failure failures\n";
|
||||
if ($totals['error'] || $totals['failure']) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
<refentry id="{@id}">
|
||||
<refnamediv>
|
||||
<refname>PHP OpenID API</refname>
|
||||
|
||||
</refnamediv>
|
||||
<refsynopsisdiv>
|
||||
<author>
|
||||
JanRain, Inc.
|
||||
<authorblurb>
|
||||
{@link mailto:openid@janrain.com openid@janrain.com}
|
||||
</authorblurb>
|
||||
</author>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<para>
|
||||
This is a complete implementation of the OpenID authentication
|
||||
protocol. This package contains:
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>An OpenID server</listitem>
|
||||
<listitem>An OpenID consumer</listitem>
|
||||
<listitem>Stores for MySQL, PostgreSQL, SQLite, and filesystem-based OpenID data storage</listitem>
|
||||
<listitem>PHPUnit unit tests</listitem>
|
||||
<listitem>An example server and consumer</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
|
||||
<refsect1 id="{@id users}">
|
||||
<title>For Package Users</title>
|
||||
|
||||
<para>
|
||||
To install this package, copy the <literal>Auth/</literal>
|
||||
directory in this package to a directory in your PHP include path.
|
||||
Alternatively, modify your PHP include path to include the
|
||||
directory that contains <literal>Auth/</literal>. Any
|
||||
applications that need this package will then be able to use it.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id="{@id developers}">
|
||||
<title>For Developers</title>
|
||||
|
||||
<para>
|
||||
|
||||
See the server and consumer examples in the
|
||||
<literal>examples/</literal> directory of the package. For
|
||||
details on how to run the examples, see
|
||||
<literal>examples/README</literal>. If you want to create your
|
||||
own OpenID data storage class, please see the {@link Auth_OpenID_OpenIDStore}
|
||||
class.
|
||||
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id="{@id references}">
|
||||
<title>References</title>
|
||||
<para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
{@link http://www.openidenabled.com/openid/libraries/php PHP OpenID Library}
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
{@link http://www.janrain.com JanRain, Inc.}
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
{@link http://lists.openidenabled.com/mailman/listinfo/dev OpenID Development Discussion List}
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
{@link http://www.openidenabled.com/yadis/libraries/php PHP Yadis Library}
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
12
modules/member/php-openid-1.2.3/admin/webtest.php
Normal file
12
modules/member/php-openid-1.2.3/admin/webtest.php
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
require_once 'Tests/TestDriver.php';
|
||||
|
||||
$suites = loadSuite();
|
||||
|
||||
// Create and run the user interface
|
||||
$gui = new PHPUnit_GUI_HTML();
|
||||
$gui->addSuites($suites);
|
||||
$gui->show();
|
||||
|
||||
?>
|
||||
55
modules/member/php-openid-1.2.3/admin/xmlconfig.py
Normal file
55
modules/member/php-openid-1.2.3/admin/xmlconfig.py
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
|
||||
"""
|
||||
This is the package.xml data needed for the PHP OpenID PEAR
|
||||
package.xml file. Use the 'packagexml.py' program to generate a
|
||||
package.xml file for a release of this library.
|
||||
"""
|
||||
|
||||
# This is a list of dicts describing the project leads. This will be
|
||||
# used to generate <lead> XML elements.
|
||||
leads = [
|
||||
{'name': 'Jonathan Daugherty',
|
||||
'user': 'cygnus',
|
||||
'email': 'cygnus@janrain.com',
|
||||
'active': 'yes'},
|
||||
{'name': 'Josh Hoyt',
|
||||
'user': 'jhoyt',
|
||||
'email': 'josh@janrain.com',
|
||||
'active': 'yes'}
|
||||
]
|
||||
|
||||
# The package name.
|
||||
package_name = 'Auth_OpenID'
|
||||
|
||||
# The package description.
|
||||
package_description = 'An implementation of the OpenID single sign-on authentication protocol.'
|
||||
|
||||
# Package summary.
|
||||
package_summary = 'PHP OpenID'
|
||||
|
||||
# License string.
|
||||
license_name = 'LGPL'
|
||||
|
||||
# License URI.
|
||||
license_uri = 'http://www.gnu.org/copyleft/lesser.txt'
|
||||
|
||||
# Director(ies) containing package source, relative to the admin/
|
||||
# directory. All .php files in these directories will be included in
|
||||
# the <contents> element of the output XML and will be assigned the
|
||||
# role 'php'.
|
||||
contents_dirs = ['../Auth', '../Services']
|
||||
|
||||
# Director(ies) containing package documentation. All files and
|
||||
# subdirectories in these directories will be included in the
|
||||
# <contents> element in the output XML and will be assigned the role
|
||||
# 'doc'.
|
||||
docs_dirs = ['../doc', '../examples']
|
||||
|
||||
# The HTTP package base URI. This is the place on the web where the
|
||||
# PEAR-installable tarballs will live, and this (plus the package
|
||||
# tarball name) will be the URL that users pass to "pear install".
|
||||
package_base_uri = 'http://www.openidenabled.com/resources/downloads/php-openid/pear/'
|
||||
|
||||
# The release stability. Maybe this should be a commandline parameter
|
||||
# since it might differ from release to release.
|
||||
release_stability = 'stable'
|
||||
Loading…
Add table
Add a link
Reference in a new issue