Add debug information to import routine.

This commit is contained in:
James Cole 2018-02-04 08:14:22 +01:00
parent f1d77bdb50
commit 28579f7b80
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
3 changed files with 9 additions and 1 deletions

View File

@ -100,6 +100,7 @@ class IndexController extends Controller
$config['initial-config-complete'] = false;
$config['has-file-upload'] = false;
$config['delimiter'] = "\t" === $config['delimiter'] ? 'tab' : $config['delimiter'];
unset($config['stage']);
$result = json_encode($config, JSON_PRETTY_PRINT);
$name = sprintf('"%s"', addcslashes('import-configuration-' . date('Y-m-d') . '.json', '"\\'));

View File

@ -225,11 +225,17 @@ class ImportJobRepository implements ImportJobRepositoryInterface
$configFileObject = new SplFileObject($file->getRealPath());
$configRaw = $configFileObject->fread($configFileObject->getSize());
$configuration = json_decode($configRaw, true);
Log::debug(sprintf('Raw configuration is %s', $configRaw));
if (null !== $configuration && is_array($configuration)) {
Log::debug('Found configuration', $configuration);
$this->setConfiguration($job, $configuration);
}
if (null === $configuration) {
Log::error('Uploaded configuration is NULL');
}
if (false === $configuration) {
Log::error('Uploaded configuration is FALSE');
}
}
return true;

View File

@ -113,6 +113,7 @@ class Initial implements ConfigurationInterface
// process config, if present:
if (isset($data['configuration_file'])) {
Log::debug('Will also upload configuration.');
$this->repository->processConfiguration($this->job, $data['configuration_file']);
}