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
Class not found using Composer autoloading on Eclipse Neon #263
Comments
On 7 mars 2017, at 3:15, P. Mergey ***@***.***> wrote:
use Michelf\Markdown;
The first idea that comes to mind is that maybe you should try prefixing the namespace with a backslash to be sure to start from the root:
use \Michelf\Markdown;
…--
Michel Fortin
https://michelf.ca
|
The formulation |
In addition, I wish to precise that, to ensure the autoload file was updated correctly, I have also executed the CLI |
I am continuing my tests, rebuilding my project from scratch to check I have rightly followed all the steps. As I still get the same error, I have tried to use your This time, I get the following messages:
Although, if I paste the folder If I understand correctly, as the function |
It's possible that the one-line autoloader bundled in the Readme.php file behaves a bit differently than the one from Composer when it does not find the file it attempts to load. But the "Fatal error: Class 'Michelf\Markdown' not found" could also mean you don't have any autoloader in place when attempting to use the class. Note that you can bypass autoloading and directly include what you need with:
I doubt very much this is a problem with the package. I'd have heard many more complains by now if this was the case. |
As nor the specific autoloader from (I know that I can use the more classic system, such as I think I have to agree with you: my problem seems to be not directly related with your package. I suppose that I certainly made a mistake within my settings (even if I can not totally exclude an issue with Eclipse Neon PDT or its Composer support). Accordingly, I close this issue (as not related with your package) and I ask a more generic question in order to find what could be the cause of this problem. Thanks for your attention. |
It seems incredible, but I had only forgotten to add It is so obvious that I don't know how I have missed that... 😒 |
User of the classic version of PHP Markdown since more 5 years, I am currently trying to work with the most recent PHP Markdown Lib for a new project, using Composer on Eclipse Neon (with Composer Eclipse Plugin).
I think that I had not getting problem for configuring the
require
setting, as running Composer correctly updates dependencies using:As described in the Usage section of the documentation, I setup a PSR-0-compatible autoloader in my
composer.json
and generated theautoload
file:On my PHP file, I have simply included the following:
All seem to be correctly recognized by Eclipse:
namespace
andclass
rightly appears as autocomplete propositions (first screenshot)But, despite all my testings with these settings, my page is still displaying:
I supposed my problem is not really related with this previous issue, and I am not far to think that it is not a problem with the library as such, but rather that I made wrongly something during my configuration: I think having followed all the required steps but I do not find where is my potential mistake...
Thanks for helping.
The text was updated successfully, but these errors were encountered: