You are here

protected function MigrationBase::timeExceeded in Migrate 7.2

Same name and namespace in other branches
  1. 6.2 includes/base.inc \MigrationBase::timeExceeded()

Test whether we're approaching the PHP time limit.

Return value

boolean TRUE if the threshold is exceeded, FALSE if not.

1 call to MigrationBase::timeExceeded()
Migration::checkStatus in includes/migration.inc
Standard top-of-loop stuff, common between rollback and import - check for exceptional conditions, and display feedback.

File

includes/base.inc, line 1252
Defines the base class for migration processes.

Class

MigrationBase
The base class for all objects representing distinct steps in a migration process. Most commonly these will be Migration objects which actually import data from a source into a Drupal destination, but by deriving classes directly from MigrationBase…

Code

protected function timeExceeded() {
  if ($this->timeLimit == 0) {
    return FALSE;
  }
  $time_elapsed = time() - REQUEST_TIME;
  $pct_time = $time_elapsed / $this->timeLimit;
  if ($pct_time > $this->timeThreshold) {
    return TRUE;
  }
  else {
    return FALSE;
  }
}