We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 39742
    • 29 Posts
    Hello.
    I'm trying to build my first package in modx following the "Developing an Extra in MODX Revolution" tutorial.
    I'm having an hard time with paths and files not being found.
    The package project is outside modx root folder as in the doodles example. It is in a sibling folder to the modx instalation.

    Following the doodles example I defined MODX_BASE_PATH like this:
    define('MODX_BASE_PATH', dirname(dirname(dirname(dirname(__FILE__)))) . '/modx-2.2.1-pl/');
    This defines path as a "C:\xampp\htdocs\modx-2.2.1-pl" that doesn't seams to work.

    I changed it to simply '/modx-2.2.1-pl/' but then I get an error in the modx class saying "Could not load MODX config file."
    The path used in the modx.class.php is "/modx-2.2.1-pl/core/config/config.inc.php"
    It seams correct. Why can't it include de file?
    The build.schema.php includes "/modx-2.2.1-pl/core/model/modx/modx.class.php" with no problems.

    I just don't understand how this absolute paths are supposed to work :-(
    Aren't these paths absolute?
    Could someone tell me what I'm missing where?

    Thanks


      • 39742
      • 29 Posts
      either file_exists and is_dir in modx and xpdo classes are returning false were they shouldn't
      but actual include are working for those same paths.
      The problem seams that "\" isn't being recognized as the apache document root in file_exists and is_dir.
      Can someone help me?
      I'm fairly new to this web development area...
      Thanks
        • 39742
        • 29 Posts
        never mind found it...
        There was an extra "dirname" in the code below:
        define('MODX_BASE_PATH', dirname(dirname(dirname(dirname(__FILE__)))) . '/modx-2.2.1-pl/');
        was defining "C:\xampp\modx-2.2.1-pl\" and not "C:\xampp\htdocs\modx-2.2.1-pl\"
        Sorry.. :-(