Function Hook_cron_cache_cleanup->compare_filetime

Definitions

sources/hooks/systems/cron/cache_cleanup.php

  • Callback for sorting an array of file paths by filemtime and fileatime, whichever is newest.A newer filemtime represents a cache which has recently been made and likely to be used, thus not stale.And a newer fileatime represents a cache which has recently been used and thus also not yet stale.
  • Visibility: protected
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: int

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$a URLPATH No No required parameter N/A N/A The relative path of file A
$b string No No required parameter N/A N/A The relative path of file B

Returns

  • The comparison order directive
  • Type: integer
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Callback for sorting an array of file paths by filemtime and fileatime, whichever is newest.A newer filemtime represents a cache which has recently been made and likely to be used, thus not stale.And a newer fileatime represents a cache which has recently been used and thus also not yet stale.
 *
 * @param  URLPATH $a The relative path of file A
 * @param  string $b The relative path of file B
 * @return integer The comparison order directive
 */

protected function compare_filetime(string $a, string $b) : int