function migrate_memory_read in Migrate 7.2
Same name and namespace in other branches
- 6.2 migrate.module \migrate_memory_read()
Read the current memory value without recording the change.
Parameters
name: The name of the memory measurement.
Return value
The change in bytes since the last start.
1 call to migrate_memory_read()
File
- ./
migrate.module, line 506 - API and drush commands to support migration of data from external sources into a Drupal installation.
Code
function migrate_memory_read($name) {
global $_migrate_memory;
if (isset($_migrate_memory[$name]['start'])) {
$stop = memory_get_usage();
$diff = $stop - $_migrate_memory[$name]['start'];
if (isset($_migrate_memory[$name]['bytes'])) {
$diff += $_migrate_memory[$name]['bytes'];
}
return $diff;
}
return $_migrate_memory[$name]['bytes'];
}