Skip to content
This repository was archived by the owner on Jan 22, 2018. It is now read-only.

Commit 7f09bae

Browse files
sullrichsullrich
sullrich
authored and
sullrich
committed
Adding xmlrpc server code that is in use on www.pfense.org
0 parents  commit 7f09bae

24 files changed

+9183
-0
lines changed

PEAR.inc

+1,086
Large diffs are not rendered by default.

PEAR.php

+1,086
Large diffs are not rendered by default.

array_intersect_key.php

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?php
2+
// +----------------------------------------------------------------------+
3+
// | PHP Version 4 |
4+
// +----------------------------------------------------------------------+
5+
// | Copyright (c) 1997-2004 The PHP Group |
6+
// +----------------------------------------------------------------------+
7+
// | This source file is subject to version 3.0 of the PHP license, |
8+
// | that is bundled with this package in the file LICENSE, and is |
9+
// | available at through the world-wide-web at |
10+
// | http://www.php.net/license/3_0.txt. |
11+
// | If you did not receive a copy of the PHP license and are unable to |
12+
// | obtain it through the world-wide-web, please send a note to |
13+
// | [email protected] so we can mail you a copy immediately. |
14+
// +----------------------------------------------------------------------+
15+
// | Authors: Aidan Lister <[email protected]> |
16+
// +----------------------------------------------------------------------+
17+
//
18+
// $Id: array_intersect_key.php,v 1.4 2005/01/26 04:55:13 aidan Exp $
19+
20+
21+
/**
22+
* Replace array_intersect_key()
23+
*
24+
* @category PHP
25+
* @package PHP_Compat
26+
* @link http://php.net/function.array_intersect_key
27+
* @author Tom Buskens <[email protected]>
28+
* @version $Revision: 1.4 $
29+
* @since PHP 5.0.2
30+
* @require PHP 4.0.0 (user_error)
31+
*/
32+
if (!function_exists('array_intersect_key')) {
33+
function array_intersect_key()
34+
{
35+
$args = func_get_args();
36+
if (count($args) < 2) {
37+
user_error('Wrong parameter count for array_intersect_key()', E_USER_WARNING);
38+
return;
39+
}
40+
41+
// Check arrays
42+
$array_count = count($args);
43+
for ($i = 0; $i !== $array_count; $i++) {
44+
if (!is_array($args[$i])) {
45+
user_error('array_intersect_key() Argument #' .
46+
($i + 1) . ' is not an array', E_USER_WARNING);
47+
return;
48+
}
49+
}
50+
51+
// Compare entries
52+
$result = array();
53+
foreach ($args[0] as $key1 => $value1) {
54+
for ($i = 1; $i !== $array_count; $i++) {
55+
foreach ($args[$i] as $key2 => $value2) {
56+
if ((string) $key1 === (string) $key2) {
57+
$result[$key1] = $value1;
58+
}
59+
}
60+
}
61+
}
62+
63+
return $result;
64+
}
65+
}
66+
67+
?>

pkg_tester.php

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
/*
4+
* $Id: xmlrpc_tester.php,v 1.2 2005/03/29 03:33:41 colin Exp $
5+
* pfSense XMLRPC test program.
6+
* Colin Smith
7+
* *insert pfSense license etc here*
8+
*/
9+
10+
require_once("xmlrpc.inc");
11+
12+
function get_firmware_version($return_php = true) {
13+
global $g;
14+
$versioncheck_base_url = "www.pfsense.com";
15+
$versioncheck_path = "/pfSense/xmlrpc.php";
16+
$params = array(
17+
"pkg" => 'all',
18+
"info" => array('version', 'name')
19+
);
20+
$msg = new XML_RPC_Message('pfsense.get_pkgs', array(php_value_to_xmlrpc($params)));
21+
$cli = new XML_RPC_Client($versioncheck_path, $versioncheck_base_url);
22+
$resp = $cli->send($msg);
23+
$raw_versions = $resp->value();
24+
return xmlrpc_value_to_php($raw_versions);
25+
}
26+
27+
$versions = get_firmware_version();
28+
print_r($versions);
29+
?>
30+
31+

test.php

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
$foo = array("foo", "bar", "baz");
3+
unset($foo[1]);
4+
print_r(array_values($foo));
5+
?>

version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.64.1-TheRoadToBetaBetaBeta

0 commit comments

Comments
 (0)