Quote:
|
Originally Posted by MrToast
Code:
function getInfo() {
$snapshot = $this->getSnapshot(GM_STANDARD);
$info = array();
if ($snapshot) {
$info["quota"]["MB"] = $snapshot->quota_mb;
$info["quota"]["Percentage"] = $snapshot->quota_per;
$info["invitations"] = $snapshot->have_invit;
$info["labels"] = $snapshot->label_list;
$info["total"] = $snapshot->box_total;
}
return $info;
}
|
When you call getSnapshot, your only have the $type parameter set (GM_STANDARD), but in the class GMailSnapshot constructor it also has a $raw parameter. There is an if statement which decides whether or not to set $this->have_invit;
Code:
if (isset($raw["i"][1])) $this->have_invit = $raw["i"][1];
But, $raw isn't set. Maybe try something like
Code:
function getInfo() {
$raw = array(
"i" => array(TRUE),
"gn" => array(TRUE),
"v" => array(TRUE)
);
$snapshot = $this->getSnapshot(GM_STANDARD);
$info = array();
if ($snapshot) {
$info["quota"]["MB"] = $snapshot->quota_mb;
$info["quota"]["Percentage"] = $snapshot->quota_per;
$info["invitations"] = $snapshot->have_invit;
$info["labels"] = $snapshot->label_list;
$info["total"] = $snapshot->box_total;
}
return $info;
}
That array setup may be fubar, as I've never dealt with multi-dimensional arrays in this sense...
EDIT (Again): Just looked over the code, and $this->have_invit is set from the array put in as a parameter, so I don't think you can get the amount of invites from calling this function =(
Maybe some creative use of
sockets and
regular expression functions would let you parse the info out?