Lines Matching defs:max

152         $rev = max(0, $rev);
212 $num = max($num, 0);
223 $first = max($first + 1, 0);
243 $finger = max($tail - $this->chunk_size, 0);
249 $finger = max($finger - $this->chunk_size, 0);
257 $read_size = max($tail - $finger, 0); // found chunk size
260 $tmp = @fread($fp, max(min($this->chunk_size, $read_size - $got), 0));
279 $finger = max($tail - $this->chunk_size, 0);
286 $num = max(min(count($lines) - $first, $num), 0);
288 $lines = array_slice($lines, max(count($lines) - $first - $num, 0), $num);
290 $lines = array_slice($lines, 0, max(count($lines) - $first, 0));
292 $lines = array_slice($lines, max(count($lines) - $num, 0));
325 $rev = max($rev, 0);
386 * When available it returns $max entries for each revision
390 * @param int $max maximum number of revisions returned
393 public function getRevisionsAround($rev1, $rev2, $max = 50)
395 $max = (int) (abs($max) / 2) * 2 + 1;
396 $rev1 = max($rev1, 0);
397 $rev2 = max($rev2, 0);
410 [$revs2, $allRevs, $fp, $lines, $head, $tail] = $this->retrieveRevisionsAround($rev2, $max);
418 [$revs1, , , , , ] = $this->retrieveRevisionsAround($rev1, $max);
431 if ($index > (int) ($max / 2)) {
443 $revs1 = array_slice($revs1, max($index - (int) ($max / 2), 0), $max);
471 * Collect the $max revisions near to the timestamp $rev
478 * @param int $max maximum number of revisions to be returned
481 * - $requestedRevs: array of with $max revision timestamps
489 protected function retrieveRevisionsAround($rev, $max)
499 //parse changelog lines in chunk, and read forward more chunks until $max/2 is reached
515 if ($afterCount > (int) ($max / 2)) {
527 $lastTail == $eof && $afterCount <= (int) ($max / 2) &&
539 //read more chunks backward until $max/2 is reached and total number of revs is equal to $max
553 if ($beforeCount > max((int) ($max / 2), $max - $afterCount)) {
565 $requestedRevs = array_slice($revs, -$max, $max);
631 'date' => max($lastRev + 1, time() - 1), // 1 sec before now or new page save