PHP Classes

Bug report - "Notice: Undefined variable: result in ..."

Recommend this page to a friend!

      PHP Recreate Tree  >  All threads  >  Bug report - "Notice: Undefined...  >  (Un) Subscribe thread alerts  
Subject:Bug report - "Notice: Undefined...
Summary:a little correction
Messages:2
Author:Aldemar Calazans Filho
Date:2016-10-28 17:48:34
 

  1. Bug report - "Notice: Undefined...   Reply   Report abuse  
Picture of Aldemar Calazans Filho Aldemar Calazans Filho - 2016-10-28 17:48:34
Hi.

I tested your code duplicating my html folder in a Xammpp for Windows install, as follows:

- put all your files inside \html\recreate-tree\
- set source as '..\..\html'
- set destination '..\..\html-copy'

It worked well, but returned:

Notice: Undefined variable: result in D:\Var\www\html\recreate-tree\Class.RecreateTree.php on line 188

To solve this problem, I modified your code, adding one line defining $result variable as NULL, as follows:

$result = NULL; // the line I added
foreach($arrBytes as $val) { // line of your code

By the way: the code is not accepting some combinations of slash to define the paths (the one I showed you is an exception)

  2. Re: Bug report - "Notice: Undefined...   Reply   Report abuse  
Picture of Alessandro Quintiliani Alessandro Quintiliani - 2016-10-29 17:46:25 - In reply to message 1 from Aldemar Calazans Filho
Hello Aldemar

thank you for your notice. I have modified the class RecreateTree just placing a header directive 'error_reporting' at the top of the class; I had tested it earlier on my Windows 7 pc and the warning message was suppressed after this modification.

I am aware of an exception raised on some path patterns; I will modify the class as soon as I can to have the 'dotted' format accepted too.

Regards

Alessandro Quintiliani