|
@ -44,6 +44,7 @@ class Engine |
|
|
* Process a domdocument, applying some higher level operations such as |
|
|
* Process a domdocument, applying some higher level operations such as |
|
|
* stacking documents. |
|
|
* stacking documents. |
|
|
* |
|
|
* |
|
|
|
|
|
* @todo break all this stuff out |
|
|
* @param string $input_file |
|
|
* @param string $input_file |
|
|
* @param IOptions $options |
|
|
* @param IOptions $options |
|
|
* @return string |
|
|
* @return string |
|
@ -78,8 +79,9 @@ class Engine |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Go through and load all the variables |
|
|
// Go through and load all the variables and parameters |
|
|
$variables = []; |
|
|
$variables = []; |
|
|
|
|
|
$parameters = []; |
|
|
for ($i = 0; $i < sizeof($files); $i++) |
|
|
for ($i = 0; $i < sizeof($files); $i++) |
|
|
{ |
|
|
{ |
|
|
$file_variables = []; |
|
|
$file_variables = []; |
|
@ -95,6 +97,20 @@ class Engine |
|
|
{ |
|
|
{ |
|
|
$variables[$k] = $v; |
|
|
$variables[$k] = $v; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$file_parameters = []; |
|
|
|
|
|
try |
|
|
|
|
|
{ |
|
|
|
|
|
$file_parameters = $documents[$files[$i]]->getMeta('parameters'); |
|
|
|
|
|
} |
|
|
|
|
|
catch (\Exception $ex) |
|
|
|
|
|
{ |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
foreach ($file_parameters as $k => $v) |
|
|
|
|
|
{ |
|
|
|
|
|
$parameters[$k] = $v; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
foreach ($variables as $k => $v) |
|
|
foreach ($variables as $k => $v) |
|
@ -105,6 +121,14 @@ class Engine |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
foreach ($parameters as $k => $v) |
|
|
|
|
|
{ |
|
|
|
|
|
if (!$options->hasParameter($k)) |
|
|
|
|
|
{ |
|
|
|
|
|
$options->setParameter($k, $v); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// Now actually process all the documents |
|
|
// Now actually process all the documents |
|
|
for ($i = 0; $i < sizeof($files); $i++) |
|
|
for ($i = 0; $i < sizeof($files); $i++) |
|
|
{ |
|
|
{ |
|
|