We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31410
    • 66 Posts
    hi
    had a problem with load class in server which worked fine in my local server

    if (!$this->modx->loadClass(’request.mgrRequestController’,$this->config[’model_path’],true,true)) {
    return ’Could not load request handler.’;
    }

    worked fine in my local server
    but on main server the class is not loading
    if i use require once its working fine like
    [require_once($this->config[’model_path’].’request/mgrRequestController.class.php’);
    $this->request = new mgrRequestController($this);


    why it was happening like that

    will the load class depends on server environment or...

    how can i fix this

    some help is appricated

    thanks
      • 21257 MODX Staff
      • 730 Posts
      Try renaming the file all lowercase. The loadClass method lowercases the class names before it looks for them on the filesystem.
      I’m guessing that a mixed-case class filename would work on Windows, but not elsewhere.
        Mike Schell
        Lead Developer, MODX Cloud
        Email: [email protected]
        GitHub: https://github.com/netProphET/
        Twitter: @mkschell
        • 31410
        • 66 Posts
        thx netprophet
        yes the problem is with mixed case naming of file

        now its fixed

        thanks for your help