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
Generation of autoloader incorrect #1710
Comments
Did you check that the vendors installed properly? In some rare cases it happens that something gets broken I think, and you might not have a complete assetic or something. |
Yes, i did. I multiple tried to remove the complete vendor directory and install it with composer again. |
sorry, clicked the wrong button... |
Well I'm unfortunately not sure what to tell you here. Which php version & OS are you running? |
Fedora 17 with php 5.4.9 and in my virtual machine Debian 6.0.7 with php 5.4.12 |
OK, not even old PHP.. I tried with your composer.json and I can load that assetic class just fine. |
I've come across the same issue with version 57c3403 of composer. Project structure
Composer file {
"autoload": {
"psr-0": {
"MyNamespace": "../common/src"
}
}
} Composer command
Actual result <?php
// autoload_namespaces.php generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'MyNamespace' => $baseDir . '/common/src',
); Expected result <?php
// autoload_namespaces.php generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
'MyNamespace' => $baseDir . '/../common/src',
); |
@donaldducky I pushed a fix for your issue (which is unrelated to the original problem of this ticket). @rejinka any luck getting things to work? |
@Seldaek Thanks for the fix! Do you have the version that fixes this? (ie. can I self-update?) I didn't create a new issue because this one sounded similar. |
Yup you can run self-update, it should fix it. |
Since this is open, I'll post here. I get similar "Class not found" errors on server (not on local machine). Composer is of the same version on both machines - 894f530. PHP version differs. Everything is okay on PHP 5.4.6 and the error triggers at PHP 5.3.13. composer.json (minified to only bogus library):
Files autoload_classmap.php are different. Here is the difference: - 'nusoap_base' => $vendorDir . '/nusphere/nusoap/lib/class.nusoap_base.php',
- 'nusoap_client' => $vendorDir . '/nusphere/nusoap/lib/class.soapclient.php',
+ 'nusoap_base' => $vendorDir . '/nusphere/nusoap/lib/nusoap.php',
+ 'nusoap_client' => $vendorDir . '/nusphere/nusoap/lib/nusoap.php',
...
- 'soapclient' => $vendorDir . '/nusphere/nusoap/lib/class.soapclient.php',
+ 'soapclient' => $vendorDir . '/nusphere/nusoap/lib/nusoap.php', nusoap.php file is compilation of all classes in that directory. I understand that this kind of files do not look really well, but different behavior on different machines is alarming and should not happen. |
@TiGR this looks like a filesystem sorting issue which makes it scan one dir before the other depending on the machine. Not really alarming. Anyway if nusoap.php is a compilation of everything, it should find the classes. I don't see why you would get class not found errors? |
@Seldaek First it loads some class from separate file. Next, it loads nusoap.php, where already loaded class is also present. As php meets already defined class it throws fatal error. Well, actually my error is not "Class not found", but "Cannot redeclare defined class". Huh, I suppose this should be a separate issue. |
Yes indeed reporting a new issue would be best. |
@Seldaek is it possible to split it or should I repost? |
You can copy your comment in a new issue, github doesn't allow splitting. |
Done, thanks. issue #1790 |
I randomly encounter same issue. Restarting web-server seems resolve that. It complains some classes were not exists. Weird. |
@toopay my guess is that's an APC cache issue, but I may be wrong. |
@toopay any luck getting things to work? If I first enter ck.lo in my web browser -> ck.lo works, but z.lo not, and after restart php if I first enter z.lo in webbr. z.lo works but ck.lo not. If project 'z' doesnt work it shows error like thisone
After digging I noticed that file app/cache/dev/classes.php.meta has wrong paths for classes
my phpinfo http://pastebin.com/6FSPwrNt |
@darektw I'm not remember when this issue were resolved in my end, but yeah i never encounter similar issue. I would assume there is something wrong with your cache, @Seldaek should be able to explain better on that. I do still have interminent memory issue (i guess similar to #1898) and were using HHVM to run the composer and alleviate the issue. |
@Seldaek sorry, i forgot this issue. Yes, i got things running and yes, your guess was correct, the problem was not related to composer, but to some php caching. So... For me, resolved. |
Ran into the exact same issue, Ubuntu 12.04 LTS (server) w/ PHP 5.4.36 and APC enabled. Disabling APC makes the problem go away. But disabling APC was not an option, so running |
I get really strange "class not found"-fatal-errors with composer since my last composer::selfupdate. Standard classes of symfony/symfony like the ParameterBag or Request could not be found.
Yesterday i had a small chat with apanek in the composer channel in freenode. He told me to give you everything in the following gist with hope someone can "shed some light on that": https://gist.github.com/rejinka/5186727
Right now with my autoload-files "Assetic\Extension\Twig\AsseticExtension" can not be found.
P.S.: Composer version d929a08
The text was updated successfully, but these errors were encountered: