Exemplo n.º 1
0
function BenchmarkXarrayIndexed(Benchmark $b)
{
    $index = makeIndexedArray(ARRSIZE);
    $assoc = makeAssocArray(ARRSIZE);
    $mixed = makeMixedArray(HALFSIZE);
    $b->resetTimer();
    for ($i = 0; $i < $b->N(); $i++) {
        array_is_indexed($index);
        array_is_indexed($assoc);
        array_is_indexed($mixed);
    }
}
Exemplo n.º 2
0
function makeMixedArray($halfSize)
{
    return array_merge(makeIndexedArray($halfSize), makeAssocArray($halfSize));
}
Exemplo n.º 3
0
     $unTranslatedAry[$m1['lid']] = $m1['source'];
     echo "unTranslatedAry[" . $m1['lid'] . "] = " . $m1['source'] . "\n";
     $batch .= "<div name=\"" . $separator . "\" id=\"" . $m1['lid'] . "\">" . $sourceString . "</div>\n";
 }
 mysql_free_result($r1);
 $batch .= "</div>";
 $lengthOfBatchString = strlen($batch);
 $msg = "batch = |{$batch}|\nLength={$lengthOfBatchString}\n\n";
 echo $msg;
 fwrite($error_log, $msg);
 // Send the batch, enclosed in <div>s, to translation
 if ($lengthOfBatchString > 11) {
     // Empty $batch = <div></div> ,   which is 11 chars
     $rawTranslatedArray = translateFrag($batch, 0, "STRING", $sovee_code);
     // Perform the translation
     $translatedArray = makeIndexedArray($rawTranslatedArray['content'], $separator);
     echo "=====================\n";
     echo "unTranslatedAry:\n";
     print_r($unTranslatedAry);
     echo "translatedArray:\n";
     print_r($translatedArray);
     // Inner loop #1. Get default values for any translation of these strings
     foreach ($translatedArray as $lidValue => $translatedText) {
         $q2 = "SELECT distinct plid, plural,i18n_status,l10n_status from locales_target where lid=\"{$lidValue}\"";
         $r2 = mysql_query($q2, $db);
         $numReturned = mysql_num_rows($r2) + 0;
         $plid = $plural = $i18n_status = $l10n_status = 0;
         if ($numReturned != 1) {
             $msg = "Query returned {$numReturned} rows for lid={$lidValue}\n   {$q2}\n";
             echo $msg;
             fwrite($error_log, $msg);