You are here

function _git_deploy_datestamp_sync in Git Deploy 8.2

Same name and namespace in other branches
  1. 6.2 git_deploy.module \_git_deploy_datestamp_sync()
  2. 6 git_deploy.module \_git_deploy_datestamp_sync()
  3. 7.2 git_deploy.module \_git_deploy_datestamp_sync()
  4. 7 git_deploy.module \_git_deploy_datestamp_sync()

Syncs the project datestamp to the release datestamp.

Parameters

array $project: Project data. Datestamp will be synced if up to date with release.

array $release: Release data.

2 calls to _git_deploy_datestamp_sync()
git_deploy_system_info_alter in ./git_deploy.module
Implements hook_system_info_alter().
git_deploy_update_projects_alter in ./git_deploy.module
Implements hook_update_projects_alter().

File

./git_deploy.module, line 283
Adds project, version and date information to projects checked out with Git.

Code

function _git_deploy_datestamp_sync(array &$project, array $release) {

  // We need to compare commit time to release time because our remote tracking
  // branch could be out of date. Allow a 12 hour time difference between
  // release and last commit, because dev releases are packaged only twice a
  // day. Add a 100-second buffer to account for packaging time.
  if ($project['datestamp'] + 43200 + 100 > $release['date']) {

    // A dev release for the latest commit may be created later than an official
    // release, so use release time only if it is later than the commit time.
    $project['datestamp'] = max($release['date'], $project['datestamp']);
  }
}