Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AutoLoad not loading the classes. Uncaught Error: Class 'Esendex\Model\DispatchMessage' not found #44

Open
yet-another-steve opened this issue Oct 15, 2024 · 0 comments

Comments

@yet-another-steve
Copy link

I have the AutoLoad.php located here:
/path2website/classes/Esendex/AutoLoad.php
and get "Uncaught Error: Class 'Esendex\Model\DispatchMessage' not found"
this is caused in AutoLoad.php by the line
$path = ESENDEX_HOME . self::SPLIT_DIR . implode(self::SPLIT_DIR, $parts) . '.php';
creating a path to the class looking like this:
/path2website/classes/Esendex/Esendex/Model/DispatchMessage.php
Note the double /Esendex/ in the path.

I fixed it by removing the /Esendex from the static var ESENDEX_HOME by changing the define statement to this:
define('ESENDEX_HOME', str_replace(DIRECTORY_SEPARATOR."Esendex","", dirname(__FILE__)));
which then corrects the subsequent $path= assignment to
/path2website/classes/Esendex/Model/DispatchMessage.php

and all is well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant