3 posts by 2 authors in: Forums > CMS Builder
Last Post: July 28, 2017   (RSS)

On line 11/12 of the permalinks dispatcher the following line cause xDebug to halt execution with a warning that file is not found during the include operation. Even though there is @ - ignore error - so it doesn't get logged, it is still technically a warning error.

$dirsToCheck = array('../','../../','../../../','../../../../');
foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}

Since the plugin is down two levels from lib, there is a minor performance increase if the dirsToCheck is altered a wee bit to move the second check to the beginning.

$dirsToCheck = array('../../','../','../../../','../../../../');

Jeff Shields

Hi Jeff, 

Hmm, interesting.  You could put a file_exists() check in there if it's causing a problem.  We're moving away from using the error suppression operator (@) so we'll probably rewrite that generic code at some point.  

Thanks for the feedback!

Dave Edis - Senior Developer

I just moved the ../../ to the first element of the array. Glad to hear you are moving away from @ operator. Much better to adjust the code so it isn't necessary.

Jeff Shields