/usr/share/php/irods/prods/src/packet/RP_KeyValPair.class.php is in php-irods-prods 3.3.0~beta1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | <?php
require_once(dirname(__FILE__) . "/../autoload.inc.php");
class RP_KeyValPair extends RODSPacket
{
public function __construct($ssLen = 0, array $keyWord = array(), array $svalue = array())
{
if ($ssLen < 1) {
$keyWord = NULL;
$svalue = NULL;
}
$packlets = array("ssLen" => $ssLen, 'keyWord' => $keyWord,
'svalue' => $svalue);
parent::__construct("KeyValPair_PI", $packlets);
}
public function fromAssocArray(array $array)
{
if (!empty($array)) {
$this->packlets["ssLen"] = count($array);
$this->packlets["keyWord"] = array_keys($array);
$this->packlets["svalue"] = array_values($array);
} else {
$this->packlets["ssLen"] = 0;
$this->packlets["keyWord"] = array();
$this->packlets["svalue"] = array();
}
}
public function fromRODSQueryConditionArray($array)
{
$this->packlets["ssLen"] = 0;
$this->packlets["keyWord"] = array();
$this->packlets["svalue"] = array();
if (!isset($array)) return;
$this->packlets["ssLen"] = count($array);
foreach ($array as $cond) {
$this->packlets["keyWord"][] = $cond->name;
$this->packlets["svalue"][] = "$cond->op '$cond->value'";
}
}
}
?>
|