Archive for May, 2013

Oracle RightNow getNamedValues, get all possible values for answer Object attributes, re-making the console

Thursday, May 16th, 2013

$fields = array(“AccessLevels”, “AnswerType”,”Language”, “StatusWithType.Status”, “Categories”, “Products”);
foreach($fields as $key => $field){
$temp = array();
$$field = array();
$parameter = RNCPHP\ConnectAPI::getNamedValues(“RightNow\\Connect\\v1_2\\Answer”, $field);
foreach($parameter as $key => $value){
$temp[$value->ID] = $value->LookupName;
}
$$field = $temp;
if($field == ‘StatusWithType.Status’){ $StatusWithType = $temp; }
}
// Prove it
foreach($StatusWithType as $key => $value){ echo $key . “, ” . $value . “<br />”; }

// Now fill in the answer creation/edit form values with these values

Perform a simple load test of a script

Wednesday, May 1st, 2013

Install xampp

command line: C:\xampp\apache\bin>ab.exe -n 20 -c 5 “URL”

 

Test Script Execution Time

Wednesday, May 1st, 2013

// start timing

$mtime = microtime();
$mtime = explode(” “,$mtime);
$mtime = $mtime[1] + $mtime[0];
$starttime = $mtime;

// code to execute

Code to Execute HERE

// revisit timer

$mtime = microtime();
$mtime = explode(” “,$mtime);
$mtime = $mtime[1] + $mtime[0];
$endtime = $mtime;
$totaltime = number_format(($endtime – $starttime),5);

echo “<br /><span style=’display:none;’>Script executed in ” . $totaltime . ” microseconds</span>”;
echo “<br /><span style=’display:none;’>Using ” . memory_get_peak_usage(1) . ” bytes of ram</span>”;