Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
Hi,
I installed the trial version of phpdocx in a folder named "phpdocx". The check.php says OK for everything.
When i try the example "replaceVariableByText", it works fine, i got the generated log and docx file.
However, when i try to do it from a script of mine (located at the same level as phpdocx folder), i got this error :
Undefined variable: phpdocxconfig : phpdocx/classes/CreateDocx.inc, line 3277
Here is my test code :
require_once 'phpdocx/classes/CreateDocx.inc' ;
function doTheReplace($templateFile, $toFile, $data) {
$docx = new CreateDocxFromTemplate($templateFile);
$docx->replaceVariableByText($data, array('parseLineBreaks' =>true) );
$docx->createDocx($toFile);
}
If i check line 3277 in CreateDocx.inc, this is what i see :
$this->addProperties(array('creator' => trim($phpdocxconfig['license']['email']), 'description' => str_rot13('Trarengrq ol CUCQbpK gevny irefvba')));
I didn't touch anything in the phpdocxconfig.ini file.
How can i solve this issue ?
Thanks :)
Hi again,
I managed to get my test code working.
The error i described disappeared when i removed this line of code from another included file of mine :
set_error_handler( "log_error" ); // where log_error is function defined just above