public function __call($name, $arguments) { $config = reset($arguments); if (true === isset($config['do_import']) && false === $config['do_import']) { $this->markAsSkipped('`' . str_replace('import', '', $name) . '`'); } $key = 0 === strpos($name, 'import') ? strtolower(str_replace('import', '', $name)) : ''; if ($key !== '') { $connectorName = '\\BackBee\\Importer\\Connector\\' . $config['connector']; $connector = new $connectorName($this->_application, $this->_config->getSection($config['config'])); $importer = new Importer($this->_application, $connector, $this->_config); $flushEvery = array_key_exists('flush_every', $config) ? (int) $config['flush_every'] : 1000; $checkForExisting = array_key_exists('check_exists', $config) ? (bool) $config['check_exists'] : true; $importer->run($key, $config, $flushEvery, $checkForExisting); unset($connector); unset($importer); } }
public static function getPhpMemoryUsage() { return \BackBee\Importer\Importer::convertMemorySize(memory_get_usage(true)); }