mayflower/PHP_CodeBrowser

Windows incompatibility

renecatharsis opened this issue · 0 comments

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.