Mayflower/PHP_CodeBrowser — Issue #7: Windows incompatibility
Author: renecatharsis
Created: 2011-10-09 22:18:55+00:00
State: open

Hi,

in /src/CliController.php the following part does not work on Windows:

if (!defined('PHPCB_ROOT_DIR')) {
define('PHPCB_ROOT_DIR', dirname(__FILE__) . '/../');
}
if (!defined('PHPCB_TEMPLATE_DIR')) {
define('PHPCB_TEMPLATE_DIR', dirname(__FILE__) . '/../templates');
}

Windows cannot handle "./../" for paths.
Adding a "realpath" arround the path information solves the issue.

if (!defined('PHPCB_ROOT_DIR')) {
define('PHPCB_ROOT_DIR', realpath(dirname(__FILE__) . '/../'));
}
if (!defined('PHPCB_TEMPLATE_DIR')) {
define('PHPCB_TEMPLATE_DIR', realpath(dirname(__FILE__) . '/../templates'));
}

Haven't tested this on *nix, though.